When using --target, exceptions can leave a temp directory behind
See original GitHub issueRight, the problem with target_temp_dir
is that it’s created conditionally - so sometimes it’s a context manager, and other times it’s None
. So we can’t “just” enter it earlier, as you can’t do with None
.
When we drop Python 2, we could fix this with contextlib.ExitStack
. This isn’t worth vendoring the contextlib
backport just for Python 2, though. We could also write our own MaybeContextManager
class that wraps an optional context manager, but again that’s a lot of work.
I’m going to make the call that this should be handled in a follow-up PR, and for now just allow left-over temp directories in the test.
_Originally posted by @pfmoore in https://github.com/pypa/pip/pull/8462#issuecomment-649349135_
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Working and unit testing with temporary files in Java
Because JUnit's rule deletes the temporary directory after each test method is run, you know that you're always starting with a fresh temporary...
Read more >Supply Chain Labor & Human Rights Policies - Target Corporate
We do not allow exceptions, including those for temporary, migrant and contract workers. During the responsible sourcing audit, personnel records are reviewed ...
Read more >"Exception has been thrown by the target of an invocation ...
I have a desktop app that loads assembly code via reflection then calls it via MethodInfo.Invoke(), it doesn't log exceptions to file, and...
Read more >Snakefiles and Rules — Snakemake 7.19.1 documentation
Inside the shell command, all local and global variables, especially input and output files can be accessed via their names in the python...
Read more >Configuration options for the dependabot.yml file - GitHub Docs
Detailed information for all the options you can use to customize how ... you use target-branch ), and specify a package-ecosystem and directory...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I thought it rang a bell 😄
Too many issues in the tracker, not enough cells in my brain…
Gosh, I knew I’ve seen that
CommandContextMixIn
implementation before. I thought I was hallucinating or something.