Skip to content

Improve error message for IOErrors #81

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

Closed
wants to merge 1 commit into from

Conversation

kerel-fs
Copy link
Contributor

@kerel-fs kerel-fs commented Nov 4, 2023

Fixes #80.

If there is no space left in /tmp, the following output will be created now:

❯ ssh server.local
Last login: Sat Nov  4 13:54:02 2023 from 192.168.0.66
virtualenvwrapper.hook_loader Error while writing to /tmp/virtualenvwrapper-initialize-hook-VarTa4Ehmh: 
 [Errno 28] No space left on device
virtualenvwrapper.sh: There was a problem running the initialization hooks.

If Python could not import the module virtualenvwrapper.hook_loader,
check that virtualenvwrapper has been installed for
VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3 and that PATH is
set properly.
pi@server:~ $ 

In this scenario of a full tmp disk, the scond section of this error message is superfluous. It could be suppressed by
using a special exit code (e.g. exit code 2) to signal to the caller virtualenvwrapper.sh that initialization failed due to a full disk.

I do not know the error codes used by the hook_script or if there are any besides the non-zero=error),
thus I didn't feel confident about this idea. Let me know what you think about this!

Copy link
Contributor

@dhellmann dhellmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That does look much nicer, thank you!

@dhellmann dhellmann marked this pull request as draft December 21, 2023 15:26
@dhellmann dhellmann marked this pull request as ready for review December 21, 2023 15:26
@dhellmann
Copy link
Contributor

It looks like PRs in early November were not tested for some reason (#79 ) had the same problem.

@dhellmann
Copy link
Contributor

It looks like PRs in early November were not tested for some reason (#79 ) had the same problem.

I've created #87 by rebasing this PR and submitting a new one. The tests are running there, and if they pass the PR should merge automatically. You will still receive credit in the release notes for your contribution.

Thank you!

@dhellmann dhellmann closed this Dec 21, 2023
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

Successfully merging this pull request may close these issues.

Traceback on initialization if disk is full
2 participants