Opened 9 years ago

Closed 6 years ago

#16069 closed enhancement (fixed)

Python 3 preparation: Handle module renames (e.g. in imports)

Reported by: Wilfried Luebbe Owned by:
Priority: major Milestone: sage-7.4
Component: python3 Keywords: python3
Cc: Travis Scrimshaw, Jeroen Demeyer, aapitzsch Merged in:
Authors: Frédéric Chapoton Reviewers: Jeroen Demeyer
Report Upstream: N/A Work issues:
Branch: 5d3292d (Commits, GitHub, GitLab) Commit: 5d3292de73ec4041c66a05f2fbe9b5899acd2eec
Dependencies: Stopgaps:

Status badges

Description (last modified by Frédéric Chapoton)

Sage is mainly hit by

  • the renaming of the Py2 module __builtin__ into builtins in Py3. (#20694 and #20713)

Others are e.g.

The tool 2to3 renames the modules.
But the code has to depend on the Python version!

There are 39 effected modules.

This ticket is tracked as a dependency of meta-ticket ticket:16052.

Change History (18)

comment:1 Changed 9 years ago by For batch modifications

Milestone: sage-6.2sage-6.3

comment:2 Changed 8 years ago by For batch modifications

Milestone: sage-6.3sage-6.4

comment:3 Changed 7 years ago by Jeroen Demeyer

Component: distributionpython3

comment:4 Changed 7 years ago by Frédéric Chapoton

Description: modified (diff)

comment:5 Changed 7 years ago by Frédéric Chapoton

See #20694 and #20713 for builtins

Last edited 7 years ago by Frédéric Chapoton (previous) (diff)

comment:6 Changed 6 years ago by Frédéric Chapoton

see #20957 for httplib

comment:7 Changed 6 years ago by Frédéric Chapoton

see #21115 for copyreg

comment:8 Changed 6 years ago by Frédéric Chapoton

Description: modified (diff)

comment:9 Changed 6 years ago by Frédéric Chapoton

Description: modified (diff)

comment:10 Changed 6 years ago by Frédéric Chapoton

Description: modified (diff)
Milestone: sage-6.4sage-7.4

comment:11 Changed 6 years ago by Frédéric Chapoton

Branch: public/16069
Commit: 6fc5c52ddc732b722d50378197853e4c8e48b801
Status: newneeds_review

Here is a branch handling the few last remaining cases (after #21225)


New commits:

6fc5c52handling more moved imports

comment:12 Changed 6 years ago by Frédéric Chapoton

Authors: Frédéric Chapoton
Cc: Travis Scrimshaw Jeroen Demeyer aapitzsch added

comment:13 Changed 6 years ago by Jeroen Demeyer

In src/sage/structure/global_options.py, could you just remove the import? I don't think that object and str need to be imported.

comment:14 Changed 6 years ago by git

Commit: 6fc5c52ddc732b722d50378197853e4c8e48b8015d3292de73ec4041c66a05f2fbe9b5899acd2eec

Branch pushed to git repo; I updated commit sha1. New commits:

5d3292dtrac 16069 remove import in global_options

comment:15 Changed 6 years ago by Frédéric Chapoton

done

comment:16 Changed 6 years ago by Jeroen Demeyer

Reviewers: Jeroen Demeyer

comment:17 Changed 6 years ago by Jeroen Demeyer

Status: needs_reviewpositive_review

comment:18 Changed 6 years ago by Volker Braun

Branch: public/160695d3292de73ec4041c66a05f2fbe9b5899acd2eec
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.