Opened 5 years ago

Closed 3 years ago

#16069 closed enhancement (fixed)

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

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

Description (last modified by 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 5 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:2 Changed 5 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4

comment:3 Changed 3 years ago by jdemeyer

  • Component changed from distribution to python3

comment:4 Changed 3 years ago by chapoton

  • Description modified (diff)

comment:5 Changed 3 years ago by chapoton

See #20694 and #20713 for builtins

Last edited 3 years ago by chapoton (previous) (diff)

comment:6 Changed 3 years ago by chapoton

see #20957 for httplib

comment:7 Changed 3 years ago by chapoton

see #21115 for copyreg

comment:8 Changed 3 years ago by chapoton

  • Description modified (diff)

comment:9 Changed 3 years ago by chapoton

  • Description modified (diff)

comment:10 Changed 3 years ago by chapoton

  • Description modified (diff)
  • Milestone changed from sage-6.4 to sage-7.4

comment:11 Changed 3 years ago by chapoton

  • Branch set to public/16069
  • Commit set to 6fc5c52ddc732b722d50378197853e4c8e48b801
  • Status changed from new to needs_review

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


New commits:

6fc5c52handling more moved imports

comment:12 Changed 3 years ago by chapoton

  • Authors set to Frédéric Chapoton
  • Cc tscrim jdemeyer aapitzsch added

comment:13 Changed 3 years ago by jdemeyer

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 3 years ago by git

  • Commit changed from 6fc5c52ddc732b722d50378197853e4c8e48b801 to 5d3292de73ec4041c66a05f2fbe9b5899acd2eec

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

5d3292dtrac 16069 remove import in global_options

comment:15 Changed 3 years ago by chapoton

done

comment:16 Changed 3 years ago by jdemeyer

  • Reviewers set to Jeroen Demeyer

comment:17 Changed 3 years ago by jdemeyer

  • Status changed from needs_review to positive_review

comment:18 Changed 3 years ago by vbraun

  • Branch changed from public/16069 to 5d3292de73ec4041c66a05f2fbe9b5899acd2eec
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.