Kyler B. Laird writes:
I've been using Python 2.0 with Zope 2.3.0. It generally works well, but lately I've run into problems using string.split() and now I notice that httplib encounters a similar ("loop over non-sequence") problem.
I suggest, we flesh out these problems. Tracebacks are a must for this task. Dieter
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Dieter Maurer Sent: Saturday, February 10, 2001 8:41 AM To: Kyler B. Laird Cc: zope@zope.org Subject: Re: [Zope] Should I switch to Python 1.5.2?
I've been using Python 2.0 with Zope 2.3.0. It generally works well, but lately I've run into problems using string.split() and now I notice that httplib encounters a similar ("loop over non-sequence") problem. I suggest, we flesh out these problems.
Tracebacks are a must for this task.
With the following Python Script: import string foo = string.split('this is a test', ' ') -------- The traceback follows. Further probing shows that 'fromlist' in __careful_import__() is a _ReadGuard object when this error occurs (instead of None, as I believe is expected). That's about as far as I can go with it, though. Traceback (innermost last): File /usr/local/zope-2.3.0/lib/python/ZPublisher/Publish.py, line 222, in publish_module File /usr/local/zope-2.3.0/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/local/zope-2.3.0/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: LockableItem) File /usr/local/zope-2.3.0/lib/python/ZPublisher/Publish.py, line 171, in publish File /usr/local/zope-2.3.0/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: importTest) File /usr/local/zope-2.3.0/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: importTest) File /usr/local/zope-2.3.0/lib/python/Shared/DC/Scripts/Bindings.py, line 324, in __call__ (Object: importTest) File /usr/local/zope-2.3.0/lib/python/Shared/DC/Scripts/Bindings.py, line 353, in _bindAndExec (Object: importTest) File /usr/local/zope-2.3.0/lib/python/Products/PythonScripts/PythonScript.py, line 337, in _exec (Object: importTest) (Info: ({'script': <PythonScript instance at 8e25398>, 'context': <Folder instance at 8cf1e28>, 'container': <Folder instance at 8cf1e28>, 'traverse_subpath': []}, (), {}, None)) File Script (Python), line 2, in importTest File /usr/local/zope-2.3.0/lib/python/Products/PythonScripts/Guarded.py, line 219, in __careful_import__ TypeError: (see above) --------- I also determined that the following Python Script works fine: import string foo = [] + string.split('this is a test', ' ') _______________________ Ron Bickers Logic Etc, Inc. rbickers@logicetc.com
On Sat, 10 Feb 2001 14:40:55 +0100 (CET) you wrote:
Kyler B. Laird writes:
I've been using Python 2.0 with Zope 2.3.0. It generally works well, but lately I've run into problems using string.split() and now I notice that httplib encounters a similar ("loop over non-sequence") problem.
I suggest, we flesh out these problems.
Tracebacks are a must for this task.
Sorry; looking back over the archives, I see that my original post about this might not have made it to the public. Hmmmm... For the Script (Python) import string foo = string.split('This is a test...', ' ') return foo I get Error Type: TypeError Error Value: loop over non-sequence Traceback (innermost last): File /var/www/Zope/Zope-2.3.0-src/lib/python/ZPublisher/Publish.py, line 222, in publish_module File /var/www/Zope/Zope-2.3.0-src/lib/python/ZPublisher/Publish.py, line 187, in publish File /var/www/Zope/Zope-2.3.0-src/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: Traversable) File /var/www/Zope/Zope-2.3.0-src/lib/python/ZPublisher/Publish.py, line 171, in publish File /var/www/Zope/Zope-2.3.0-src/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: split) File /var/www/Zope/Zope-2.3.0-src/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: split) File /var/www/Zope/Zope-2.3.0-src/lib/python/Shared/DC/Scripts/Bindings.py, line 324, in __call__ (Object: split) File /var/www/Zope/Zope-2.3.0-src/lib/python/Shared/DC/Scripts/Bindings.py, line 353, in _bindAndExec (Object: split) File /var/www/Zope/Zope-2.3.0-src/lib/python/Products/PythonScripts/PythonScript.py, line 330, in _exec (Object: split) (Info: ({'script': <PythonScript instance at d4a7f0>, 'context': <Folder instance at cc3d90>, 'container': <Folder instance at cc3d90>, 'traverse_subpath': []}, (), {}, None)) File Script (Python), line 2, in split File /var/www/Zope/Zope-2.3.0-src/lib/python/Products/PythonScripts/Guarded.py, line 220, in __careful_import__ TypeError: (see above) Changing to foo = [] + string.split('This is a test...', ' ') eliminates the error, but I don't know what to do about import httplib h = httplib.HTTP('yyy.zope.org') Traceback (innermost last): File /var/www/Zope/Zope-2.3.0-src/lib/python/ZPublisher/Publish.py, line 222, in publish_module File /var/www/Zope/Zope-2.3.0-src/lib/python/ZPublisher/Publish.py, line 187, in publish File /var/www/Zope/Zope-2.3.0-src/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: Traversable) File /var/www/Zope/Zope-2.3.0-src/lib/python/ZPublisher/Publish.py, line 171, in publish File /var/www/Zope/Zope-2.3.0-src/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: index_html) File /var/www/Zope/Zope-2.3.0-src/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: index_html) File /var/www/Zope/Zope-2.3.0-src/lib/python/Shared/DC/Scripts/Bindings.py, line 324, in __call__ (Object: index_html) File /var/www/Zope/Zope-2.3.0-src/lib/python/Shared/DC/Scripts/Bindings.py, line 353, in _bindAndExec (Object: index_html) File /var/www/Zope/Zope-2.3.0-src/lib/python/Products/PythonScripts/PythonScript.py, line 330, in _exec (Object: index_html) (Info: ({'script': <PythonScript instance at d5e030>, 'context': <Folder instance at cc42e0>, 'container': <Folder instance at cc42e0>, 'traverse_subpath': []}, (), {}, None)) File Script (Python), line 2, in index_html File /var/www/Zope/Zope-2.3.0-src/lib/python/Products/PythonScripts/Guarded.py, line 220, in __careful_import__ TypeError: (see above) Thanks. --kyler
participants (3)
-
Dieter Maurer -
Kyler B. Laird -
Ron Bickers