[Zope3-Users] readline() takes exactly 1 argument

George Wright georgewr at bigpond.net.au
Mon Dec 18 16:26:36 EST 2006


Trying to get started on Zope3 but frustrated by a couple of barriers:

Barrier 1.
  Added a folder. Added a ZPT Page (As in Zope3 Developer's Book page  
12).
Then get system error message:
Traceback (most recent call last):
   Module zope.publisher.publish, line 126, in publish
     request.processInputs()
   Module zope.publisher.browser, line 263, in processInputs
     fs = FieldStorage(fp=fp, environ=self._environ,  
keep_blank_values=1)
   Module cgi, line 530, in __init__
     self.read_multi(environ, keep_blank_values, strict_parsing)
   Module cgi, line 650, in read_multi
     environ, keep_blank_values, strict_parsing)
   Module cgi, line 532, in __init__
     self.read_single()
   Module cgi, line 665, in read_single
     self.read_lines()
   Module cgi, line 687, in read_lines
     self.read_lines_to_outerboundary()
   Module cgi, line 715, in read_lines_to_outerboundary
     line = self.fp.readline(1<<16)
TypeError: readline() takes exactly 1 argument (2 given)

I did a search of archives and found references to a patch of http.py  
and tales of success in solving the same problem:

Yes. Apply this patch to the zope3-sources:

/http.py
--- src/zope/publisher/http.py.old 2006-10-04 15:11:04.000000000 +0200
+++ src/zope/publisher/http.py  2006-10-04 15:11:04.000000000 +0200
@@ -205,7 +205,7 @@
          return data

      def readline(self,size=None):
-        data = self.stream.readline(size)
+        data = self.stream.readline()
          self.cacheStream.write(data)
          return data

BUT I'm not sure what to do with it!  What do the little - and + in  
front of the "data = " lines mean?  And the "@@ -205,7 +205,7 @@" ?

Just which http.py is to be patched?
~/Zope-3.3.0/build/lib.macosx-10.3-fat-2.4/zope/publisher/http.py
OR
~/Zope-3.3.0/build/lib.darwin-8.8.0-Power_Macintosh-2.4/zope/ 
publisher/http.py
OR ?

Maybe this problem has been fixed in a later version?

Barrier 2:
Should I be able to call zope from within terminal?
I can get interface ( probably because it is part of my twisted  
installation which is OK)
But I can't get other zope stuff.

george-g5:~ georgewright$ python
Python 2.4.4 (#1, Oct 18 2006, 10:34:39)
[GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
 >>> from zope import interface
 >>> from zope import schema
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
ImportError: cannot import name schema
 >>> from zope import component
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
ImportError: cannot import name component
 >>>

Seems like there is a $PATH problem or $PYTHONPATH?

Lots of other questions of course but maybe I will answer them for  
myself if I can get over these barriers!

Thanks

George Wright
http://users.bigpond.net.au/George.Wright/
http://www.labyrinth.net.au/~gwright



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope3-users/attachments/20061219/27a19cd8/attachment.htm


More information about the Zope3-users mailing list