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

2 internet doctest failing in misc/persist.pyx #25614

Closed
seblabbe opened this issue Jun 19, 2018 · 13 comments
Closed

2 internet doctest failing in misc/persist.pyx #25614

seblabbe opened this issue Jun 19, 2018 · 13 comments

Comments

@seblabbe
Copy link
Contributor

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

CC: @vinklein

Component: misc

Keywords: thursdaysbdx

Author: Sébastien Labbé

Branch/Commit: 307e663

Reviewer: Vincent Klein

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

@seblabbe seblabbe added this to the sage-8.3 milestone Jun 19, 2018
@seblabbe
Copy link
Contributor Author

comment:1

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»

@seblabbe
Copy link
Contributor Author

seblabbe commented Sep 1, 2018

Commit: aac9ba8

@seblabbe
Copy link
Contributor Author

seblabbe commented Sep 1, 2018

Branch: u/slabbe/25614

@seblabbe
Copy link
Contributor Author

seblabbe commented Sep 1, 2018

New commits:

aac9ba825614: fixing failing internet doctest

@seblabbe
Copy link
Contributor Author

seblabbe commented Sep 1, 2018

comment:3

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!

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 28, 2019

Changed commit from aac9ba8 to 307e663

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 28, 2019

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

@seblabbe
Copy link
Contributor Author

comment:6

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

@seblabbe
Copy link
Contributor Author

Author: Sébastien Labbé

@seblabbe
Copy link
Contributor Author

Changed keywords from none to thursdaysbdx

@vinklein
Copy link
Mannequin

vinklein mannequin commented Feb 28, 2019

Reviewer: Vincent Klein

@vinklein vinklein mannequin self-assigned this Feb 28, 2019
@vinklein vinklein mannequin modified the milestones: sage-8.3, sage-8.7 Feb 28, 2019
@vinklein vinklein mannequin removed their assignment Feb 28, 2019
@vinklein
Copy link
Mannequin

vinklein mannequin commented Feb 28, 2019

comment:10

Looks good to me.

@vbraun
Copy link
Member

vbraun commented Mar 2, 2019

Changed branch from u/slabbe/25614 to 307e663

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

2 participants