diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2010-06-04 19:46:21 +0000 |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2010-06-04 19:46:21 +0000 |
commit | c5010e0669cc54278b1887625574eb89cf7f8672 (patch) | |
tree | cd550877ecd6d2c066ad6974baaa0f35d9618402 | |
parent | 3bde59c7b081f8d7d3d3b0f7ed3491a8b21fe8eb (diff) | |
download | cpython-git-c5010e0669cc54278b1887625574eb89cf7f8672.tar.gz |
Merged revisions 81701 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r81701 | martin.v.loewis | 2010-06-04 21:39:07 +0200 (Fr, 04 Jun 2010) | 2 lines
Issue #6470: Drop UNC prefix in FixTk.py
Patch by Christop Gohlke and Amaury Forgeot d'Arc.
........
-rw-r--r-- | Lib/lib-tk/FixTk.py | 2 | ||||
-rw-r--r-- | Lib/test/test_tcl.py | 25 | ||||
-rw-r--r-- | Misc/NEWS | 2 |
3 files changed, 29 insertions, 0 deletions
diff --git a/Lib/lib-tk/FixTk.py b/Lib/lib-tk/FixTk.py index f9eaa8e800..375c34c2e5 100644 --- a/Lib/lib-tk/FixTk.py +++ b/Lib/lib-tk/FixTk.py @@ -42,6 +42,8 @@ else: # Ignore leading \\?\ if s.startswith("\\\\?\\"): s = s[4:] + if s.startswith("UNC"): + s = "\\" + s[3:] return s prefix = os.path.join(sys.prefix,"tcl") diff --git a/Lib/test/test_tcl.py b/Lib/test/test_tcl.py index fa170ef58d..6a87ce203f 100644 --- a/Lib/test/test_tcl.py +++ b/Lib/test/test_tcl.py @@ -150,6 +150,31 @@ class TclTest(unittest.TestCase): if old_display is not None: os.environ['DISPLAY'] = old_display + def testLoadWithUNC(self): + import sys + if sys.platform != 'win32': + return + + # Build a UNC path from the regular path. + # Something like + # \\%COMPUTERNAME%\c$\python27\python.exe + + fullname = os.path.abspath(sys.executable) + if fullname[1] != ':': + return + unc_name = r'\\%s\%s$\%s' % (os.environ['COMPUTERNAME'], + fullname[0], + fullname[3:]) + + with test_support.EnvironmentVarGuard() as env: + env.unset("TCL_LIBRARY") + f = os.popen('%s -c "import Tkinter; print Tkinter"' % (unc_name,)) + + self.assert_('Tkinter.py' in f.read()) + # exit code must be zero + self.assertEqual(f.close(), None) + + def test_main(): test_support.run_unittest(TclTest) @@ -58,6 +58,8 @@ C-API Library ------- +- Issue #6470: Drop UNC prefix in FixTk. + - Issue #8833: tarfile created hard link entries with a size field != 0 by mistake. |