On Monday, August 7, 2017 at 1:25:04 PM UTC+12, François Bissey wrote:
>
>
>
> On 07/08/17 13:18, François Bissey wrote: 
> > On 05/08/17 23:56, Frédéric Chapoton wrote: 
> >> Could you please try with the branch "public/python3-experiment-v0" 
> >> that I have just put in trac. This is a (very ugly) sequence of ad-hoc 
> >> fix-up commits, just to see up to where we can go. 
> >> 
> > 
> > That bit is not python2 compatible: 
> > diff --git a/sage/libs/singular/singular.pyx 
> > b/sage/libs/singular/singular.pyx 
> > index fa8cd7ad8e..f79cbe724f 100644 
> > --- a/sage/libs/singular/singular.pyx 
> > +++ b/sage/libs/singular/singular.pyx 
> > @@ -774,7 +774,8 @@ cdef init_libsingular(): 
> >       if not os.path.exists(lib): 
> >           raise ImportError("cannot locate Singular library 
> > ({})".format(lib)) 
> > 
> > -    handle = dlopen(lib, RTLD_GLOBAL|RTLD_LAZY) 
> > +    lib = bytes(lib, encoding='utf-8') 
> > +    handle = dlopen(lib, RTLD_GLOBAL|RTLD_LAZY) 
> >       if not handle: 
> >           err = dlerror() 
> >           raise ImportError("cannot load Singular library 
> > ({})".format(err)) 
> > 
> > "bytes" is apparently really an alias for "str" in python2.7. 
> > Anyway it breaks when I try to build the doc with python2.7 
> > (I am not trying to build it with python3 until sage starts): 
> >    File "sage/libs/singular/singular.pyx", line 804, in init 
> > sage.libs.singular.singular 
> >      init_libsingular() 
> >    File "sage/libs/singular/singular.pyx", line 777, in 
> > sage.libs.singular.singular.init_libsingular 
> > 
> (/dev/shm/portage/sci-mathematics/sage-9999/work/sage-9999/src-python2_7/build/cythonized/sage/libs/singular/singular.cpp:8508)
>  
>
> > 
> >      lib = bytes(lib, encoding='utf-8') 
> > TypeError: str() takes at most 1 argument (2 given) 
> > 
> > So if we want to keep compatibility this will have to be 
> > guarded by python version. 
> > 
>
> I solved that particular one by replacing the patch with: 
> @@ -774,7 +774,11 @@ cdef init_libsingular(): 
>       if not os.path.exists(lib): 
>           raise ImportError("cannot locate Singular library 
> ({})".format(lib)) 
>
> -    handle = dlopen(lib, RTLD_GLOBAL|RTLD_LAZY) 
> +    try: 
> +        lib = bytes(lib, encoding='utf-8') 
> +    except TypeError: 
> +        pass 
> +    handle = dlopen(lib, RTLD_GLOBAL|RTLD_LAZY) 
>       if not handle: 
>           err = dlerror() 
>           raise ImportError("cannot load Singular library 
> ({})".format(err)) 
>
>
> But no I have another failure building the doc: 
> OSError: [graphs   ] 
> /dev/shm/portage/sci-mathematics/sage-9999/work/sage-9999/src-python2_7/doc/en/reference/graphs/sage/graphs/generic_graph_pyx.rst:11:
>  
>
> WARNING: error while formatting arguments for 
> sage.graphs.generic_graph_pyx.find_hamiltonian: 'ascii' codec can't 
> decode byte 0xc3 in position 30: ordinal not in range(128) 
>
> I may be using some stuff not yet in a beta release so it may be 
> difficult to tease out. 
> I will see on doing experiments on top of 8.1.beta1 proper. 


Same thing on a plain 8.1.beta1
  

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to