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

Error of paths with spaces (Linux) #499

Closed
staticdev opened this issue Jan 25, 2020 · 4 comments · Fixed by #1608
Closed

Error of paths with spaces (Linux) #499

staticdev opened this issue Jan 25, 2020 · 4 comments · Fixed by #1608
Labels
bug cat: infrastructure supported platforms, dependency detection, etc.

Comments

@staticdev
Copy link

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
@rchen152 rchen152 added the bug label Jan 27, 2020
@rchen152
Copy link
Contributor

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!

@alewis
Copy link

alewis commented Feb 21, 2020

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'/...)

@ibozhilov
Copy link

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.

@rchen152 rchen152 added the cat: infrastructure supported platforms, dependency detection, etc. label Jan 19, 2021
@wyattscarpenter
Copy link
Contributor

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

rchen152 added a commit that referenced this issue Apr 3, 2024
For #499. Together with
#1608, this should fix the issue.

PiperOrigin-RevId: 621638737
rchen152 pushed a commit that referenced this issue Apr 9, 2024
…ninja path escape-needing characters (#1608)

This fixes #499. Unfortunately, I was not able to get pytype running on my machine, so this commit is just based on what seems like the right idea to me, and hopefully it can be verified to be correct by a maintainer and then merged.

Resolves #1608

PiperOrigin-RevId: 623037901
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cat: infrastructure supported platforms, dependency detection, etc.
Projects
None yet
5 participants