I'm getting an
intermittent NameError trying to access a variable set in the external scope of
LoginManager.py . I call my variable _x and set it directly above where
_LogginInUser gets set. I then try to access it directly above a line that
accesses _LoggingInUser gets accessed. I just do a simple print
'testing=%s'%_x. I get an exception. The line that accesses
_LoggingInUser doesn't.
What
gives?
Now get this ... if
I change the name to (13x's) _xxxxxxxxxxxxx , it works.
If I then change the
name to (6x's) _xxxxxx, it continues to work.
If I then change the
name to (3x's) _xxx, it continues to work.
(2x's) _xx
works
(1x's) _x doesn't
work!!!!
If I change the line
near the top of the file from
_xx='sss'
to
_xx=0
and change the print
to use a %d I get the NameError.
If I change the line
back to _xx='sss' and the print back to a %s I continue to get the NameError ...
even though that exact combination had worked a minute
before!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
If I then change the
variable back to have 13x's it starts working again. Is there some deep
problem with the python byte compiler or access control mangling features of
Zope? Or am I missing something stupid?
What in the world is
going on?
A.
Traceback (innermost
last):
File D:\CloakMail\lib\python\ZPublisher\Publish.py, line 238,
in publish_module
File D:\CloakMail\lib\python\ZPublisher\Publish.py,
line 199, in publish
File D:\CLOAKM~1\lib\python\Zope\__init__.py,
line 221, in zpublisher_exception_hook
(Object:
Traversable)
File D:\CloakMail\lib\python\ZPublisher\Publish.py, line
165, in publish
File
D:\CloakMail\lib\python\ZPublisher\BaseRequest.py, line 450, in
traverse
File
D:\CloakMail\lib\python\Products\LoginManager\LoginManager.py, line 236, in
validate
(Object: ProviderContainer)
NameError: (see
above)