[Zodb-checkins] CVS: Zope3/src/zope/testing - doctestunit.py:1.3

Tim Peters tim.one at comcast.net
Sun Jun 29 02:07:51 EDT 2003


Update of /cvs-repository/Zope3/src/zope/testing
In directory cvs.zope.org:/tmp/cvs-serv4010/src/zope/testing

Modified Files:
	doctestunit.py 
Log Message:
Repair the way execfile() gets invoked (it usually failed on Windows, for
reasons explained in a new comment).


=== Zope3/src/zope/testing/doctestunit.py 1.2 => 1.3 ===
--- Zope3/src/zope/testing/doctestunit.py:1.2	Sun May 18 14:27:01 2003
+++ Zope3/src/zope/testing/doctestunit.py	Sun Jun 29 01:07:50 2003
@@ -205,6 +205,8 @@
     globs = {}
     globs.update(module.__dict__)
     try:
-        pdb.run("execfile('%s')" % srcfilename, globs, globs)
+        # Note that %r is vital here.  '%s' instead can, e.g., cause
+        # backslashes to get treated as metacharacters on Windows.
+        pdb.run("execfile(%r)" % srcfilename, globs, globs)
     finally:
         os.remove(srcfilename)




More information about the Zodb-checkins mailing list