From 7e5406215aebaa2ed253ecf45fa21b885b93e406 2019-02-08 17:09:19 From: Partha P. Mukherjee Date: 2019-02-08 17:09:19 Subject: [PATCH] Fix# 11559 weird regexp in magic writefile --- diff --git a/IPython/core/magics/osm.py b/IPython/core/magics/osm.py index b6214c0..a309280 100644 --- a/IPython/core/magics/osm.py +++ b/IPython/core/magics/osm.py @@ -825,7 +825,7 @@ class OSMagics(Magics): The file will be overwritten unless the -a (--append) flag is specified. """ args = magic_arguments.parse_argstring(self.writefile, line) - if re.match(r'[\'*\']|["*"]', args.filename): + if re.match(r'^(\'.*\')|(".*")$', args.filename): filename = os.path.expanduser(args.filename[1:-1]) else: filename = os.path.expanduser(args.filename)