Changing class name causes process to 'hang'
Tim Johnson
tim at johnsons-web.com
Sat Mar 12 19:18:44 EST 2011
* Terry Reedy <tjreedy at udel.edu> [110312 13:28]:
> On 3/12/2011 2:53 PM, Tim Johnson wrote:
>
> Is 'cgilib' *your* wrapper of the cgi module, or from a third party.
cgilib is my module. I use the cgi module as follows:
## code below
import cgi
self.form = cgi.FieldStorage(keep_blank_values=1)
## /code
> Without seeing cgitools/cgirev, it is hard to say. Something like
>
> while True:
> try:
> x = cgitools()
> break
> except NameError
> pass
>
> would produce the symptom ;-)
Hmm! I'm unsure what you mean here, but
I did do something like this:
## code below
if __name__=="__main__":
import sys,traceback
sys.stderr = sys.stdout ##
try :
print("Content-type: text/html\n")
print("<pre>")
cgi = CGI()
print("here")
print("CGI OUTPUT TEST")
for i in range(cgi.len_path_parts()):
print("path part # %d requested: %s" % (i,str(cgi[i])))
except :
traceback.print_exc()
## /code
And I get
CGI OUTPUT TEST
path part # 0 requested: test
path part # 1 requested: this
Whether I use CGI or cgitools as the class name.
But, if I use CGI as the class name and instantiate from a large application
with numerous dependecies, the process hangs.
The same happens if I 'alias' cgitools, as in
class CGI(cgitools):
pass
It is as if some gremlin lives on my system and insists that I use
the name `cgitools' and only the name `cgitools'. I'm sure
this comes from a side effect somewhere in the process.
thanks for the reply
--
Tim
tim at johnsons-web.com or akwebsoft.com
http://www.akwebsoft.com
More information about the Python-list
mailing list