Bug Report: -dL Fails with TypeError: object async_generator can't be used in 'await' expression on Python 3.13
Summary
Using the -dL option to load domains from a file causes Subdominator to crash with a TypeError on Python 3.13.
The issue appears to be caused by awaiting an async generator instead of iterating over it with async for.
Environment
| Component |
Version |
| Subdominator |
v3.0.1 |
| Python |
3.13.x |
| Operating System |
Kali Linux |
| Installation Method |
pipx |
Command Used
subdominator -dL wildcards.txt -o subdomain.txt
Input File
wildcards.txt
Expected Behavior
Subdominator should:
- Read domains from the file specified with
-dL
- Enumerate subdomains normally
- Save results to the output file
Actual Behavior
The application terminates immediately with the following exception:
TypeError: object async_generator can't be used in 'await' expression
Full Stack Trace
[INFO]: Loading provider configuration from /home/inteleon404/.config/Subdominator/provider-config.yaml
Traceback (most recent call last):
File "/home/inteleon404/.local/bin/subdominator", line 6, in <module>
sys.exit(main())
~~~~^^
File "/home/inteleon404/.local/share/pipx/venvs/subdominator/lib/python3.13/site-packages/subdominator/cli/app.py", line 375, in main
exit_code = loop.run_until_complete(run(cancel_event=cancel_event))
File "/usr/lib/python3.13/asyncio/base_events.py", line 725, in run_until_complete
return future.result()
~~~~~~~~~~~~~^^
File "/home/inteleon404/.local/share/pipx/venvs/subdominator/lib/python3.13/site-packages/subdominator/cli/app.py", line 262, in run
domains = await _load_domains(args)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/inteleon404/.local/share/pipx/venvs/subdominator/lib/python3.13/site-packages/subdominator/cli/app.py", line 111, in _load_domains
return [line.strip() for line in await FileUtils.stream(args.domain_list) if line.strip()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: object async_generator can't be used in 'await' expression
Suspected Root Cause
The following code appears to await an async generator:
return [line.strip() for line in await FileUtils.stream(args.domain_list) if line.strip()]
If FileUtils.stream() returns an async generator, it should not be awaited directly.
Suggested Fix
Consume the async generator using async for:
domains = []
async for line in FileUtils.stream(args.domain_list):
if line.strip():
domains.append(line.strip())
return domains
Reproducibility
Additional Notes
The issue only occurs when using the -dL option.
Further testing may be needed to determine whether this is:
- A Python 3.13 compatibility issue
- An implementation bug in the domain list loader
- A regression introduced in v3.0.1
Thanks for maintaining the project.
Bug Report:
-dLFails withTypeError: object async_generator can't be used in 'await' expressionon Python 3.13Summary
Using the
-dLoption to load domains from a file causes Subdominator to crash with aTypeErroron Python 3.13.The issue appears to be caused by awaiting an async generator instead of iterating over it with
async for.Environment
Command Used
Input File
wildcards.txtExpected Behavior
Subdominator should:
-dLActual Behavior
The application terminates immediately with the following exception:
Full Stack Trace
Suspected Root Cause
The following code appears to await an async generator:
If
FileUtils.stream()returns an async generator, it should not be awaited directly.Suggested Fix
Consume the async generator using
async for:Reproducibility
Additional Notes
The issue only occurs when using the
-dLoption.Further testing may be needed to determine whether this is:
Thanks for maintaining the project.