Opened 5 years ago
Closed 4 years ago
#19735 closed enhancement (fixed)
Upgrade to Python 2.7.12
Reported by: | slelievre | Owned by: | |
---|---|---|---|
Priority: | critical | Milestone: | sage-7.5 |
Component: | packages: standard | Keywords: | |
Cc: | dimpase, fbissey, leif, vbraun, wluebbe | Merged in: | |
Authors: | François Bissey | Reviewers: | Volker Braun |
Report Upstream: | N/A | Work issues: | |
Branch: | 85e931b (Commits) | Commit: | 85e931baf9d76af3b4f011d6b499227b6dd4aea7 |
Dependencies: | Stopgaps: |
Description (last modified by )
Tarball: https://www.python.org/ftp/python/2.7.12/Python-2.7.12.tgz
Since Python 2.7.13 has issues with __new__
, I postpone that to #22037.
Change History (19)
comment:1 Changed 5 years ago by
comment:2 Changed 5 years ago by
- Description modified (diff)
- Summary changed from upgrade Python to 2.7.11 to Upgrade to Python 2.7.12
comment:3 Changed 4 years ago by
what is the plan? this ticket seems to be important for Sage support on OSX 10.12 (aka Sierra), see #21567
comment:4 Changed 4 years ago by
Haven't tested yet, I have a feeling we'll have to fix the timeit
template as I mentioned 9 months ago. I wouldn't think that problem would go away.
comment:5 Changed 4 years ago by
- Dependencies set to #21552
comment:6 Changed 4 years ago by
Gentoo has stabilized 2.7.12 so now I have a few doctests failures because of it.
--- src.orig/sage/misc/sage_timeit.py 2016-11-30 14:54:28.076049582 +1300 +++ src/sage/misc/sage_timeit.py 2016-11-30 15:01:53.256127012 +1300 @@ -218,7 +218,7 @@ # to the shell namespace? src = timeit_.template % {'stmt': timeit_.reindent(stmt, 8), - 'setup': "pass"} + 'setup': "pass", 'init' : ''} code = compile(src, "<magic-timeit>", "exec") ns = {} if not globals_dict:
fixed most of them, but I still have
sage -t --long /usr/lib64/python2.7/site-packages/sage/combinat/words/word.py ********************************************************************** File "/usr/lib64/python2.7/site-packages/sage/combinat/words/word.py", line 511, in sage.combinat.words.word.InfiniteWord_iter_with_caching Failed example: dumps(w) Expected: Traceback (most recent call last): ... PicklingError: Can't pickle <type 'generator'>: attribute lookup __builtin__.generator failed Got: <BLANKLINE> Traceback (most recent call last): File "/usr/lib64/python2.7/site-packages/sage/doctest/forker.py", line 501, in _run self.compile_and_execute(example, compiler, test.globs) File "/usr/lib64/python2.7/site-packages/sage/doctest/forker.py", line 864, in compile_and_execute exec(compiled, globs) File "<doctest sage.combinat.words.word.InfiniteWord_iter_with_caching[9]>", line 1, in <module> dumps(w) File "sage/structure/sage_object.pyx", line 1116, in sage.structure.sage_object.dumps (/scratch2/portage/sci-mathematics/sage-9999/work/sage-9999/src-python2_7/build/cythonized/sage/structure/sage_object.c:13886) return comp.compress(cPickle.dumps(obj, protocol=2)) TypeError: can't pickle generator objects
in quadruple. At least, one doctest is currently in the don't know the cause of failure basket.
comment:7 Changed 4 years ago by
- Description modified (diff)
- Milestone changed from sage-7.0 to sage-7.5
- Priority changed from major to critical
comment:8 Changed 4 years ago by
- Dependencies #21552 deleted
comment:9 Changed 4 years ago by
It looks like just the error message of the expected error changed. So it's just a matter of updating the doctest, no?
comment:10 Changed 4 years ago by
Yes just the error message of the doctest but don't forget to adjust sage_timeit.py
. We have also been discussing inclusion of https://bugs.python.org/issue1222585 in another ticket. Do you also use it in debian? We do in Gentoo.
comment:11 Changed 4 years ago by
I am putting a branch together now.
comment:12 Changed 4 years ago by
At least one of the patches has actually been upstreamed, removing...
comment:13 follow-up: ↓ 14 Changed 4 years ago by
I didn't find a reference to #1222585 in the python Debian package.
comment:14 in reply to: ↑ 13 Changed 4 years ago by
comment:15 Changed 4 years ago by
The tinfo.patch
which looks like is cygwin stuff needs work or possibly removal.
comment:16 Changed 4 years ago by
xcode stuff added, will be trivial to regenerate the patch.
comment:17 Changed 4 years ago by
- Branch set to u/fbissey/python2.7.12
- Commit set to 85e931baf9d76af3b4f011d6b499227b6dd4aea7
- Status changed from new to needs_review
OK, I think the new tinfo.patch
is correct as the migration was trivial. I also had to fix uuid-issue_11063.patch
and it is a bit less trivial there, so whoever thought we need that should look at it. I didn't include the distutils_c++
patch as it should really be done to python2 and python3 and we probably want to limit the changes done in this ticket.
New commits:
c35ea3c | Upgrade python2 to 2.7.12 and update tinfo and uuid patches
|
85e931b | fix sage_timeit and word.py for python 2.7.12
|
comment:18 Changed 4 years ago by
- Reviewers set to Volker Braun
- Status changed from needs_review to positive_review
comment:19 Changed 4 years ago by
- Branch changed from u/fbissey/python2.7.12 to 85e931baf9d76af3b4f011d6b499227b6dd4aea7
- Resolution set to fixed
- Status changed from positive_review to closed
Breaks
timeit
because of https://bugs.python.org/issue5633 more precisely this commit https://hg.python.org/cpython/rev/14d1018940cb.That's the kind of problems
Every single doctest relying on
timeit
breaks. From what I can see from the commit adding'init': ''
to the timeit_.template call may be enough. I haven't tested this yet.