TabError: inconsistent use of tabs and spaces in indentation
- Dominant language
- Python
- Stars
- 7.5k
- Forks
- 424
- PR merge metrics
- No merged PRs in 30d
Description
I get following error while I run `pipreqs .` on Windows or Linux both.
```
Traceback (most recent call last):
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\User\AppData\Local\Programs\Python\Python39\Scripts\pipreqs.exe\__main__.py", line 7, in
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\pipreqs\pipreqs.py", line 528, in main
init(args)
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\pipreqs\pipreqs.py", line 455, in init
candidates = get_all_imports(input_path,
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\pipreqs\pipreqs.py", line 131, in get_all_imports
raise exc
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\pipreqs\pipreqs.py", line 117, in get_all_imports
tree = ast.parse(contents)
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\ast.py", line 51, in parse
return compile(source, filename, mode, flags, _feature_version=feature_version)
File "", line 44
super(MyThread, self).__init__(group=group, target=target,
TabError: inconsistent use of tabs and spaces in indentation
```
Contributor guide
Research direction
Start by reproducing `pipreqs .` and trace the reported path through `pipreqs.py`, especially `get_all_imports` and its `ast.parse(contents)` call. Inspect the input project's source around the reported line 44; done means determining whether the failure originates in pipreqs or the scanned project's inconsistent indentation and documenting or testing the appropriate behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100