man-group / pytest-plugins

A grab-bag of nifty pytest plugins
MIT License
568 stars 85 forks source link

Spaces in file names #187

Open flenzen opened 3 years ago

flenzen commented 3 years ago

If the directory from which the program is started contains a space, dot won't be able to render the svg output: pytest --profile --profile-svg yields:

rror: dot: can't open with
Error: dot: can't open a space/prof/combined.svg
Traceback (most recent call last):
  File "/usr/local/Cellar/python@3.9/3.9.0_5/Frameworks/Python.framework/Versions/3.9/bin/gprof2dot", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/site-packages/gprof2dot.py", line 3457, in main
    parser = Format(*args)
  File "/usr/local/lib/python3.9/site-packages/gprof2dot.py", line 2685, in __init__
    self.stats = pstats.Stats(*filename)
  File "/usr/local/Cellar/python@3.9/3.9.0_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/pstats.py", line 114, in __init__
    self.init(arg)
  File "/usr/local/Cellar/python@3.9/3.9.0_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/pstats.py", line 128, in init
    self.load_stats(arg)
  File "/usr/local/Cellar/python@3.9/3.9.0_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/pstats.py", line 141, in load_stats
    with open(arg, 'rb') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/.../path with a space'

This is with platform darwin -- Python 3.9.0, pytest-6.2.5, py-1.10.0, pluggy-1.0.0, plugins: profiling-1.7.0, lazy-fixture-0.6.3.