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

Upgrade to Python 2.7.12 #19735

Closed
slel opened this issue Dec 16, 2015 · 22 comments
Closed

Upgrade to Python 2.7.12 #19735

slel opened this issue Dec 16, 2015 · 22 comments

Comments

@slel
Copy link
Member

slel commented Dec 16, 2015

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.

CC: @dimpase @kiwifb @nexttime @vbraun @wluebbe

Component: packages: standard

Author: François Bissey

Branch/Commit: 85e931b

Reviewer: Volker Braun

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

@slel slel added this to the sage-7.0 milestone Dec 16, 2015
@kiwifb
Copy link
Member

kiwifb commented Jan 7, 2016

comment:1

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

sage: from sage.misc.sage_timeit import sage_timeit
sage: sage_timeit('3^100000', globals(), preparse=True, number=50)
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-2-e93b8105f8e1> in <module>()
----> 1 sage_timeit('3^100000', globals(), preparse=True, number=Integer(50))

/home/frb15/gentoo/usr/lib/python2.7/site-packages/sage/misc/sage_timeit.pyc in sage_timeit(stmt, globals_dict, preparse, number, repeat, precision, seconds)
   218     # to the shell namespace?
   219 
--> 220     src = timeit_.template % {'stmt': timeit_.reindent(stmt, 8), 'setup': "pass"}
   221     code = compile(src, "<magic-timeit>", "exec")
   222     ns = {}

KeyError: ‘init’

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.

@slel

This comment has been minimized.

@slel slel changed the title upgrade Python to 2.7.11 Upgrade to Python 2.7.12 Jul 13, 2016
@dimpase
Copy link
Member

dimpase commented Oct 6, 2016

comment:3

what is the plan? this ticket seems to be important for Sage support on OSX 10.12 (aka Sierra), see #21567

@kiwifb
Copy link
Member

kiwifb commented Oct 6, 2016

comment:4

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.

@jdemeyer
Copy link

jdemeyer commented Oct 6, 2016

Dependencies: #21552

@kiwifb
Copy link
Member

kiwifb commented Nov 30, 2016

comment:6

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.

@jdemeyer

This comment has been minimized.

@jdemeyer
Copy link

jdemeyer commented Dec 7, 2016

Changed dependencies from #21552 to none

@tobihan
Copy link

tobihan commented Dec 7, 2016

comment:9

It looks like just the error message of the expected error changed. So it's just a matter of updating the doctest, no?

@kiwifb
Copy link
Member

kiwifb commented Dec 7, 2016

comment:10

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.

@kiwifb
Copy link
Member

kiwifb commented Dec 7, 2016

comment:11

I am putting a branch together now.

@kiwifb
Copy link
Member

kiwifb commented Dec 7, 2016

comment:12

At least one of the patches has actually been upstreamed, removing...

@tobihan
Copy link

tobihan commented Dec 7, 2016

comment:13

I didn't find a reference to #1222585 in the python Debian package.

@kiwifb
Copy link
Member

kiwifb commented Dec 7, 2016

comment:14

Replying to @tobihan:

I didn't find a reference to #1222585 in the python Debian package.

I guess one of the person pushing was a Gentoo dev. It is useful and the correct thing to do but the impact is probably invisible on a full GNU system.

@kiwifb
Copy link
Member

kiwifb commented Dec 7, 2016

comment:15

The tinfo.patch which looks like is cygwin stuff needs work or possibly removal.

@kiwifb
Copy link
Member

kiwifb commented Dec 7, 2016

comment:16

xcode stuff added, will be trivial to regenerate the patch.

@kiwifb
Copy link
Member

kiwifb commented Dec 8, 2016

Author: François Bissey

@kiwifb
Copy link
Member

kiwifb commented Dec 8, 2016

Commit: 85e931b

@kiwifb
Copy link
Member

kiwifb commented Dec 8, 2016

comment:17

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:

c35ea3cUpgrade python2 to 2.7.12 and update tinfo and uuid patches
85e931bfix sage_timeit and word.py for python 2.7.12

@kiwifb
Copy link
Member

kiwifb commented Dec 8, 2016

Branch: u/fbissey/python2.7.12

@vbraun
Copy link
Member

vbraun commented Dec 10, 2016

Reviewer: Volker Braun

@vbraun
Copy link
Member

vbraun commented Dec 11, 2016

Changed branch from u/fbissey/python2.7.12 to 85e931b

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

6 participants