Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pathutils error on extremely long paths in Windows #163

Closed
guykisel opened this issue Apr 13, 2016 · 2 comments
Closed

pathutils error on extremely long paths in Windows #163

guykisel opened this issue Apr 13, 2016 · 2 comments

Comments

@guykisel
Copy link
Contributor

Traceback (most recent call last):
  File "C:\Python27\Lib\runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "C:\Python27\Lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Users\gkisel\Envs\inline\Scripts\prospector.exe\__main__.py", line 9, in <module>
  File "C:\Users\gkisel\Envs\inline\lib\site-packages\prospector\run.py", line 159, in main
    prospector.execute()
  File "C:\Users\gkisel\Envs\inline\lib\site-packages\prospector\run.py", line 48, in execute
    self.config.explicit_file_mode, self.config.workdir)
  File "C:\Users\gkisel\Envs\inline\lib\site-packages\prospector\finder.py", line 197, in find_python
    files, modules, directories, packages = _find_paths(ignores, paths[0], paths[0])
  File "C:\Users\gkisel\Envs\inline\lib\site-packages\prospector\finder.py", line 171, in _find_paths
    recurse = _find_paths(ignore, os.path.join(curpath, filename), rootpath)
  File "C:\Users\gkisel\Envs\inline\lib\site-packages\prospector\finder.py", line 171, in _find_paths
    recurse = _find_paths(ignore, os.path.join(curpath, filename), rootpath)
  File "C:\Users\gkisel\Envs\inline\lib\site-packages\prospector\finder.py", line 171, in _find_paths
    recurse = _find_paths(ignore, os.path.join(curpath, filename), rootpath)
  File "C:\Users\gkisel\Envs\inline\lib\site-packages\prospector\finder.py", line 171, in _find_paths
    recurse = _find_paths(ignore, os.path.join(curpath, filename), rootpath)
  File "C:\Users\gkisel\Envs\inline\lib\site-packages\prospector\finder.py", line 171, in _find_paths
    recurse = _find_paths(ignore, os.path.join(curpath, filename), rootpath)
  File "C:\Users\gkisel\Envs\inline\lib\site-packages\prospector\finder.py", line 171, in _find_paths
    recurse = _find_paths(ignore, os.path.join(curpath, filename), rootpath)
  File "C:\Users\gkisel\Envs\inline\lib\site-packages\prospector\finder.py", line 171, in _find_paths
    recurse = _find_paths(ignore, os.path.join(curpath, filename), rootpath)
  File "C:\Users\gkisel\Envs\inline\lib\site-packages\prospector\finder.py", line 171, in _find_paths
    recurse = _find_paths(ignore, os.path.join(curpath, filename), rootpath)
  File "C:\Users\gkisel\Envs\inline\lib\site-packages\prospector\finder.py", line 171, in _find_paths
    recurse = _find_paths(ignore, os.path.join(curpath, filename), rootpath)
  File "C:\Users\gkisel\Envs\inline\lib\site-packages\prospector\finder.py", line 171, in _find_paths
    recurse = _find_paths(ignore, os.path.join(curpath, filename), rootpath)
  File "C:\Users\gkisel\Envs\inline\lib\site-packages\prospector\finder.py", line 171, in _find_paths
    recurse = _find_paths(ignore, os.path.join(curpath, filename), rootpath)
  File "C:\Users\gkisel\Envs\inline\lib\site-packages\prospector\finder.py", line 171, in _find_paths
    recurse = _find_paths(ignore, os.path.join(curpath, filename), rootpath)
  File "C:\Users\gkisel\Envs\inline\lib\site-packages\prospector\finder.py", line 171, in _find_paths
    recurse = _find_paths(ignore, os.path.join(curpath, filename), rootpath)
  File "C:\Users\gkisel\Envs\inline\lib\site-packages\prospector\finder.py", line 171, in _find_paths
    recurse = _find_paths(ignore, os.path.join(curpath, filename), rootpath)
  File "C:\Users\gkisel\Envs\inline\lib\site-packages\prospector\finder.py", line 171, in _find_paths
    recurse = _find_paths(ignore, os.path.join(curpath, filename), rootpath)
  File "C:\Users\gkisel\Envs\inline\lib\site-packages\prospector\finder.py", line 171, in _find_paths
    recurse = _find_paths(ignore, os.path.join(curpath, filename), rootpath)
  File "C:\Users\gkisel\Envs\inline\lib\site-packages\prospector\finder.py", line 171, in _find_paths
    recurse = _find_paths(ignore, os.path.join(curpath, filename), rootpath)
  File "C:\Users\gkisel\Envs\inline\lib\site-packages\prospector\finder.py", line 171, in _find_paths
    recurse = _find_paths(ignore, os.path.join(curpath, filename), rootpath)
  File "C:\Users\gkisel\Envs\inline\lib\site-packages\prospector\finder.py", line 171, in _find_paths
    recurse = _find_paths(ignore, os.path.join(curpath, filename), rootpath)
  File "C:\Users\gkisel\Envs\inline\lib\site-packages\prospector\finder.py", line 159, in _find_paths
    if is_virtualenv(fullpath):
  File "C:\Users\gkisel\Envs\inline\lib\site-packages\prospector\pathutils.py", line 11, in is_virtualenv
    dircontents = os.listdir(path)
WindowsError: [Error 3] The system cannot find the path specified: 'C:\\Users\\gkisel\\Documents\\inline-plz\\node_modules\\jscs\\node_modules\\babel-jscs\\node_modules\\babel-core\\node_modules\\regenerator\\node_modules\\defs\\node_mo
les\\yargs\\node_modules\\cliui\\node_modules\\right-align\\node_modules\\align-text\\node_modules\\repeat-string/*.*'

I believe the problem here might be that the path is near (or over) the Windows maximum path length. I think this might be fixable by wrapping this call: https://github.com/landscapeio/prospector/blob/master/prospector/pathutils.py#L11 with a try/except and just ignoring directories that have this problem.

This is probably pretty low priority to fix because I doubt most people are working in combined python/node.js projects.

I'd be happy to attempt a fix and submit a PR if you don't want to do it yourself :)

@guykisel
Copy link
Contributor Author

Actually just noticed this looks very similar to #159

@carlio
Copy link
Member

carlio commented Aug 3, 2016

🍰 awesome.

@carlio carlio closed this as completed Aug 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants