This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2019年06月11日 22:47 by Agrim Sachdeva2, last changed 2022年04月11日 14:59 by admin. This issue is now closed.
| Messages (2) | |||
|---|---|---|---|
| msg345282 - (view) | Author: Agrim Sachdeva (Agrim Sachdeva2) | Date: 2019年06月11日 22:47 | |
If a script that uses urllib is named http.py, the following error occurs: Traceback (most recent call last): File ".\http.py", line 1, in <module> import urllib.request, urllib.parse, urllib.error File "C:\Users\grim\AppData\Local\Programs\Python\Python37\lib\urllib\request.py", line 88, in <module> import http.client File "C:\Python\http.py", line 11, in <module> html = urllib.request.urlopen(url).read() AttributeError: module 'urllib' has no attribute 'request' |
|||
| msg345289 - (view) | Author: Eric V. Smith (eric.smith) * (Python committer) | Date: 2019年06月11日 23:40 | |
Closing as not a bug. This is how python works: you do not want to name a file the same as any standard library module. Use a file name other than http.py. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:59:16 | admin | set | github: 81421 |
| 2019年06月11日 23:40:47 | eric.smith | set | status: open -> closed type: compile error -> behavior components: + Library (Lib), - Windows nosy: + eric.smith, - paul.moore, tim.golden, zach.ware, steve.dower messages: + msg345289 resolution: not a bug stage: resolved |
| 2019年06月11日 22:47:11 | Agrim Sachdeva2 | create | |