missleading error message 'unauthorized' with python script
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Products.ZSQLMethods |
Invalid
|
Low
|
Unassigned |
Bug Description
With a python script I experienced an error message that was not indicating the correct root cause an it costs considerable time to figure it out.
The message was: Unauthorized: You are not allowed to access 'lower' in this context
that came along with the traceback:
Traceback (innermost last):
Module ZPublisher.Publish, line 101, in publish
Module ZPublisher.mapply, line 88, in mapply
Module ZPublisher.Publish, line 39, in call_object
Module OFS.DTMLMethod, line 130, in __call__
- <DTMLMethod instance at be921ce0>
- URL: http://
- Physical Path: /FGTW/copy_
Module DocumentTemplat
Module DocumentTemplat
Module DocumentTemplat
- __traceback_info__: REQUEST
Module <string>, line 1, in <expression>
Module Shared.
Module Shared.
Module Products.
Module None, line 34, in createID
- <PythonScript at /FGTW/copy_
- Line 34
-------
The python script mainly the following:
script (Python)createID:
...
# Request for a row from the TinyTable 'MAs' where ID account=Autor
theuser = container.
# Read content of the field 'kurz' from the returned row
KZAutor=
...
# the content of 'kurz' was NULL, and therefore KZAutor is not a string
lref=
...
This is a request of a row from a TinyTable that allows also NULL values what means it returns in this case a missing value. 'KZAutor' is then not a string as it would be and the application of the string function lower() on this variable will raise an error.
But it should not raise the error 'unauthorized' as it does. 'unauthorized' always focuses the developer to user management. Maybe this is a problem of the underlaying python.
affects: | zope2 → products.zsqlmethods |
The given information is not enough for me to reproduce the problem.