Opened 3 years ago
Closed 3 years ago
#28154 closed defect (fixed)
SciPy: patch for missing coding lines in some source files
Reported by: | embray | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | sage-8.9 |
Component: | packages: standard | Keywords: | scipy |
Cc: | Merged in: | ||
Authors: | Erik Bray | Reviewers: | Vincent Klein |
Report Upstream: | N/A | Work issues: | |
Branch: | e6ae4f7 (Commits, GitHub, GitLab) | Commit: | e6ae4f7b909b468e23d12f2c40d3aa0ca91d8a2a |
Dependencies: | Stopgaps: |
Description
As originally reported at https://github.com/scipy/scipy/issues/9606 there are a few .py modules in scipy that contain unicode characters in docstrings without supplying a required "coding" line, resulting in a SyntaxError
when you try to compile them.
Normally this is not a problem, because when you build scipy with its setup.py
it just compiles all .pyc
while assuming utf-8 encoding for the source files. If you already have the .pyc
file, then, nothing goes wrong because the SyntaxError
only arises when the Python compiler tries to read the original source file at runtime.
But if for some reason your files' mtimes get messed up (as apparently happened to me at some point; not sure how) and the .pyc has to be regenerated then you'll get a SyntaxError
at import time for these modules.
For now it should suffice to include the following patch:
https://github.com/scipy/scipy/commit/4a8a35f2c27be9f209cfc6f347e7a57a4a62e693.patch
Change History (6)
comment:1 Changed 3 years ago by
- Branch set to u/embray/ticket-28154
- Commit set to e6ae4f7b909b468e23d12f2c40d3aa0ca91d8a2a
- Status changed from new to needs_review
comment:2 Changed 3 years ago by
I guess a package version update is missing : 1.2.0 => 1.2.0.p0
.
comment:3 Changed 3 years ago by
- Reviewers set to Vincent Klein
Apart from that the patch is working and fix the problem.
comment:4 Changed 3 years ago by
This patch is really only relevant if you're installing scipy from scratch in the first place. If it's already built this affects nothing at runtime so it's not necessary to increase the patch level and force needless reinstalls of scipy.
comment:6 Changed 3 years ago by
- Branch changed from u/embray/ticket-28154 to e6ae4f7b909b468e23d12f2c40d3aa0ca91d8a2a
- Resolution set to fixed
- Status changed from positive_review to closed
New commits:
Trac #28154: Patch scipy to including missing coding lines on some source files containing unicode.