man-group / man-group/pytest-plugins
Spaces in CWD cause pipes to fail
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 597
- Forks
- 89
- PR merge metrics
- No merged PRs in 30d
Description
If the current working directory has spaces in it, the pstats to pipe will fail as the variables are not quoted. The pipes library correctly quotes the assignment of IN and OUT but the command needs to quote them:
```
t.append("{} -f pstats \"$IN\"".format(self.gprof2dot), "f-")
t.append("dot -Tsvg -o \"$OUT\"", "-f")
```
Of course that will fail if there is a double quote in the current path, so an alternative would be temporary files or doing the interprocess plumbing but the quoting above does at least solve the situation where somebody is working in a directory with a space somewhere on the path.
Working in a symlink path doesn't help (which is what I do) as os.path resolves the path to its actual path in the filesystem.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the pipes library code that builds the pstats and dot command strings shown in the issue. Check how IN and OUT are assigned, then verify the commands work when the current working directory contains spaces. Run the relevant plugin tests, if available, and add coverage for this path case if the existing tests support it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100