bndr / bndr/pipreqs

except SyntaxError, err: SyntaxError: invalid syntax

Open
#367 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
7.5k
Forks
424
PR merge metrics
No merged PRs in 30d

Description

```
C:\Users\smeta>pipreqs
ERROR: Failed on file: C:\Users\smeta\.vscode\extensions\.ms-python.python-2021.2.636928669\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevconsole_code_for_ironpython.py
Traceback (most recent call last):
File "c:\users\smeta\anaconda3\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\users\smeta\anaconda3\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "c:\users\smeta\anaconda3\scripts\pipreqs.exe\__main__.py", line 7, in
File "c:\users\smeta\anaconda3\lib\site-packages\pipreqs\pipreqs.py", line 528, in main
init(args)
File "c:\users\smeta\anaconda3\lib\site-packages\pipreqs\pipreqs.py", line 455, in init
candidates = get_all_imports(input_path,
File "c:\users\smeta\anaconda3\lib\site-packages\pipreqs\pipreqs.py", line 131, in get_all_imports
raise exc
File "c:\users\smeta\anaconda3\lib\site-packages\pipreqs\pipreqs.py", line 117, in get_all_imports
tree = ast.parse(contents)
File "c:\users\smeta\anaconda3\lib\ast.py", line 47, in parse
return compile(source, filename, mode, flags,
File "", line 105
except SyntaxError, err:
^
SyntaxError: invalid syntax
```
I just downloaded it, and encountered an error

Contributor guide

Open the contributing guide

Research direction

Start in pipreqs.py at get_all_imports, especially the ast.parse call around lines 117-131, and inspect the reported debugpy file containing Python 2 syntax. Reproduce the failure with the shown Windows path and determine the expected behavior for that file; done means the reported scan no longer fails unexpectedly.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.