pytype icon indicating copy to clipboard operation
pytype copied to clipboard

Error of paths with spaces (Linux)

Open staticdev opened this issue 5 years ago • 3 comments

I am using latest version of pytype with a folder with space and get the error:

$ pwd
/home/user/workspace/folder/subfolder/2019/test/Foregone Solution

$ pytype solution.py
Computing dependencies
Analyzing 1 sources with 0 local dependencies
ninja: Entering directory `/home/user/workspace/folder/subfolder/2019/test/Foregone Solution/.pytype'
ninja: error: dependency cycle: /home/user/workspace/folder/subfolder/2019/test/Foregone -> /home/user/workspace/folder/subfolder/2019/test/Foregone

If I rename the folder to Foregone Solution to ForegoneSolution

$ pytype solution.py
Computing dependencies
Analyzing 1 sources with 0 local dependencies
ninja: Entering directory `/home/user/workspace/folder/subfolder/2019/test/ForegoneSolution/.pytype'
[1/1] check solution
Success: no errors found

staticdev avatar Jan 25 '20 18:01 staticdev

Ha, that's not the error I would've expected (dependency cycle?), but I'm not surprised that we can't handle paths with spaces. I don't think that's tested anywhere. Thanks for the report!

rchen152 avatar Jan 27 '20 17:01 rchen152

A consequence is that Pytype cannot straightforwardly operate upon files store in a Google Drive (since the directory structure by default takes a form such as ~/'Google Drive File Stream'/'My Drive'/...)

alewis avatar Feb 21 '20 15:02 alewis

I am facing the same issue, but with different error thrown:

ninja: Entering directory `/var/lib/jenkins/jobs/ic-iom Build and Release/workspace/.pytype'
ninja: error: build.ninja:13: multiple rules generate /var/lib/jenkins/jobs/ic-iom [-w dupbuild=err]

What's interesting is that ninja enters the right directory, but then obviously it does not escape the whitespaces in the path.

ibozhilov avatar Mar 12 '20 14:03 ibozhilov

I am also encountering this error, with the "multiple rules generate" error message.

wyattscarpenter avatar Mar 30 '24 17:03 wyattscarpenter