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:

Status badges


As originally reported at 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 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:

Change History (6)

comment:1 Changed 3 years ago by embray

  • Authors set to Erik Bray
  • Branch set to u/embray/ticket-28154
  • Commit set to e6ae4f7b909b468e23d12f2c40d3aa0ca91d8a2a
  • Status changed from new to needs_review

New commits:

e6ae4f7Trac #28154: Patch scipy to including missing coding lines on some source files containing unicode.

comment:2 Changed 3 years ago by vklein

I guess a package version update is missing : 1.2.0 => 1.2.0.p0.

comment:3 Changed 3 years ago by vklein

  • Reviewers set to Vincent Klein

Apart from that the patch is working and fixes the problem.

Last edited 3 years ago by slelievre (previous) (diff)

comment:4 Changed 3 years ago by embray

This patch is really only relevant if you're installing scipy from scatch 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.

Version 0, edited 3 years ago by embray (next)

comment:5 Changed 3 years ago by vklein

  • Status changed from needs_review to positive_review

Ok then.

comment:6 Changed 3 years ago by vbraun

  • Branch changed from u/embray/ticket-28154 to e6ae4f7b909b468e23d12f2c40d3aa0ca91d8a2a
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.