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

FileNotFoundError path to script has spaces #105

Closed
Ashesh3 opened this issue Sep 1, 2020 · 1 comment
Closed

FileNotFoundError path to script has spaces #105

Ashesh3 opened this issue Sep 1, 2020 · 1 comment

Comments

@Ashesh3
Copy link

Ashesh3 commented Sep 1, 2020

Description

Running a profiler exits with an exception when the path to the script has a space in it

How to reproduce
  1. Make a python file in C:\Users\test\Desktop\Folder 1\Folder 2\script.py
  2. Now try to run the profiler by vprof -c ph C:\\Users\\test\\Desktop\\Folder 1\\Folder 2\\script.py
  3. Terminates with an exception:
Running CodeHeatmapProfiler...
Traceback (most recent call last):
  File "c:\users\test\appdata\local\programs\python\python38-32\lib\runpy.py", line 193, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\test\appdata\local\programs\python\python38-32\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\test\AppData\Local\Programs\Python\Python38-32\Scripts\vprof.exe\__main__.py", line 7, in <module>
  File "c:\users\test\appdata\local\programs\python\python38-32\lib\site-packages\vprof\__main__.py", line 83, in main
    program_stats = runner.run_profilers(source, config, verbose=True)
  File "c:\users\test\appdata\local\programs\python\python38-32\lib\site-packages\vprof\runner.py", line 73, in run_profilers
    run_stats[option] = curr_profiler.run()
  File "c:\users\test\appdata\local\programs\python\python38-32\lib\site-packages\vprof\base_profiler.py", line 169, in run
    return self.profile()
  File "c:\users\test\appdata\local\programs\python\python38-32\lib\site-packages\vprof\code_heatmap.py", line 217, in profile_module
    return base_profiler.run_in_separate_process(self._profile_module)
  File "c:\users\test\appdata\local\programs\python\python38-32\lib\site-packages\vprof\base_profiler.py", line 77, in run_in_separate_process
    raise exc
FileNotFoundError: [Errno 2] No such file or directory: 'c:\\Users\\test\\Desktop\\Folder'
Actual results

Terminates with a File not found exception as shown above

Expected results

It should be able to profile that script which is in a folder with spaces

Version and platform

vprof 0.38
Windows 10

@Zarainia
Copy link

Same issue with arguments with spaces. And unlike with paths you can't just make a link or something to avoid this.

@Ashesh3 Ashesh3 closed this as completed Sep 29, 2022
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