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: sage-6.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:

Status badges

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 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 Frédéric Chapoton

Authors: Frédéric Chapoton
Branch: public/16080
Commit: c9f3a9882700609ea007846211b79f02287864ed
Milestone: sage-6.4sage-6.10
Status: newneeds_review

New commits:

c9f3a98trac #16080 changing imports of urllib,urrlib2,urlparse for py3 compatibility

comment:4 Changed 7 years ago by git

Commit: c9f3a9882700609ea007846211b79f02287864edab05e0685d4b654bac10348e9f3b795713f0d14a

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

ab05e06trac #16080 correct one doctest

comment:5 Changed 7 years ago by git

Commit: ab05e0685d4b654bac10348e9f3b795713f0d14a3ac77d397fb2e1a8cab3cfe049e88fc3b8a2716b

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

3ac77d3trac #16080 move back 3 imports inside functions

comment:6 Changed 7 years ago by R. Andrew Ohana

Could you use six.moves.urllib instead? We already include six as a standard package, so it is fine to use it.

comment:7 Changed 7 years ago by Volker Braun

+1 to six.moves.urlib. Rest is great!

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

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 git

Commit: 3ac77d397fb2e1a8cab3cfe049e88fc3b8a2716b99699f60ccb23c01102f3d6dd4251449d840bdb1

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

99699f6trac #16080 now redone using six.moves

comment:10 Changed 7 years ago by Volker Braun

Reviewers: Volker Braun, R. Andrew Ohana
Status: needs_reviewpositive_review

comment:11 Changed 7 years ago by Volker Braun

Status: positive_reviewneeds_work

merge conflict, probably with #19296

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

This does not work. Some imports have to be modified. Work in progress.

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

comment:13 Changed 7 years ago by git

Commit: 99699f60ccb23c01102f3d6dd4251449d840bdb1f848c3b3d283126b5238cafae7228095036a160d

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

f848c3btrac #16080 correcting some imports

comment:14 Changed 7 years ago by git

Commit: f848c3b3d283126b5238cafae7228095036a160d3098f5fa5eecfff7fae914b99964831ab01d3d4f

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

3098f5fMerge branch 'public/16080' into 6.10.b5

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

Status: needs_workneeds_review

Better wait for the bot's green light before setting back to positive review.

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

ok, seems to be good to go. Volker, do you approve ?

comment:17 Changed 7 years ago by Volker Braun

Status: needs_reviewpositive_review

comment:18 Changed 7 years ago by Volker Braun

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