-
Notifications
You must be signed in to change notification settings - Fork 293
Closed
Description
Bug report
Bug summary
The urllib
submodules (request
, parse
, etc.) are used in a few code paths, most notably the command-line interface. Importing urllib
on its own does nothing, as its __init__.py
is empty (see https://github.com/python/cpython/tree/3.12/Lib/urllib/). This leads to a crash if the code tries to use the modules.
Code for reproduction
$ yt download --list
Actual outcome
Traceback (most recent call last):
File "/home/eric/mambaforge/envs/yt-devel/bin/yt", line 8, in <module>
sys.exit(run_main())
File "/home/eric/build/yt/yt/utilities/command_line.py", line 1613, in run_main
args.func(args)
File "/home/eric/build/yt/yt/utilities/command_line.py", line 223, in run
self(args)
File "/home/eric/build/yt/yt/utilities/command_line.py", line 1555, in __call__
self.get_list()
File "/home/eric/build/yt/yt/utilities/command_line.py", line 1589, in get_list
urllib.request.urlopen("http://yt-project.org/data/datafiles.json")
AttributeError: module 'urllib' has no attribute 'request'
Expected outcome
It should list all the data files available on https://yt-project.org/data.
Version Information
- Operating System: Linux
- Python Version: 3.10.12
- yt version: git main (14c49c4)