Error if script contains Umlauts (like ä,ö,ü)
- Dominant language
- Python
- Stars
- 7.5k
- Forks
- 424
- PR merge metrics
- No merged PRs in 30d
Description
pipreqs trows Error when script contains umlauts:
Stack trace:
```
ERROR: Failed on file: P:\PROJECTS\Dataplot_Preislistendownload\Dataplot_Preisliste.py
Traceback (most recent call last):
File "c:\python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\python39\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Python39\Scripts\pipreqs.exe\__main__.py", line 7, in
File "c:\python39\lib\site-packages\pipreqs\pipreqs.py", line 470, in main
init(args)
File "c:\python39\lib\site-packages\pipreqs\pipreqs.py", line 406, in init
candidates = get_all_imports(input_path,
File "c:\python39\lib\site-packages\pipreqs\pipreqs.py", line 138, in get_all_imports
raise exc
File "c:\python39\lib\site-packages\pipreqs\pipreqs.py", line 124, in get_all_imports
tree = ast.parse(contents)
File "c:\python39\lib\ast.py", line 50, in parse
return compile(source, filename, mode, flags,
File "", line 89
df = df.assign(Wiederverkäufer = round_col(vk - (vk /WVfaktor),2))
^
```
attached affecting Script (please change to *.py :-) )
[Dataplot_Preislist.txt](https://github.com/bndr/pipreqs/files/7104757/Dataplot_Preislist.txt)
Contributor guide
Research direction
Start in pipreqs.py around get_all_imports, especially the lines shown in the traceback where file contents are passed to ast.parse. Run pipreqs against the attached Dataplot_Preislist.txt script and verify that source containing ä, ö, or ü no longer raises an error. Done means the imports are processed successfully for that script.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100