missleading error message 'unauthorized' with python script

Bug #143424 reported by Hans-Juergen Sell on 2005-06-08
2
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://lab-tech.ge.ad.fanp.net:8080/FGTW/copy_of_Briefe/addLetter/manage_main
   - Physical Path: /FGTW/copy_of_Briefe/addLetter
  Module DocumentTemplate.DT_String, line 474, in __call__
  Module DocumentTemplate.DT_Let, line 75, in render
  Module DocumentTemplate.DT_Util, line 198, in eval
   - __traceback_info__: REQUEST
  Module <string>, line 1, in <expression>
Module Shared.DC.Scripts.Bindings, line 306, in __call__
  Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec
  Module Products.PythonScripts.PythonScript, line 323, in _exec
  Module None, line 34, in createID
   - <PythonScript at /FGTW/copy_of_Briefe/createID>
- 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.MAs(account=Autor)
# Read content of the field 'kurz' from the returned row
  KZAutor=theuser[0].kurz
...
# the content of 'kurz' was NULL, and therefore KZAutor is not a string
  lref=KZAutor.lower().capitalize()
...

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
Hanno Schlichting (hannosch) wrote :

The given information is not enough for me to reproduce the problem.

Changed in products.zsqlmethods:
status: New → Incomplete
Colin Watson (cjwatson) wrote :

The products.zsqlmethods project on Launchpad has been archived at the request of the Zope developers (see https://answers.launchpad.net/launchpad/+question/683589 and https://answers.launchpad.net/launchpad/+question/685285). If this bug is still relevant, please refile it at https://github.com/zopefoundation/products.zsqlmethods.

Changed in products.zsqlmethods:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers