[issue8869] execfile does not work with UNC paths
Changes by Tim Golden m...@timgolden.me.uk: -- resolution: - out of date status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8869 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8869] execfile does not work with UNC paths
New submission from stier08 stie...@gmail.com: execfile() builtin function does not work with UNC paths on Windows platform (Windows 7 x64 has been tested, python 2.6.5) Since standard IO operations successfully process UNC paths, therefore this behavior of execfile() seems to be a bug. Code to reproduce (assuming drive c: is present and you have rw permissions) a=u'?\\c:\\a.py' open(a,w).write(print 'hellow') # successful write to UNC file file(a).read() # successful read from UNC file print 'hellow' execfile(a) # ERROR Traceback (most recent call last): File stdin, line 1, in module IOError: [Errno 2] No such file or directory: '?\\c:\\a.py' See description of UNC naming convention at msdn http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx at wikipedia http://en.wikipedia.org/wiki/Path_(computing)#Uniform_Naming_Convention -- components: Unicode, Windows messages: 106841 nosy: stier08 priority: normal severity: normal status: open title: execfile does not work with UNC paths type: behavior versions: Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8869 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8869] execfile does not work with UNC paths
Tim Golden m...@timgolden.me.uk added the comment: Since execfile is basically shorthand for exec (open (filename).read ()), and since open (filename) *does* support the full range of filepath syntax on Windows, and since execfile has been removed in py3k in favour of exec (open ...)), and since Python 2.x is nearing its end-of-life, I doubt this issue will garner much sympathy. I haven't actually looked at the code to discover just *why* execfile doesn't support that style of filename. But is there any reason you can't use exec (open (...))? -- nosy: +tim.golden ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8869 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8869] execfile does not work with UNC paths
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Reproduced on WinXP. execfile() does not work because it calls the system function stat(); this function does accept UNC paths (like \\machine\share\file), but not paths which contain a wildcard character ('?' or '*') I suggest to remove the leading '?\\'. -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8869 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8869] execfile does not work with UNC paths
stier08 stie...@gmail.com added the comment: yep exec (open (...)) is OK here thanks -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8869 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com