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

Path splitting #61

Open
ICreedenI opened this issue Mar 18, 2023 · 3 comments
Open

Path splitting #61

ICreedenI opened this issue Mar 18, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@ICreedenI
Copy link

Current Behavior

Raises the following errer:
Failed to run autoflake. Error: Stderr: [Errno 2] No such file or directory: 'Codes/1/a/cr/main.py'

The actual path is C:\Users\Creed\OneDrive\Schul-Dokumente\Programmieren\Python\Meine einzelnen Codes\1\a\cr\main.py and it contains spaces.

Expected Behavior

It works fine with C:\Users\Creed\OneDrive\Desktop\test.py, all unnecessary imports were removed.

Environment

  • Version: v1.0.4
  • Platform: Win 11

It looks like there are no quotes around the path. I hope the solution is as easy as just adding those.

@ICreedenI ICreedenI added the bug Something isn't working label Mar 18, 2023
@34j
Copy link
Owner

34j commented May 18, 2023

Does this mean that backquotes are not allowed? (I can't remember why I did this at all)

https://github.com/34j/vscode-python-extension-core/blob/main/src/packageRunner/optionsBuilderBase.ts#L51-L51

@alessnet
Copy link

Hello @34j

I have the same issue. On Windows, I can't run autoflake if my vscode workspace location include any space.
For instance "C:\Users\Alessandro Work\Documents\Sources\MySuperProject\tools\test.py" is triggering the following error:

Failed to run autoflake.
Error: Stderr: 'c:\Users\Alessandro' is not recognized as an internal or external command,
operable program or batch file.

I think when building the final command line, the path to the file must be quoted.

@thedoctorjtd
Copy link

Can confirm as well. Directory has spaces, autoflake is not happy.

D:\Windows Locations\Documents\Code\project\filepy
Failed to run autoflake. Error: Stderr: 'd:\Windows' is not recognized as an internal or external command, operable program or batch file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants