Commit c328d480 authored by Chris Withers's avatar Chris Withers

Finally! I can edit PythonScripts via FTP and WebDAV with impunity :-)

parent 3e87ee7b
......@@ -4,6 +4,13 @@ Zope Changes
Change information for previous versions of Zope can be found in the
file HISTORY.txt.
after Zope 2.5.1
- Fixed long standing bug in PythonScript where get_size returned
the incorrect length. This broke editing using EMACS via FTP or
WebDAV. Thanks to John Glavin at South River Technologies for
help finding the bug.
Zope 2.5.1 beta 1
Bugs Fixed
......
......@@ -17,7 +17,7 @@ This product provides support for Script objects containing restricted
Python code.
"""
__version__='$Revision: 1.39 $'[11:-2]
__version__='$Revision: 1.40 $'[11:-2]
import sys, os, traceback, re, marshal
from Globals import DTMLFile, MessageDialog, package_home
......@@ -453,7 +453,7 @@ class PythonScript(Script, Historical, Cacheable):
def params(self): return self._params
def body(self): return self._body
def get_size(self): return len(self._body)
def get_size(self): return len(self.read())
getSize = get_size
def PrincipiaSearchSource(self):
......
......@@ -153,6 +153,10 @@ class TestPythonScriptNoAq(unittest.TestCase):
true = self._newPS(readf('boolean_map'))()
assert true
def testGetSize(self):
f = self._newPS(readf('complex_print'))
self.assertEqual(f.get_size(),len(f.read()))
def test_suite():
suite = unittest.TestSuite()
suite.addTest( unittest.makeSuite( TestPythonScriptNoAq ) )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment