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

Tom Dossis td at yoma.com.au
Mon Dec 18 16:45:37 EST 2006


George Wright wrote:
> 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 @@" ?

Remove the '-' line, replace it with the '+' line.

> 
> 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 ?

Both if need be - but definitely in your runtime path.

> 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.

cd to your zope INSTANCE_HOME, then you can invoke the python
interpreter with either of:

  ./bin/zopectl debug
or
  ./bin/debugzope

This will add zope (and $INSTANCE_HOME/lib/python) to your python path
and process all the zcml files.  It will also add 'app' to your python
session...

>>> app
<zope.app.debug.debug.Debugger object at 0xb741010c>
>>> app.root()
<zope.app.folder.folder.Folder object at 0xb4fe706c>
>>> list(app.root())
[u'Folder1', u'Folder2']

>>> from zope import schema
>>> dir(schema)
['ASCII', 'ASCIILine', 'Bool', 'Bytes', 'BytesLine', 'Choice',
'Container', 'Date', 'Datetime', 'Dict', 'DottedName', 'Field', 'Float',
'FrozenSet', 'Id', 'Int', 'InterfaceField', 'Iterable', 'List',
'MinMaxLen', 'Object', 'Orderable', 'Password', 'Set', 'SourceText',
'Text', 'TextLine', 'Timedelta', 'Tuple', 'URI', 'ValidationError',
'__builtins__', '__doc__', '__file__', '__name__', '__path__',
'_bootstrapfields', '_bootstrapinterfaces', '_field', '_schema',
'accessors', 'fieldproperty', 'getFieldNames', 'getFieldNamesInOrder',
'getFields', 'getFieldsInOrder', 'interfaces', 'vocabulary']




More information about the Zope3-users mailing list