Changes between Initial Version and Version 1 of Ticket #36


Ignore:
Timestamp:
10/17/06 02:27:02 (8 years ago)
Author:
xi
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #36 – Description

    initial v1  
    11Hello, 
    22   Sorry to ask a stupid question, but, is PyYaml thread-safe ? I am trying to run PyYaml under WebWare and I get a session identifier. Due to the nature of WebWare being servlet based, I find that it sometimes calls 'get session' more than once during the lifetime of processing the servlet. The code that get's run more than once is; 
    3  
     3{{{ 
     4#!python 
    45    def __getitem__(self, key): 
    56        if debug: 
     
    2526            self._lock.release() 
    2627        return item 
    27  
     28}}} 
    2829    When I put wrapper print statements around the yaml.load, I notice that the first time it works without fail, the next time I get this; 
    29  
     30{{{ 
     31#!python 
    3032>> get (20061016171933-d0e40d4c65b62dffbbe4c3d2b21922a5) 
    3133 RIGHT BEFORE YAML.load for <open file '/usr/local/web_work/Sessions/20061016171933-d0e40d4c65b62dffbbe4c3d2b21922a5.ses', mode 'r' at 0xb71798d8> (/usr/local/web_work/Sessions/20061016171933-d0e40d4c65b62dffbbe4c3d2b21922a5.ses) 
     
    6163  File "build/bdist.linux-i686/egg/yaml/constructor.py", line 551, in make_python_instance 
    6264TypeError: __new__() takes exactly 2 arguments (1 given) 
    63  
     65}}} 
    6466 
    6567  So, from my total layman's perspective, it appears that the __init__.py is expected to be called 'once', yet due to WebWare's threading, I think it get's called more than once. Either way, I could be totally and whole heartedly wrong, any ideas ?