Opened 3 years ago

Closed 3 years ago

#28760 closed defect (fixed)

py3: internet str vs bytes doctests failures

Reported by: slabbe Owned by:
Priority: major Milestone: sage-9.0
Component: python3 Keywords:
Cc: Merged in:
Authors: Frédéric Chapoton Reviewers: Sébastien Labbé
Report Upstream: N/A Work issues:
Branch: 1b000e1 (Commits, GitHub, GitLab) Commit: 1b000e1f3858c3189c2786ffb1e31265114de898
Dependencies: Stopgaps:

Status badges

Description (last modified by slabbe)

sage -t --optional=sage,optional,external src/sage/coding/databases.py

gives

----------------------------------------------------------------------
sage -t src/sage/coding/databases.py  # 2 doctests failed
----------------------------------------------------------------------

with errors of that kind:

sage -t src/sage/coding/databases.py
**********************************************************************
File "src/sage/coding/databases.py", line 137, 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/python3.7/site-packages/sage/doctest/forker.py", line 681, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/home/slabbe/GitBox/sage/local/lib/python3.7/site-packages/sage/doctest/forker.py", line 1123, 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/python3.7/site-packages/sage/coding/databases.py", line 174, in best_linear_code_in_codetables_dot_de
        i = s.find("<PRE>")
    TypeError: argument should be integer or bytes-like object, not 'str'
**********************************************************************

Change History (13)

comment:1 Changed 3 years ago by slabbe

Description: modified (diff)

comment:2 Changed 3 years ago by slabbe

Description: modified (diff)

comment:3 Changed 3 years ago by slabbe

Description: modified (diff)

comment:4 Changed 3 years ago by slabbe

Description: modified (diff)

comment:5 Changed 3 years ago by slabbe

Description: modified (diff)

comment:6 Changed 3 years ago by chapoton

Description: modified (diff)

src/sage/misc/persist.pyx is fixed in #28761

comment:7 Changed 3 years ago by chapoton

src/sage/repl/load.py is almost fixed by #28761 too

comment:8 Changed 3 years ago by chapoton

Branch: public/ticket/28760
Commit: 1b000e1f3858c3189c2786ffb1e31265114de898

Here is a fix for databases


New commits:

1b000e1trac 28760 py3 fix for databases

comment:9 Changed 3 years ago by slabbe

Description: modified (diff)

Spliting this ticket and moving the other issues to #28808

comment:10 Changed 3 years ago by slabbe

Status: newneeds_review

comment:11 Changed 3 years ago by slabbe

Authors: Frédéric Chapoton
Reviewers: Sébastien Labbé
Status: needs_reviewpositive_review

comment:12 Changed 3 years ago by slabbe

Summary: py3: imagemagick,internet,latex str vs bytes doctests failurespy3: internet str vs bytes doctests failures

comment:13 Changed 3 years ago by vbraun

Branch: public/ticket/287601b000e1f3858c3189c2786ffb1e31265114de898
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.