@@ -2673,7 +2673,7 @@ def magic_rehashx(self, parameter_s = ''):
26732673 winext += '|py'
26742674 execre = re .compile (r'(.*)\.(%s)$' % winext ,re .IGNORECASE )
26752675 isexec = lambda fname :os .path .isfile (fname ) and execre .match (fname )
2676- savedir = os .getcwd ()
2676+ savedir = os .getcwdu ()
26772677
26782678 # Now walk the paths looking for executables to alias.
26792679 try :
@@ -2726,7 +2726,7 @@ def magic_pwd(self, parameter_s = ''):
27262726 In [9]: pwd
27272727 Out[9]: '/home/tsuser/sprint/ipython'
27282728 """
2729- return os .getcwd ()
2729+ return os .getcwdu ()
27302730
27312731 @skip_doctest
27322732 def magic_cd (self , parameter_s = '' ):
@@ -2772,7 +2772,7 @@ def magic_cd(self, parameter_s=''):
27722772 parameter_s = parameter_s .strip ()
27732773 #bkms = self.shell.persist.get("bookmarks",{})
27742774
2775- oldcwd = os .getcwd ()
2775+ oldcwd = os .getcwdu ()
27762776 numcd = re .match (r'(-)(\d+)$' ,parameter_s )
27772777 # jump in directory history by number
27782778 if numcd :
@@ -2846,7 +2846,7 @@ def magic_cd(self, parameter_s=''):
28462846 except OSError :
28472847 print sys .exc_info ()[1 ]
28482848 else :
2849- cwd = os .getcwd ()
2849+ cwd = os .getcwdu ()
28502850 dhist = self .shell .user_ns ['_dh' ]
28512851 if oldcwd != cwd :
28522852 dhist .append (cwd )
@@ -2856,7 +2856,7 @@ def magic_cd(self, parameter_s=''):
28562856 os .chdir (self .shell .home_dir )
28572857 if hasattr (self .shell , 'term_title' ) and self .shell .term_title :
28582858 set_term_title ('IPython: ' + '~' )
2859- cwd = os .getcwd ()
2859+ cwd = os .getcwdu ()
28602860 dhist = self .shell .user_ns ['_dh' ]
28612861
28622862 if oldcwd != cwd :
@@ -2880,7 +2880,7 @@ def magic_pushd(self, parameter_s=''):
28802880
28812881 dir_s = self .shell .dir_stack
28822882 tgt = os .path .expanduser (parameter_s )
2883- cwd = os .getcwd ().replace (self .home_dir ,'~' )
2883+ cwd = os .getcwdu ().replace (self .home_dir ,'~' )
28842884 if tgt :
28852885 self .magic_cd (parameter_s )
28862886 dir_s .insert (0 ,cwd )
@@ -3145,7 +3145,7 @@ def magic_bookmark(self, parameter_s=''):
31453145 if not args :
31463146 raise UsageError ("%bookmark: You must specify the bookmark name" )
31473147 elif len (args )== 1 :
3148- bkms [args [0 ]] = os .getcwd ()
3148+ bkms [args [0 ]] = os .getcwdu ()
31493149 elif len (args )== 2 :
31503150 bkms [args [0 ]] = args [1 ]
31513151 self .db ['bookmarks' ] = bkms
0 commit comments