NameError Problem with FileLibrary example.
Hi, I'm a complete Zope newie here, I've scanned the archives and I can't see a useful pointer to help me completely explain/solve my problem, it could be one of those 'so obvious, no one's had to ask before...' things. I've just installed Zope 2.7.0-b1, python 2.3 and CMF 1.3.1. By way of learning and testing the installation I've looked at the 4 examples supplied. The FileLibrary example doesn't work and I get the following in the error log when I try to upload a file (any file, big, small, text, binary etc.): Module ZPublisher.Publish, line 98, in publish * Module ZPublisher.mapply, line 88, in mapply * Module ZPublisher.Publish, line 39, in call_object * Module Shared.DC.Scripts.Bindings, line 252, in __call__ * Module Shared.DC.Scripts.Bindings, line 283, in _bindAndExec * Module Products.PythonScripts.PythonScript, line 320, in _exec * Module Script (Python), line 6, in addFile <PythonScript at /Examples/FileLibrary/addFile used for /Examples/FileLibrary/Files> Line 6 * Module Script (Python), line 6, in LimitExceeded <PythonScript at /Examples/FileLibrary/addFile used for /Examples/FileLibrary/Files> Line 6 NameError: global name '__name__' is not defined I did read some references to problems with imported ZClasses but, at this early stage on the learning curve, that didn't really explain much to me. Can anyone suggest what is happening here? In particular, is this problem a symptom of a SNAFU installation or is it just the example that is SNAFU? If it's the example then I could learn a lot by just knowing how to fix it. OTOH, if the installation is stuffed, perhaps the best option is to start again from scratch. Thanks. -- Mark <sesamoid@ntlworld.com>
Bun Topping wrote:
I've just installed Zope 2.7.0-b1, python 2.3 and CMF 1.3.1.
Hmmm.
* Module Script (Python), line 6, in LimitExceeded <PythonScript at /Examples/FileLibrary/addFile used for /Examples/FileLibrary/Files> Line 6
NameError: global name '__name__' is not defined
Hmmm. That code was tested with python 2.2, but not 2.3, its possible defining new classes in Script objects doesn't fly like it did in 2.2. I get the feeling zope with python 2.3 is still pretty rough around the edges. -- Jamie Heilman http://audible.transient.net/~jamie/ "Most people wouldn't know music if it came up and bit them on the ass." -Frank Zappa
participants (2)
-
Bun Topping -
Jamie Heilman