Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2to3 does not convert urllib.urlopen to urllib.request.urlopen #49887

Closed
orsenthil opened this issue Apr 1, 2009 · 2 comments
Closed

2to3 does not convert urllib.urlopen to urllib.request.urlopen #49887

orsenthil opened this issue Apr 1, 2009 · 2 comments
Assignees
Labels
type-bug An unexpected behavior, bug, or error

Comments

@orsenthil
Copy link
Member

BPO 5637
Nosy @orsenthil, @benjaminp

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/benjaminp'
closed_at = <Date 2009-04-01.20:54:59.284>
created_at = <Date 2009-04-01.01:57:00.899>
labels = ['type-bug']
title = '2to3 does not convert urllib.urlopen to urllib.request.urlopen'
updated_at = <Date 2009-04-01.20:54:59.282>
user = 'https://github.com/orsenthil'

bugs.python.org fields:

activity = <Date 2009-04-01.20:54:59.282>
actor = 'benjamin.peterson'
assignee = 'benjamin.peterson'
closed = True
closed_date = <Date 2009-04-01.20:54:59.284>
closer = 'benjamin.peterson'
components = []
creation = <Date 2009-04-01.01:57:00.899>
creator = 'orsenthil'
dependencies = []
files = []
hgrepos = []
issue_num = 5637
keywords = []
message_count = 2.0
messages = ['84956', '85090']
nosy_count = 2.0
nosy_names = ['orsenthil', 'benjamin.peterson']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue5637'
versions = ['Python 3.1']

@orsenthil
Copy link
Member Author

In Py2x, have this code:

import urllib
s = urllib.urlopen('http://www.python.org')
print s

Run 2to3, on this, refactoring works only on import urllib and print
statements.

@@ -1,3 +1,3 @@
-import urllib
+import urllib.request, urllib.parse, urllib.error
 s = urllib.urlopen('http://www.python.org')
-print s
+print(s)

There urllib.urlopen, needs to be refactored into urllib.request.urlopen

@orsenthil orsenthil added the type-bug An unexpected behavior, bug, or error label Apr 1, 2009
@benjaminp
Copy link
Contributor

Fixed in r70991.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants