Changes between Initial Version and Version 1 of Ticket #36
- Timestamp:
- 10/17/06 02:27:02 (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #36 – Description
initial v1 1 1 Hello, 2 2 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 4 5 def __getitem__(self, key): 5 6 if debug: … … 25 26 self._lock.release() 26 27 return item 27 28 }}} 28 29 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 30 32 >> get (20061016171933-d0e40d4c65b62dffbbe4c3d2b21922a5) 31 33 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) … … 61 63 File "build/bdist.linux-i686/egg/yaml/constructor.py", line 551, in make_python_instance 62 64 TypeError: __new__() takes exactly 2 arguments (1 given) 63 65 }}} 64 66 65 67 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 ?
