simulate shell expansion on %run arguments, at least tilde expansion #591

Closed
wants to merge 1 commit into
from
View
@@ -1595,7 +1595,11 @@ def magic_run(self, parameter_s ='',runner=None,
# Make sure that the running script gets a proper sys.argv as if it
# were run from a system shell.
save_argv = sys.argv # save it for later restoring
- sys.argv = [filename]+ arg_lst[1:] # put in the proper filename
+
+ # simulate shell expansion on arguments, at least tilde expansion
+ args = map(os.path.expanduser, arg_lst[1:])
+
+ sys.argv = [filename]+ args # put in the proper filename
if opts.has_key('i'):
# Run in user's interactive namespace