Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

When I open Terminal I see the following:

Last login: Wed Feb  8 18:30:05 on ttys029
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/logging/handlers.py", line 75, in emit
    self.doRollover()
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/logging/handlers.py", line 132, in doRollover
    os.rename(self.baseFilename, dfn)
OSError: [Errno 2] No such file or directory
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/logging/__init__.py", line 1472, in shutdown
    h.flush()
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/logging/__init__.py", line 740, in flush
    self.stream.flush()
ValueError: I/O operation on closed file
Error in sys.exitfunc:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/logging/__init__.py", line 1472, in shutdown
    h.flush()
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/logging/__init__.py", line 740, in flush
    self.stream.flush()
ValueError: I/O operation on closed file

Everything seems to work but this is ugly and maybe warns of future trouble. I've installed Python 2.7 on this machine, then removed it to a virtualenv to restore 2.6 as the system default.

Any thoughts on how I can debug this?

EDIT:

My .profile has a call to virtualenvwrapper.sh -- which, as I look it, is located under .../Versions/2.7 of Python. So maybe I should look for the problem there?

share|improve this question
    
Maybe I'm missing something here, but why is python loading anything when you start Terminal.app? Do you have something specific in your .bashrc or .profile that executes some python code? –  cm2 Feb 10 '12 at 16:53
    
Yeah, virtualenvwrapper.sh, see my edit. –  chernevik Feb 10 '12 at 18:06
    
Yeah, that's it -- pointing .profile to /Versions/Current/bin/virtualenvwrapper.sh makes the cruft go away. Phrase as an answer and I'll choose it. –  chernevik Feb 10 '12 at 18:11
    
Looks like you answered it yourself. Its ok to accept your own answer. –  cm2 Feb 10 '12 at 21:36
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.