[Zope-Checkins] CVS: Zope/lib/python/OFS/tests - testProductInit.py:1.3

Tim Peters tim.one at comcast.net
Fri Feb 20 23:42:43 EST 2004


Update of /cvs-repository/Zope/lib/python/OFS/tests
In directory cvs.zope.org:/tmp/cvs-serv18389/lib/python/OFS/tests

Modified Files:
	testProductInit.py 
Log Message:
test_install_product:  Couldn't pass on Windows.  Repaired.


=== Zope/lib/python/OFS/tests/testProductInit.py 1.2 => 1.3 ===
--- Zope/lib/python/OFS/tests/testProductInit.py:1.2	Sun Jan 11 10:32:45 2004
+++ Zope/lib/python/OFS/tests/testProductInit.py	Fri Feb 20 23:42:42 2004
@@ -38,9 +38,13 @@
 </zodb_db>
 """
 
+# CAUTION:  A raw string must be used in the open() call.  This is crucial
+# so that if you happen to be on Windows, and are passed a path containing
+# backslashes, the backslashes get treated *as* backslashes instead of as
+# string escape codes.
 dummy_product_init = """
 def initialize(context):
-    f=open('%s', 'w')
+    f=open(r'%s', 'w')
     f.write('didit')
     f.close()
 misc_ = {'a':1}
@@ -124,7 +128,7 @@
         for name in FAKEPRODUCTS:
             self.assert_(name in names)
         self.assert_('gleeb' not in names)
-        
+
     def test_file_on_products_path_is_not_product(self):
         self.makeFakeProducts()
         f = open(os.path.join(TEMPPRODUCTS, 'README.txt'), 'w')




More information about the Zope-Checkins mailing list