Opened 2 years ago

Closed 2 years ago

#23815 closed enhancement (fixed)

Upgrade to Python 2.7.14

Reported by: slelievre Owned by:
Priority: major Milestone: sage-8.1
Component: packages: standard Keywords:
Cc: Merged in:
Authors: Jeroen Demeyer Reviewers: Volker Braun
Report Upstream: N/A Work issues:
Branch: 741f32f (Commits) Commit: 741f32fbf78266674146422d93d611cdf7d5e534
Dependencies: Stopgaps:

Description (last modified by jdemeyer)

Python 2.7.14 is out:

https://www.python.org/downloads/release/python-2714/

Tarball: https://www.python.org/ftp/python/2.7.14/Python-2.7.14.tgz

Upgrades to Python 2.7.12 (#19735) and 2.7.13 (#22037) involved reverting some changes in Python.

Hopefully the upgrade to Python 2.7.14 goes easier.

Change History (11)

comment:1 Changed 2 years ago by jdemeyer

OK, I am testing it...

comment:2 Changed 2 years ago by jhpalmieri

On OS X it builds, and I get

sage -t --long --warn-long 38.4 src/sage/misc/weak_dict.pyx  # 1 doctest failed
sage -t --long --warn-long 38.4 src/sage/parallel/use_fork.py  # 1 doctest failed
sage -t --long --warn-long 38.4 src/sage/misc/fast_methods.pyx  # 1 doctest failed

In detail:

File "src/sage/misc/weak_dict.pyx", line 37, in sage.misc.weak_dict
Failed example:
    del ValList, v
Expected:
    Exception KeyError: (<__main__.Keys instance at ...>,) in <function remove at ...> ignored
    Exception KeyError: (<__main__.Keys instance at ...>,) in <function remove at ...> ignored
    Exception KeyError: (<__main__.Keys instance at ...>,) in <function remove at ...> ignored
    Exception KeyError: (<__main__.Keys instance at ...>,) in <function remove at ...> ignored
    ...
Got:
    <BLANKLINE>

and

File "src/sage/parallel/use_fork.py", line 146, in sage.parallel.use_fork.p_iter_fork.__call__
Failed example:
    L
Expected:
    [(((Rational Field,), {}),
      "INVALID DATA ('__init__() takes at most 2 positional arguments (4 given)', <type 'sage.rings.integer.Integer'>, (Univariate Polynomial Ring in x over Rational Field, [0, 1], False, True))")]
Got:
    [(((Rational Field,), {}),
      'INVALID DATA __init__() takes at most 2 positional arguments (4 given)')]

and

File "src/sage/misc/fast_methods.pyx", line 305, in sage.misc.fast_methods.Singleton
Failed example:
    loads(dumps(c))
Expected:
    Traceback (most recent call last):
    ...
    AssertionError: (("<class '__main__.D'> is not a direct
    subclass of <class 'sage.misc.fast_methods.Singleton'>",),
    <class '__main__.D'>, ())
Got:
    <BLANKLINE>
    Traceback (most recent call last):
      File "/Users/palmieri/Desktop/Sage_stuff/git/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 515, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/Users/palmieri/Desktop/Sage_stuff/git/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 885, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.misc.fast_methods.Singleton[12]>", line 1, in <module>
        loads(dumps(c))
      File "sage/structure/sage_object.pyx", line 1491, in sage.structure.sage_object.loads (/Users/palmieri/Desktop/Sage_stuff/git/sage/src/build/cythonized/sage/structure/sage_object.c:16071)
        return unpickler.load()
      File "sage/misc/classcall_metaclass.pyx", line 330, in sage.misc.classcall_metaclass.ClasscallMetaclass.__call__ (/Users/palmieri/Desktop/Sage_stuff/git/sage/src/build/cythonized/sage/misc/classcall_metaclass.c:1469)
        return cls.classcall(cls, *args, **kwds)
      File "sage/misc/fast_methods.pyx", line 333, in sage.misc.fast_methods.Singleton.__classcall__ (/Users/palmieri/Desktop/Sage_stuff/git/sage/src/build/cythonized/sage/misc/fast_methods.c:1749)
        assert cls.mro()[1] == Singleton, "{} is not a direct subclass of {}".format(cls, Singleton)
    AssertionError: <class '__main__.D'> is not a direct subclass of <class 'sage.misc.fast_methods.Singleton'>

comment:3 Changed 2 years ago by jdemeyer

Same here:

sage -t --long src/sage/parallel/use_fork.py
**********************************************************************
File "src/sage/parallel/use_fork.py", line 146, in sage.parallel.use_fork.p_iter_fork.__call__
Failed example:
    L
Expected:
    [(((Rational Field,), {}),
      "INVALID DATA ('__init__() takes at most 2 positional arguments (4 given)', <type 'sage.rings.integer.Integer'>, (Univariate Polynomial Ring in x over Rational Field, [0, 1], False, True))")]
Got:
    [(((Rational Field,), {}),
      'INVALID DATA __init__() takes at most 2 positional arguments (4 given)')]
**********************************************************************
1 item had failures:
   1 of  12 in sage.parallel.use_fork.p_iter_fork.__call__
    [28 tests, 1 failure, 0.70 s]
sage -t --long src/sage/misc/fast_methods.pyx
**********************************************************************
File "src/sage/misc/fast_methods.pyx", line 305, in sage.misc.fast_methods.Singleton
Failed example:
    loads(dumps(c))
Expected:
    Traceback (most recent call last):
    ...
    AssertionError: (("<class '__main__.D'> is not a direct
    subclass of <class 'sage.misc.fast_methods.Singleton'>",),
    <class '__main__.D'>, ())
Got:
    <BLANKLINE>
    Traceback (most recent call last):
      File "/usr/local/src/sage-config/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 515, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/usr/local/src/sage-config/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 885, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.misc.fast_methods.Singleton[12]>", line 1, in <module>
        loads(dumps(c))
      File "sage/structure/sage_object.pyx", line 1491, in sage.structure.sage_object.loads (build/cythonized/sage/structure/sage_object.c:16071)
        return unpickler.load()
      File "sage/misc/classcall_metaclass.pyx", line 330, in sage.misc.classcall_metaclass.ClasscallMetaclass.__call__ (build/cythonized/sage/misc/classcall_metaclass.c:1468)
        return cls.classcall(cls, *args, **kwds)
      File "sage/misc/fast_methods.pyx", line 333, in sage.misc.fast_methods.Singleton.__classcall__ (build/cythonized/sage/misc/fast_methods.c:1748)
        assert cls.mro()[1] == Singleton, "{} is not a direct subclass of {}".format(cls, Singleton)
    AssertionError: <class '__main__.D'> is not a direct subclass of <class 'sage.misc.fast_methods.Singleton'>
**********************************************************************
1 item had failures:
   1 of  14 in sage.misc.fast_methods.Singleton
    [79 tests, 1 failure, 0.79 s]
sage -t --long src/sage/misc/weak_dict.pyx
**********************************************************************
File "src/sage/misc/weak_dict.pyx", line 37, in sage.misc.weak_dict
Failed example:
    del ValList, v
Expected:
    Exception KeyError: (<__main__.Keys instance at ...>,) in <function remove at ...> ignored
    Exception KeyError: (<__main__.Keys instance at ...>,) in <function remove at ...> ignored
    Exception KeyError: (<__main__.Keys instance at ...>,) in <function remove at ...> ignored
    Exception KeyError: (<__main__.Keys instance at ...>,) in <function remove at ...> ignored
    ...
Got:
    <BLANKLINE>
**********************************************************************
1 item had failures:
   1 of  28 in sage.misc.weak_dict
    [239 tests, 1 failure, 1.66 s]
----------------------------------------------------------------------
sage -t --long src/sage/parallel/use_fork.py  # 1 doctest failed
sage -t --long src/sage/misc/fast_methods.pyx  # 1 doctest failed
sage -t --long src/sage/misc/weak_dict.pyx  # 1 doctest failed
----------------------------------------------------------------------

comment:4 Changed 2 years ago by jdemeyer

The failures in use_fork.py and fast_methods.pyx are due to different exception propagation in unpickling, that is nothing serious.

comment:5 Changed 2 years ago by slelievre

  • Description modified (diff)

Python 2.7.14 is out.

comment:6 Changed 2 years ago by jdemeyer

  • Authors set to Jeroen Demeyer

comment:7 Changed 2 years ago by jdemeyer

  • Description modified (diff)

comment:8 Changed 2 years ago by jdemeyer

  • Branch set to u/jdemeyer/upgrade_to_python_2_7_14

comment:9 Changed 2 years ago by jdemeyer

  • Commit set to 741f32fbf78266674146422d93d611cdf7d5e534
  • Status changed from new to needs_review
  • Type changed from task to enhancement

In all cases, the doctest failures were because an actual bug in Python was fixed. So it looks right to just update the doctests.


New commits:

741f32fUpgrade to Python 2.7.14

comment:10 Changed 2 years ago by vbraun

  • Reviewers set to Volker Braun
  • Status changed from needs_review to positive_review

comment:11 Changed 2 years ago by vbraun

  • Branch changed from u/jdemeyer/upgrade_to_python_2_7_14 to 741f32fbf78266674146422d93d611cdf7d5e534
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.