*************************************************************************** IPython post-mortem report IPython version: 0.8.3 SVN revision : 85 Platform info : os.name -> posix, sys.platform -> linux2 *************************************************************************** Current user configuration structure: {'Version': 0, '__allownew': True, 'alias': [], 'args': [], 'autocall': 1, 'autoedit_syntax': 0, 'autoexec': [], 'autoindent': 0, 'automagic': 1, 'banner': 1, 'c': '', 'cache_size': 1000, 'classic': 0, 'color_info': 0, 'colors': 'NoColor', 'confirm_exit': 1, 'debug': 0, 'deep_reload': 0, 'editor': '0', 'execfile': [], 'execute': [], 'gthread': 0, 'help': 0, 'import_all': [], 'import_mod': [], 'import_some': [[]], 'include': [], 'interact': 0, 'ipythondir': '/afs/sipb.mit.edu/project/freeculture/.ipython', 'log': 0, 'logfile': '', 'logplay': '', 'magic_docstrings': 0, 'messages': 1, 'multi_line_specials': 1, 'nosep': 0, 'object_info_string_level': 0, 'opts': Struct({'__allownew': True}), 'pdb': 0, 'pprint': 0, 'profile': '', 'prompt_in1': 'In [\\#]: ', 'prompt_in2': ' .\\D.: ', 'prompt_out': 'Out[\\#]: ', 'prompts_pad_left': 1, 'pylab': 0, 'pylab_import_all': 1, 'q4thread': 0, 'qthread': 0, 'quick': 0, 'quiet': 0, 'rcfile': 'ipythonrc', 'readline': 1, 'readline_merge_completions': 1, 'readline_omit__names': 0, 'readline_parse_and_bind': [], 'readline_remove_delims': '', 'screen_length': 0, 'separate_in': '\n', 'separate_out': '\n', 'separate_out2': '', 'system_header': 'IPython system call: ', 'system_verbose': 0, 'term_title': 1, 'tk': 0, 'twisted': 0, 'upgrade': 0, 'wildcards_case_sensitive': 1, 'wthread': 0, 'wxversion': '0', 'xmode': 'Context'} *************************************************************************** Crash traceback: --------------------------------------------------------------------------- OSError Python 2.5.1: /usr/bin/python Sun May 17 23:57:09 2009 A problem occured executing Python code. Here is the sequence of function calls leading up to the error, with the most recent (innermost) call last. /usr/bin/ipython in () 12 IPython.Shell.IPShell().mainloop(sys_exit=1) 13 14 [or simply IPython.Shell.IPShell().mainloop(1) ] 15 16 and IPython will be your working environment when you start python. The final 17 sys.exit() call will make python exit transparently when IPython finishes, so 18 you don't have an extra prompt to get out of. 19 20 This is probably useful to developers who manage multiple Python versions and 21 don't want to have correspondingly multiple IPython versions. Note that in 22 this mode, there is no way to pass IPython any command-line options, as those 23 are trapped first by Python itself. 24 """ 25 26 import IPython.Shell ---> 27 IPython.Shell.start().mainloop() global IPython.Shell.start.mainloop = undefined 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 /usr/lib/python2.5/site-packages/IPython/Shell.pyc in start(user_ns=None) 1201 th_mode = special_opts.pop() 1202 except KeyError: 1203 th_mode = 'tkthread' 1204 return th_shell[th_mode] 1205 1206 1207 # This is the one which should be called by external code. 1208 def start(user_ns = None): 1209 """Return a running shell instance, dealing with threading options. 1210 1211 This is a factory function which will instantiate the proper IPython shell 1212 based on the user's threading choice. Such a selector is needed because 1213 different GUI toolkits require different thread handling details.""" 1214 1215 shell = _select_shell(sys.argv) -> 1216 return shell(user_ns = user_ns) 1217 1218 # Some aliases for backwards compatibility 1219 IPythonShell = IPShell 1220 IPythonShellEmbed = IPShellEmbed 1221 #************************ End of file *************************** 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 /usr/lib/python2.5/site-packages/IPython/Shell.pyc in __init__(self=, argv=None, user_ns=None, user_global_ns=None, debug=1, shell_class=) 59 # Tag when runcode() is active, for exception handling 60 CODE_RUN = None 61 62 #----------------------------------------------------------------------------- 63 # This class is trivial now, but I want to have it in to publish a clean 64 # interface. Later when the internals are reorganized, code that uses this 65 # shouldn't have to change. 66 67 class IPShell: 68 """Create an IPython instance.""" 69 70 def __init__(self,argv=None,user_ns=None,user_global_ns=None, 71 debug=1,shell_class=InteractiveShell): 72 self.IP = make_IPython(argv,user_ns=user_ns, 73 user_global_ns=user_global_ns, ---> 74 debug=debug,shell_class=shell_class) global location = undefined global specific = undefined global information. = undefined 75 76 def mainloop(self,sys_exit=0,banner=None): 77 self.IP.mainloop(banner) 78 if sys_exit: 79 sys.exit() 80 81 #----------------------------------------------------------------------------- 82 def kill_embedded(self,parameter_s=''): 83 """%kill_embedded : deactivate for good the current embedded IPython. 84 85 This function (after asking for confirmation) sets an internal flag so that 86 an embedded IPython will never activate again. This is useful to 87 permanently disable a shell that is being called inside a loop: once you've 88 figured out what you needed from it, you may then kill it and the program 89 will then continue to run without the interactive shell interfering again. /usr/lib/python2.5/site-packages/IPython/ipmaker.pyc in make_IPython(argv=['/usr/bin/ipython'], user_ns=None, user_global_ns=None, debug=1, rc_override=None, shell_class=, embedded=False, **kw={}) 514 # tweaks. Basically options which affect other options. I guess this 515 # should just be written so that options are fully orthogonal and we 516 # wouldn't worry about this stuff! 517 518 if IP_rc.classic: 519 IP_rc.quick = 1 520 IP_rc.cache_size = 0 521 IP_rc.pprint = 0 522 IP_rc.prompt_in1 = '>>> ' 523 IP_rc.prompt_in2 = '... ' 524 IP_rc.prompt_out = '' 525 IP_rc.separate_in = IP_rc.separate_out = IP_rc.separate_out2 = '0' 526 IP_rc.colors = 'NoColor' 527 IP_rc.xmode = 'Plain' 528 --> 529 IP.pre_config_initialization() 530 # configure readline 531 # Define the history file for saving commands in between sessions 532 if IP_rc.profile: 533 histfname = 'history-%s' % IP_rc.profile 534 else: 535 histfname = 'history' 536 IP.histfile = os.path.join(opts_all.ipythondir,histfname) 537 538 # update exception handlers with rc file status 539 otrap.trap_out() # I don't want these messages ever. 540 IP.magic_xmode(IP_rc.xmode) 541 otrap.release_out() 542 543 # activate logging if requested and not reloading a log 544 if IP_rc.logplay: /usr/lib/python2.5/site-packages/IPython/iplib.pyc in pre_config_initialization(self=) 628 self.user_ns, # globals 629 # Skip our own frame in searching for locals: 630 sys._getframe(depth+1).f_locals # locals 631 )) 632 633 def pre_config_initialization(self): 634 """Pre-configuration init method 635 636 This is called before the configuration files are processed to 637 prepare the services the config files might need. 638 639 self.rc already has reasonable default values at this point. 640 """ 641 rc = self.rc 642 try: --> 643 self.db = pickleshare.PickleShareDB(rc.ipythondir + "/db") 644 except exceptions.UnicodeDecodeError: 645 print "Your ipythondir can't be decoded to unicode!" 646 print "Please set HOME environment variable to something that" 647 print r"only has ASCII characters, e.g. c:\home" 648 print "Now it is",rc.ipythondir 649 sys.exit() 650 self.shadowhist = IPython.history.ShadowHist(self.db) 651 652 653 def post_config_initialization(self): 654 """Post configuration init method 655 656 This is called after the configuration files have been processed to 657 'finalize' the initialization.""" 658 /usr/lib/python2.5/site-packages/IPython/Extensions/pickleshare.pyc in __init__(self=PickleShareDB('/afs/sipb.mit.edu/project/freeculture/.ipython/db'), root='/afs/sipb.mit.edu/project/freeculture/.ipython/db') 41 import glob 42 43 from sets import Set as set 44 45 def gethashfile(key): 46 return ("%02x" % abs(hash(key) % 256))[-2:] 47 48 _sentinel = object() 49 50 class PickleShareDB(UserDict.DictMixin): 51 """ The main 'connection' object for PickleShare database """ 52 def __init__(self,root): 53 """ Return a db object that will manage the specied directory""" 54 self.root = Path(root).expanduser().abspath() 55 if not self.root.isdir(): ---> 56 self.root.makedirs() 57 # cache has { 'key' : (obj, orig_mod_time) } 58 self.cache = {} 59 60 61 def __getitem__(self,key): 62 """ db['key'] reading """ 63 fil = self.root / key 64 try: 65 mtime = (fil.stat()[stat.ST_MTIME]) 66 except OSError: 67 raise KeyError(key) 68 69 if fil in self.cache and mtime == self.cache[fil][1]: 70 return self.cache[fil][0] 71 try: /usr/lib/python2.5/site-packages/IPython/external/path.pyc in makedirs(self=path('/afs/sipb.mit.edu/project/freeculture/.ipython/db'), mode=511) 878 os.chown(self, uid, gid) 879 880 def rename(self, new): 881 os.rename(self, new) 882 883 def renames(self, new): 884 os.renames(self, new) 885 886 887 # --- Create/delete operations on directories 888 889 def mkdir(self, mode=0777): 890 os.mkdir(self, mode) 891 892 def makedirs(self, mode=0777): --> 893 os.makedirs(self, mode) 894 895 def rmdir(self): 896 os.rmdir(self) 897 898 def removedirs(self): 899 os.removedirs(self) 900 901 902 # --- Modifying operations on files 903 904 def touch(self): 905 """ Set the access/modified times of this file to the current time. 906 Create the file if it does not exist. 907 """ 908 fd = os.open(self, os.O_WRONLY | os.O_CREAT, 0666) /usr/lib64/python2.5/os.pyc in makedirs(name=path('/afs/sipb.mit.edu/project/freeculture/.ipython/db'), mode=511) 150 def makedirs(name, mode=0777): 151 """makedirs(path [, mode=0777]) 152 153 Super-mkdir; create a leaf directory and all intermediate ones. 154 Works like mkdir, except that any intermediate path segment (not 155 just the rightmost) will be created if it does not exist. This is 156 recursive. 157 158 """ 159 from errno import EEXIST 160 head, tail = path.split(name) 161 if not tail: 162 head, tail = path.split(head) 163 if head and tail and not path.exists(head): 164 try: --> 165 makedirs(head, mode) global Execute = undefined global the = undefined global executable = undefined global file = undefined global argument = undefined global list = undefined global args = undefined 166 except OSError, e: 167 # be happy if someone already created the path 168 if e.errno != EEXIST: 169 raise 170 if tail == curdir: # xxx/newdir/. exists if xxx/newdir exists 171 return 172 mkdir(name, mode) 173 174 def removedirs(name): 175 """removedirs(path) 176 177 Super-rmdir; remove a leaf directory and all empty intermediate 178 ones. Works like rmdir except that, if the leaf directory is 179 successfully removed, directories corresponding to rightmost path 180 segments will be pruned away until either the whole path is /usr/lib64/python2.5/os.pyc in makedirs(name='/afs/sipb.mit.edu/project/freeculture/.ipython', mode=511) 157 158 """ 159 from errno import EEXIST 160 head, tail = path.split(name) 161 if not tail: 162 head, tail = path.split(head) 163 if head and tail and not path.exists(head): 164 try: 165 makedirs(head, mode) 166 except OSError, e: 167 # be happy if someone already created the path 168 if e.errno != EEXIST: 169 raise 170 if tail == curdir: # xxx/newdir/. exists if xxx/newdir exists 171 return --> 172 mkdir(name, mode) global Execute = undefined global the = undefined global executable = undefined global file = undefined global which = undefined global searched = undefined global along = undefined global PATH = undefined 173 174 def removedirs(name): 175 """removedirs(path) 176 177 Super-rmdir; remove a leaf directory and all empty intermediate 178 ones. Works like rmdir except that, if the leaf directory is 179 successfully removed, directories corresponding to rightmost path 180 segments will be pruned away until either the whole path is 181 consumed or an error occurs. Errors during this latter phase are 182 ignored -- they generally mean that a directory was not empty. 183 184 """ 185 rmdir(name) 186 head, tail = path.split(name) 187 if not tail: OSError: [Errno 13] Permission denied: '/afs/sipb.mit.edu/project/freeculture/.ipython' *************************************************************************** History of session input: *** Last line of input (may not be in above history):