man-group / man-group/pytest-plugins

Spaces in file names

Open
#187 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
597
Forks
89
PR merge metrics
No merged PRs in 30d

Description

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
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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure by running `pytest --profile --profile-svg` from a directory whose path contains a space on macOS with Python 3.9. Start by tracing how the profiling plugin invokes dot and passes output paths. Done means the command renders the SVG successfully when the working directory contains spaces, with coverage for that path-handling case.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.