Currently in genutils.py at line 942 in ipython 0.10 ipython gives up trying to find the home directory which causes ipython to final to load.
At this point ipython could still try a little harder to find a home directory with something like the following:
p = subprocess.Popen('echo $HOME',shell=True,stdout=subprocess.PIPE)
potential_home = p.communicate().strip()
if len(potential_home) > 0:
raise HomeDirError,'undefined $HOME, IPython can not proceed.'
I'm not too sure if this is a Slicer 3 ( http://www.slicer.org/ ) issue or a ipython issue so I'm creating a ticket in each project. The slicer ticket: http://na-mic.org/Mantis/view.php?id=985
This issue occurred on OS X 10.6.4, Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29), Slicer 3.6.1 rev 15021
Unfortunately the code you propose is posix-specific, and won't work on Windows. IPython is cross platform, so we need a platform-independent solution.
If you find one, by all means post it, the easiest way to have it merged is to make it as a pull request on github, but a patch on our -dev list or even here will be equally welcome.
Yes, you are correct my proposal is posix-specific. That's why it's within the block which checks if the OS is posix. Here is a patch:
--- genutils.py 2009-08-04 19:26:20.000000000 -0400
+++ genutils.py 2010-09-23 16:34:45.000000000 -0400
@@ -940,7 +940,13 @@
if os.name == 'posix':
- raise HomeDirError,'undefined $HOME, IPython can not proceed.'
+ import subprocess
+ p = subprocess.Popen('echo $HOME',shell=True,stdout=subprocess.PIPE)
+ potential_home = p.communicate().strip()
+ if len(potential_home) > 0:
+ return potential_home
+ raise HomeDirError,'undefined $HOME, IPython can not proceed.'
elif os.name == 'nt':
# For some strange reason, win9x returns 'nt' for os.name.
Make last-ditch attempt to find $HOME when environment is broken.
Closed by 5a7eee9, thanks to gh user dmirota for report and patch.
Closes gh-154, thanks to gh user dmirota for report and patch.
moving mpd client listener pattern out of eventemitter and into an ar…
…ray. closes #154.