2.4.0 and pythonmethod
I have a problem upgrading. Because of dependencies in a costom made (for the company i work for) product I have to use the old PythonMethod-0.1.7 - product. When I start the service I get the following to my console: <screendump> [zoperunner@yb Zope-2.4.0-linux2-x86]$ ./start & [1] 7361 [zoperunner@yb Zope-2.4.0-linux2-x86]$ /opt/Zope-2.4.0-linux2-x86/lib/python/Pro ducts/PythonMethod/zbytecodehacks/closure.py:121: SyntaxWarning: local name 'n' in 'make_adder' shadows use of 'n' as global in nested scope 'adder' def make_adder(n): ------ 2001-07-24T10:11:33 PROBLEM(100) Init Ambiguous name for method of Products.Pyth onMethod.PythonMethod.PythonMethod: "manage" != "manage_main" [zoperunner@yb Zope-2.4.0-linux2-x86]$ ------ 2001-07-24T10:11:37 INFO(0) ZServer HTTP server started at Tue Jul 24 12:11:37 2 001 Hostname: yb.magnus.dk Port: 8080 ------ 2001-07-24T10:11:37 INFO(0) ZServer FTP server started at Tue Jul 24 12:11:37 20 01 Hostname: yb.magnus.dk Port: 8021 ------ 2001-07-24T10:11:37 INFO(0) ZServer PCGI Server started at Tue Jul 24 12:11:37 2 001 Unix socket: /opt/Zope-2.4.0-linux2-x86/var/pcgi.soc </screendump> The question is: How do I make certain that this problem does not occur? All my stuff seems to work, but I would be a more happy man if there were no errors like that when I start the service.
Eivind Bengtsson wrote:
[zoperunner@yb Zope-2.4.0-linux2-x86]$ ./start & [1] 7361 [zoperunner@yb Zope-2.4.0-linux2-x86]$ /opt/Zope-2.4.0-linux2-x86/lib/python/Pro ducts/PythonMethod/zbytecodehacks/closure.py:121: SyntaxWarning: local name 'n' in 'make_adder' shadows use of 'n' as global in nested scope 'adder' def make_adder(n):
This is warning you that an unused function located in the PythonMethod product will have problems with Python 2.2. Since it's unused, there's nothing to worry about. You might be able to just delete the function. :-)
------ 2001-07-24T10:11:33 PROBLEM(100) Init Ambiguous name for method of Products.Pyth onMethod.PythonMethod.PythonMethod: "manage" != "manage_main"
The PythonMethod product, like many other products, tries to make the management screens available to users depending on their permissions. Unfortunately there was a problem with the way the management screens were being set up and consequently in some cases only managers can access the screens. It's a case of overzealous security. There's a way to fix it but unless you're going to let non-managers create Python Methods, it's nothing to worry about. The rest of the messages were normal log messages. You may want to read up on the options you can pass to z2.py so that the log messages are sent to a file instead of the console. (Of course, in development mode it's better that they go to the console.) Shane
At 00:49 25/07/2001 -0400, Shane Hathaway wrote: snip ...
------ 2001-07-24T10:11:33 PROBLEM(100) Init Ambiguous name for method of Products.Pyth onMethod.PythonMethod.PythonMethod: "manage" != "manage_main"
The PythonMethod product, like many other products, tries to make the management screens available to users depending on their permissions. Unfortunately there was a problem with the way the management screens were being set up and consequently in some cases only managers can access the screens. It's a case of overzealous security. There's a way to fix it but unless you're going to let non-managers create Python Methods, it's nothing to worry about.
I would appreciate it if you would outline how to fix this as I'm encountering the problem with other Zope product and want to get rid of spurious error messages. Thanks Richard
On Thu, 26 Jul 2001, Richard Barrett wrote:
At 00:49 25/07/2001 -0400, Shane Hathaway wrote:
snip ...
------ 2001-07-24T10:11:33 PROBLEM(100) Init Ambiguous name for method of Products.Pyth onMethod.PythonMethod.PythonMethod: "manage" != "manage_main"
The PythonMethod product, like many other products, tries to make the management screens available to users depending on their permissions. Unfortunately there was a problem with the way the management screens were being set up and consequently in some cases only managers can access the screens. It's a case of overzealous security. There's a way to fix it but unless you're going to let non-managers create Python Methods, it's nothing to worry about.
I would appreciate it if you would outline how to fix this as I'm encountering the problem with other Zope product and want to get rid of spurious error messages.
Okay. You have to explicitly declare the name of the methods. Here is a snippet of PythonScript.py: ZPythonScriptHTML_editForm = DTMLFile('www/pyScriptEdit', globals()) manage = manage_main = ZPythonScriptHTML_editForm ZPythonScriptHTML_editForm._setName('ZPythonScriptHTML_editForm') The third line was added just recently. It explicitly declares to the security machinery what the name of the DTMLMethod "ZPythonScriptHTML_editForm" is. A human can easily see that the name is "ZPythonScriptHTML_editForm", but Zope can't tell whether it should be "ZPythonScriptHTML_editForm", "manage", "manage_main", or even "pyScriptEdit". Python doesn't provide any easy way to figure out the correct name of a DTMLMethod, but Zope tries to anyway. The error message was added to notify product authors that Zope had to take a guess! So you'll want to add a similar line to a product for each occurrance of the "ambiguous name" warning. This is a problem that has always existed in Zope products. You just didn't know about it until Zope 2.4.0. It's really not a serious thing at all, just something that *might* prevent access to a management screen when access ought to be granted. Shane
participants (3)
-
Eivind Bengtsson -
Richard Barrett -
Shane Hathaway