Opened 4 years ago

Closed 4 years ago

#25534 closed defect (fixed)

2 internet failing doctests in coding/databases.py

Reported by: slabbe Owned by:
Priority: major Milestone: sage-8.3
Component: coding theory Keywords:
Cc: Merged in:
Authors: Frédéric Chapoton Reviewers: Sébastien Labbé
Report Upstream: N/A Work issues:
Branch: 76516a3 (Commits, GitHub, GitLab) Commit: 76516a3dbdd8a3aaad377b8ff9edadafc2183cc4
Dependencies: Stopgaps:

Status badges

Description

As reported on sage-release 8.3.beta3,

sage -tp --optional=sage,internet src/sage/coding/databases.py 

gives

sage -t src/sage/coding/databases.py
**********************************************************************
File "src/sage/coding/databases.py", line 145, in sage.coding.databases.best_linear_code_in_codetables_dot_de
Failed example:
    L = codes.databases.best_linear_code_in_codetables_dot_de(72, 36, GF(2))    # 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 572, 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 982, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.coding.databases.best_linear_code_in_codetables_dot_de[0]>", line 1, in <module>
        L = codes.databases.best_linear_code_in_codetables_dot_de(Integer(72), Integer(36), GF(Integer(2)))    # optional - internet
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/site-packages/sage/coding/databases.py", line 178, in best_linear_code_in_codetables_dot_de
        f = urlopen(url)
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/urllib2.py", line 154, in urlopen
        return opener.open(url, data, timeout)
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/urllib2.py", line 435, in open
        response = meth(req, response)
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/urllib2.py", line 548, in http_response
        'http', request, response, code, msg, hdrs)
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/urllib2.py", line 467, in error
        result = self._call_chain(*args)
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/urllib2.py", line 407, in _call_chain
        result = func(*args)
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/urllib2.py", line 654, in http_error_302
        return self.parent.open(new, timeout=req.timeout)
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/urllib2.py", line 435, in open
        response = meth(req, response)
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/urllib2.py", line 548, in http_response
        'http', request, response, code, msg, hdrs)
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/urllib2.py", line 473, in error
        return self._call_chain(*args)
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/urllib2.py", line 407, in _call_chain
        result = func(*args)
      File "/home/slabbe/GitBox/sage/local/lib/python2.7/urllib2.py", line 556, in http_error_default
        raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
    HTTPError: HTTP Error 404: Not Found
**********************************************************************
File "src/sage/coding/databases.py", line 146, in sage.coding.databases.best_linear_code_in_codetables_dot_de
Failed example:
    print(L)                                                                    # 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 572, 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 982, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.coding.databases.best_linear_code_in_codetables_dot_de[1]>", line 1, in <module>
        print(L)                                                                    # optional - internet
    NameError: name 'L' is not defined
**********************************************************************
1 item had failures:
   2 of   3 in sage.coding.databases.best_linear_code_in_codetables_dot_de
    [7 tests, 2 failures, 1.80 s]
----------------------------------------------------------------------
sage -t src/sage/coding/databases.py  # 2 doctests failed
----------------------------------------------------------------------

Change History (4)

comment:1 Changed 4 years ago by chapoton

Maybe change the link to one using http://www.codetables.de/ ?

comment:2 Changed 4 years ago by chapoton

  • Authors set to Frédéric Chapoton
  • Branch set to public/25534
  • Commit set to 76516a3dbdd8a3aaad377b8ff9edadafc2183cc4
  • Status changed from new to needs_review

done, please review


New commits:

76516a3trac 25534 fix 2 internet doctests in coding/databases

comment:3 Changed 4 years ago by slabbe

  • Reviewers set to Sébastien Labbé
  • Status changed from needs_review to positive_review

comment:4 Changed 4 years ago by vbraun

  • Branch changed from public/25534 to 76516a3dbdd8a3aaad377b8ff9edadafc2183cc4
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.