2

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?

  • 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
1

From comment:

Check your .bashrc or .profile for Python specific code -- if you find something there make sure it is pointing to the correct version, be it .../Versions/Current/..., .../Versions/2.7/..., or whatever.

  • The issue is correct but the solution is not necessarily - your current python might not be the one you want if you have multiple pythons – Mark Jul 22 '14 at 15:23
  • @Mark: How's this? – Ethan Furman Jul 22 '14 at 17:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .