New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make cypari2 Python2 / Python3 compatible #22198
Comments
Branch: u/vdelecroix/22198 |
Last 10 new commits:
|
Commit: |
comment:2
Did you actually check that Python 3 works with this patch? |
comment:3
How can I do that?! At least it works in cypari2 with commit 88bf24e. |
Changed branch from u/vdelecroix/22198 to u/jdemeyer/22198 |
comment:5
This is a much simpler version, relying on Cython to convert New commits:
|
comment:6
Note: Cython converts Unicode strings to |
comment:7
For me it compiles but does not work in Python 3
|
comment:8
Actually, in Cython for Python 3 given a string
does not do anything!! (tested with Cython version 0.25.2) |
comment:9
In your patch, |
comment:10
|
comment:11
With your patch, unicode are also not treated correctly (see [comment:7]). |
comment:12
And conversion does fail
I don't understand where the default encoding that you mentioned in [comment:6] is intended to happen. EDIT: this command fails in the same way in Cython |
comment:13
The default encoding is something Cython-specific when passing |
comment:14
Replying to @jdemeyer:
I know and I already mentioned it in [comment:12]: the code behaves the same when compiled in Cython. You can check with
|
comment:15
Replying to @videlec:
Yes, and I already mentioned that it's not about |
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
comment:18
Does this work? |
comment:19
I don't think so: |
comment:20
Actually it fails at compilation
The encoding used seems to be the encoding of the file, not of the system. Adding |
Attachment: cython_string.pyx.gz |
comment:21
Replying to @videlec:
Indeed
|
Changed branch from u/jdemeyer/22198 to u/vdelecroix/22198 |
New commits:
|
comment:24
please see my last commit 6c55c78 that does work in the standalone cypari. |
Reviewer: Jeroen Demeyer, Vincent Delecroix |
Changed author from Vincent Delecroix to Vincent Delecroix, Jeroen Demeyer |
Changed branch from u/vdelecroix/22198 to u/jdemeyer/22198 |
comment:27
Does this work too? It's a slightly more efficient version of your code. New commits:
|
comment:28
It does. |
comment:29
Positive review then? |
Changed branch from u/jdemeyer/22198 to |
Currently string handling in
cypari2
is done viaPyString_AsString
which does not exist in Python 3. We rely on Cython to make proper conversions tobytes
.Depends on #22185
CC: @defeo @jdemeyer
Component: c_lib
Author: Vincent Delecroix, Jeroen Demeyer
Branch/Commit:
7096c82
Reviewer: Jeroen Demeyer, Vincent Delecroix
Issue created by migration from https://trac.sagemath.org/ticket/22198
The text was updated successfully, but these errors were encountered: