#25614 closed defect (fixed)

2 internet doctest failing in misc/persist.pyx

Reported by: slabbe Owned by:
Priority: major Milestone: sage-8.7
Component: misc Keywords: thursdaysbdx
Cc: vklein Merged in:
Authors: Sébastien Labbé Reviewers: Vincent Klein
Report Upstream: N/A Work issues:
Branch: 307e663 (Commits) Commit: 307e663c7601597a5f44522940db6dfd5c887c23
Dependencies: Stopgaps:

Description

With 8.3.beta6,

sage -t --long --optional=sage,internet src/sage/misc/persist.pyx

gives

sage -t --long src/sage/misc/persist.pyx
**********************************************************************
File "src/sage/misc/persist.pyx", line 78, in sage.misc.persist.load
Failed example:
    s = load(u)                                                  # optional - internet
Exception raised:
    Traceback (most recent call last):
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 573, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 983, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.misc.persist.load[1]>", line 1, in <module>
        s = load(u)                                                  # optional - internet
      File "sage/misc/persist.pyx", line 139, in sage.misc.persist.load (build/cythonized/sage/misc/persist.c:2409)

...

      File "/home/slabbe/GitBox/sage/local/lib/python2.7/socket.py", line 559, in create_connection
        for res in getaddrinfo(host, port, 0, SOCK_STREAM):
    IOError: [Errno socket error] [Errno -2] Name or service not known
**********************************************************************
File "src/sage/misc/persist.pyx", line 81, in sage.misc.persist.load
Failed example:
    s                                                            # optional - internet
Exception raised:
    Traceback (most recent call last):
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 573, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 983, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.misc.persist.load[2]>", line 1, in <module>
        s                                                            # optional - internet
    NameError: name 's' is not defined
**********************************************************************
1 item had failures:
   2 of  20 in sage.misc.persist.load
    [99 tests, 2 failures, 1.14 s]
----------------------------------------------------------------------
sage -t --long src/sage/misc/persist.pyx  # 2 doctests failed
----------------------------------------------------------------------
Total time for all tests: 2.2 seconds
    cpu time: 0.6 seconds
    cumulative wall time: 1.1 seconds
External software detected for doctesting: internet

Change History (11)

comment:1 Changed 16 months ago by slabbe

The failing doctest is:

        sage: u = 'http://sage.math.washington.edu/home/was/db/test.sobj'
        sage: s = load(u)                                                  # optional - internet
        Attempting to load remote file: http://sage.math.washington.edu/home/was/db/test.sobj
        Loading: [.]
        sage: s                                                            # optional - internet
        'hello SAGE'

The link is broken:

$ wget http://sage.math.washington.edu/home/was/db/test.sobj
--2018-08-25 15:26:08--  http://sage.math.washington.edu/home/was/db/test.sobj
Résolution de sage.math.washington.edu (sage.math.washington.edu)… échec : Nom ou service inconnu.
wget : impossible de résoudre l’adresse de l’hôte «sage.math.washington.edu»

comment:2 Changed 16 months ago by slabbe

  • Branch set to u/slabbe/25614
  • Commit set to aac9ba8bf95949d13e79a899ae19783c56f5cbb5

New commits:

aac9ba825614: fixing failing internet doctest

comment:3 Changed 16 months ago by slabbe

I updated the adress of the file in the doctest.

Unfortunately, there is now another error:

sage: u = 'http://www.sagemath.org/files/test.sobj'
sage: load(u)
Attempting to load remote file: http://www.sagemath.org/files/test.sobj
Loading: []
Traceback (most recent call last)
...
UnpicklingError: invalid load key, '<'.

maybe because the way I suggested Harald to create the file test.sobj was wrong? Strange because if I wget the file and load from present working directory then it works.

Help needed!

comment:4 Changed 10 months ago by slabbe

  • Cc vklein added

comment:5 Changed 10 months ago by git

  • Commit changed from aac9ba8bf95949d13e79a899ae19783c56f5cbb5 to 307e663c7601597a5f44522940db6dfd5c887c23

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

78ff01125614: fixing failing internet doctest
307e66325614: fixing verbose prints in doctest

comment:6 Changed 10 months ago by slabbe

  • Authors set to Sébastien Labbé
  • Keywords thursdaysbdx added
  • Status changed from new to needs_review

The fix I proposed months ago now works! Maybe because of #25535, the problem invalid load key disappeared. Needs review!

comment:7 Changed 10 months ago by vklein

  • Owner changed from (none) to vklein
  • Reviewers set to Vincent Klein

comment:8 Changed 10 months ago by vklein

  • Milestone changed from sage-8.3 to sage-8.7

comment:9 Changed 10 months ago by vklein

  • Owner changed from vklein to (none)

comment:10 Changed 10 months ago by vklein

  • Status changed from needs_review to positive_review

Looks good to me.

Last edited 10 months ago by vklein (previous) (diff)

comment:11 Changed 10 months ago by vbraun

  • Branch changed from u/slabbe/25614 to 307e663c7601597a5f44522940db6dfd5c887c23
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.