-
Notifications
You must be signed in to change notification settings - Fork 3k
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
I/O operation on closed file exception with --log #219
Comments
Still occurs on develop, we explicitly close log_fd before the exit block, removing the log statement there prevents the traceback, which I may propose for now and then look at improving logging in general later (eg there are no timestamps, etc). |
Possibly the fix proposed in Issue #114 would fix this. |
Was having the same issue today while pip installing on a RHEL machine where the user didn't have a writable home directory. Even while passing --log and --log-file arguments, it still tried to write out to the ~/.pip/log file. Note that this failure only occurred while installing requirements which compiled c-extensions. The --log argument did capture the regular pip log. |
I'm also seeing this error in my installs and it's really annoying! @hltbra did you send a pull request to the pip project for this? |
I can confirm that this is still happening with pip 1.4.1. We see it frequently while testing pip over TUF. Without logging: $ pip install RandomNonExtantPackage
Downloading/unpacking RandomNonExtantPackage
Could not find any downloads that satisfy the requirement RandomNonExtantPackage
Cleaning up...
No distributions at all found for RandomNonExtantPackage
Storing complete log in /home/trishank/.pip/pip.log With logging: $ pip install RandomNonExtantPackage --log iamalog.txt
Downloading/unpacking RandomNonExtantPackage
Could not find any downloads that satisfy the requirement RandomNonExtantPackage
Cleaning up...
No distributions at all found for RandomNonExtantPackage
Storing complete log in /home/trishank/.pip/pip.log
Traceback (most recent call last):
File "/home/trishank/stress-test.updateframework.com/test/bin/pip", line 9, in <module>
load_entry_point('pip==1.4.1', 'console_scripts', 'pip')()
File "/home/trishank/stress-test.updateframework.com/test/local/lib/python2.7/site-packages/pip/__init__.py", line 148, in main
return command.main(args[1:], options)
File "/home/trishank/stress-test.updateframework.com/test/local/lib/python2.7/site-packages/pip/basecommand.py", line 176, in main
logger.fatal('Storing complete log in %s' % log_fn)
File "/home/trishank/stress-test.updateframework.com/test/local/lib/python2.7/site-packages/pip/log.py", line 48, in fatal
self.log(self.FATAL, msg, *args, **kw)
File "/home/trishank/stress-test.updateframework.com/test/local/lib/python2.7/site-packages/pip/log.py", line 75, in log
backwardcompat.fwrite(consumer, rendered)
File "/home/trishank/stress-test.updateframework.com/test/local/lib/python2.7/site-packages/pip/backwardcompat/__init__.py", line 90, in fwrite
f.write(s)
ValueError: I/O operation on closed file |
--log file object getting closed prematurely (Issue #219)
fixed in PR #1205 |
When using the --log option, a "ValueError: I/O operation on closed file exception" is raised when an error occurs.
The text was updated successfully, but these errors were encountered: