Opened 9 years ago
Closed 7 years ago
#16080 closed enhancement (fixed)
Python 3 preparation: Handle the renaming of "urllib" and "urllib2"
Reported by:  Wilfried Luebbe  Owned by:  

Priority:  major  Milestone:  sage6.10 
Component:  distribution  Keywords:  python3 
Cc:  Merged in:  
Authors:  Frédéric Chapoton  Reviewers:  Volker Braun, R. Andrew Ohana 
Report Upstream:  N/A  Work issues:  
Branch:  3098f5f (Commits, GitHub, GitLab)  Commit:  3098f5fa5eecfff7fae914b99964831ab01d3d4f 
Dependencies:  Stopgaps: 
Description
The tool 2to3 changes the respective import statements to the new Py3 names.
But the code has to depend on the Python version!
There are 16 effected modules.
This ticket is tracked as a dependency of metaticket ticket:16052.
Change History (18)
comment:1 Changed 9 years ago by
Milestone:  sage6.2 → sage6.3 

comment:2 Changed 8 years ago by
Milestone:  sage6.3 → sage6.4 

comment:3 Changed 7 years ago by
Authors:  → Frédéric Chapoton 

Branch:  → public/16080 
Commit:  → c9f3a9882700609ea007846211b79f02287864ed 
Milestone:  sage6.4 → sage6.10 
Status:  new → needs_review 
comment:4 Changed 7 years ago by
Commit:  c9f3a9882700609ea007846211b79f02287864ed → ab05e0685d4b654bac10348e9f3b795713f0d14a 

Branch pushed to git repo; I updated commit sha1. New commits:
ab05e06  trac #16080 correct one doctest

comment:5 Changed 7 years ago by
Commit:  ab05e0685d4b654bac10348e9f3b795713f0d14a → 3ac77d397fb2e1a8cab3cfe049e88fc3b8a2716b 

Branch pushed to git repo; I updated commit sha1. New commits:
3ac77d3  trac #16080 move back 3 imports inside functions

comment:6 Changed 7 years ago by
Could you use six.moves.urllib
instead? We already include six as a standard package, so it is fine to use it.
comment:8 Changed 7 years ago by
I was using this page
http://python3porting.com/stdlib.html
as a reference, and it says that six could not handle urllib. Maybe this is outdated ?
Do we really gain something by using six instead of the "try except" ? In other words, do you really want me to spend more time on that ? I may have other things to do.
comment:9 Changed 7 years ago by
Commit:  3ac77d397fb2e1a8cab3cfe049e88fc3b8a2716b → 99699f60ccb23c01102f3d6dd4251449d840bdb1 

Branch pushed to git repo; I updated commit sha1. New commits:
99699f6  trac #16080 now redone using six.moves

comment:10 Changed 7 years ago by
Reviewers:  → Volker Braun, R. Andrew Ohana 

Status:  needs_review → positive_review 
comment:11 Changed 7 years ago by
Status:  positive_review → needs_work 

merge conflict, probably with #19296
comment:12 Changed 7 years ago by
This does not work. Some imports have to be modified. Work in progress.
comment:13 Changed 7 years ago by
Commit:  99699f60ccb23c01102f3d6dd4251449d840bdb1 → f848c3b3d283126b5238cafae7228095036a160d 

Branch pushed to git repo; I updated commit sha1. New commits:
f848c3b  trac #16080 correcting some imports

comment:14 Changed 7 years ago by
Commit:  f848c3b3d283126b5238cafae7228095036a160d → 3098f5fa5eecfff7fae914b99964831ab01d3d4f 

Branch pushed to git repo; I updated commit sha1. New commits:
3098f5f  Merge branch 'public/16080' into 6.10.b5

comment:15 Changed 7 years ago by
Status:  needs_work → needs_review 

Better wait for the bot's green light before setting back to positive review.
comment:17 Changed 7 years ago by
Status:  needs_review → positive_review 

comment:18 Changed 7 years ago by
Branch:  public/16080 → 3098f5fa5eecfff7fae914b99964831ab01d3d4f 

Resolution:  → fixed 
Status:  positive_review → closed 
New commits:
trac #16080 changing imports of urllib,urrlib2,urlparse for py3 compatibility