Skip to content
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

Unicode issue with modular polynomials database #27569

Closed
kedlaya opened this issue Mar 30, 2019 · 14 comments
Closed

Unicode issue with modular polynomials database #27569

kedlaya opened this issue Mar 30, 2019 · 14 comments

Comments

@kedlaya
Copy link
Sponsor Contributor

kedlaya commented Mar 30, 2019

sage: MP = AtkinModularPolynomialDatabase()
sage: MP[3]
---------------------------------------------------------------------------
UnicodeDecodeError                        Traceback (most recent call last)
<ipython-input-29-920f2702531e> in <module>()
----> 1 MP[Integer(3)]

/home/kedlaya/sage/local/lib/python3.6/site-packages/sage/databases/db_modular_polynomials.py in __getitem__(self, level)
    156                 raise TypeError("Argument level (= %s) must be prime."%N)
    157         modpol = self._dbpath(level)
--> 158         coeff_list = _dbz_to_integer_list(modpol)
    159         if self.model == "Cls":
    160             P = PolynomialRing(IntegerRing(),2,"j")

/home/kedlaya/sage/local/lib/python3.6/site-packages/sage/databases/db_modular_polynomials.py in _dbz_to_integer_list(name)
     65     """
     66     from sage.rings.integer import Integer
---> 67     data = _dbz_to_string(name)
     68     return [[Integer(v) for v in row.strip().split(" ")]
     69             for row in data.split("\n")[:-1]]

/home/kedlaya/sage/local/lib/python3.6/site-packages/sage/databases/db_modular_polynomials.py in _dbz_to_string(name)
     41         raise LookupError("filename {} does not exist".format(filename))
     42 
---> 43     data = bz2.decompress(f.read())
     44 
     45     return data

/home/kedlaya/sage/local/lib/python3.6/codecs.py in decode(self, input, final)
    319         # decode input (taking the buffer into account)
    320         data = self.buffer + input
--> 321         (result, consumed) = self._buffer_decode(data, self.errors, final)
    322         # keep undecoded input until the next call
    323         self.buffer = data[consumed:]

UnicodeDecodeError: 'utf-8' codec can't decode byte 0x90 in position 13: invalid start byte

Component: modular forms

Author: Frédéric Chapoton

Branch/Commit: 8c80a1d

Reviewer: Kiran Kedlaya

Issue created by migration from https://trac.sagemath.org/ticket/27569

@kedlaya kedlaya added this to the sage-8.8 milestone Mar 30, 2019
@kedlaya
Copy link
Sponsor Contributor Author

kedlaya commented Mar 30, 2019

comment:2

Guessing this is a Py3 issue?

@fchapoton
Copy link
Contributor

comment:3

here is a tentative of fix, plus some pep8 cleanup in the modified file


New commits:

f935155trac 27569, python3 fix for modular database

@fchapoton
Copy link
Contributor

Author: Frédéric Chapoton

@fchapoton
Copy link
Contributor

Branch: u/chapoton/27569

@fchapoton
Copy link
Contributor

Commit: f935155

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 30, 2019

Changed commit from f935155 to 6b745dc

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 30, 2019

Branch pushed to git repo; I updated commit sha1. New commits:

6b745dctrac 27569 fixing the doctests

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 30, 2019

Changed commit from 6b745dc to 8c80a1d

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 30, 2019

Branch pushed to git repo; I updated commit sha1. New commits:

8c80a1dtrac 27569 fixing another doctest

@kedlaya
Copy link
Sponsor Contributor Author

kedlaya commented Mar 31, 2019

comment:6

This does fix the issue on my end. But what is going on with the patchbot failures?

@fchapoton
Copy link
Contributor

comment:7

patchbot looks green enough to me

@kedlaya
Copy link
Sponsor Contributor Author

kedlaya commented Apr 4, 2019

comment:8

OK then!

@kedlaya
Copy link
Sponsor Contributor Author

kedlaya commented Apr 4, 2019

Reviewer: Kiran Kedlaya

@vbraun
Copy link
Member

vbraun commented Apr 5, 2019

Changed branch from u/chapoton/27569 to 8c80a1d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants