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

not able to find module request in lib urllib - Python35-32 #70168

Closed
kirankotari mannequin opened this issue Dec 30, 2015 · 3 comments
Closed

not able to find module request in lib urllib - Python35-32 #70168

kirankotari mannequin opened this issue Dec 30, 2015 · 3 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@kirankotari
Copy link
Mannequin

kirankotari mannequin commented Dec 30, 2015

BPO 25980
Nosy @brettcannon, @bitdancer

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 = None
closed_at = <Date 2015-12-30.17:51:26.209>
created_at = <Date 2015-12-30.10:15:37.400>
labels = ['invalid', 'type-bug', 'library']
title = 'not able to find module request in lib urllib - Python35-32'
updated_at = <Date 2015-12-30.17:51:26.200>
user = 'https://bugs.python.org/KiranKotari'

bugs.python.org fields:

activity = <Date 2015-12-30.17:51:26.200>
actor = 'brett.cannon'
assignee = 'none'
closed = True
closed_date = <Date 2015-12-30.17:51:26.209>
closer = 'brett.cannon'
components = ['Library (Lib)']
creation = <Date 2015-12-30.10:15:37.400>
creator = 'Kiran Kotari'
dependencies = []
files = []
hgrepos = []
issue_num = 25980
keywords = []
message_count = 3.0
messages = ['257230', '257232', '257233']
nosy_count = 3.0
nosy_names = ['brett.cannon', 'r.david.murray', 'Kiran Kotari']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue25980'
versions = ['Python 3.5']

@kirankotari
Copy link
Mannequin Author

kirankotari mannequin commented Dec 30, 2015

Python 3.5.1 documentation code giving following error:

Error: 
Traceback (most recent call last):
  File ".\urllib1.py", line 5, in <module>
    with urllib.request.urlopen('http://www.py4inf.com/code/romeo.txt') as f:
AttributeError: module 'urllib' has no attribute 'request'

Python Code:

import urllib
with urllib.request.urlopen('http://www.py4inf.com/code/romeo.txt') as f:
    print(f.read())

@kirankotari kirankotari mannequin added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Dec 30, 2015
@bitdancer
Copy link
Member

Can you provide a link to the documentation you find to be in error?

@brettcannon
Copy link
Member

You need to use the line import urllib.request to make the import work as you didn't import the urllib.request module, only the urllib package.

@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
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants