Opened 6 years ago

Closed 4 years ago

#16080 closed enhancement (fixed)

Python 3 preparation: Handle the renaming of "urllib" and "urllib2"

Reported by: wluebbe 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) 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 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 4 years ago by chapoton

  • Authors set to Frédéric Chapoton
  • Branch set to public/16080
  • Commit set to c9f3a9882700609ea007846211b79f02287864ed
  • Milestone changed from sage-6.4 to sage-6.10
  • Status changed from new to needs_review

New commits:

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

comment:4 Changed 4 years ago by git

  • Commit changed from c9f3a9882700609ea007846211b79f02287864ed to ab05e0685d4b654bac10348e9f3b795713f0d14a

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

ab05e06trac #16080 correct one doctest

comment:5 Changed 4 years ago by git

  • Commit changed from ab05e0685d4b654bac10348e9f3b795713f0d14a to 3ac77d397fb2e1a8cab3cfe049e88fc3b8a2716b

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

3ac77d3trac #16080 move back 3 imports inside functions

comment:6 Changed 4 years ago by ohanar

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 4 years ago by vbraun

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

comment:8 Changed 4 years ago by 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 4 years ago by git

  • Commit changed from 3ac77d397fb2e1a8cab3cfe049e88fc3b8a2716b to 99699f60ccb23c01102f3d6dd4251449d840bdb1

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

99699f6trac #16080 now redone using six.moves

comment:10 Changed 4 years ago by vbraun

  • Reviewers set to Volker Braun, R. Andrew Ohana
  • Status changed from needs_review to positive_review

comment:11 Changed 4 years ago by vbraun

  • Status changed from positive_review to needs_work

merge conflict, probably with #19296

comment:12 Changed 4 years ago by chapoton

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

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

comment:13 Changed 4 years ago by git

  • Commit changed from 99699f60ccb23c01102f3d6dd4251449d840bdb1 to f848c3b3d283126b5238cafae7228095036a160d

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

f848c3btrac #16080 correcting some imports

comment:14 Changed 4 years ago by git

  • Commit changed from f848c3b3d283126b5238cafae7228095036a160d to 3098f5fa5eecfff7fae914b99964831ab01d3d4f

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

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

comment:15 Changed 4 years ago by chapoton

  • Status changed from needs_work to needs_review

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

comment:16 Changed 4 years ago by chapoton

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

comment:17 Changed 4 years ago by vbraun

  • Status changed from needs_review to positive_review

comment:18 Changed 4 years ago by vbraun

  • Branch changed from public/16080 to 3098f5fa5eecfff7fae914b99964831ab01d3d4f
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.