Re: Routes problem (not thread safe?)

2009-02-10 Thread carlos

Thank you Philip, I've updated to routes 1.10.3 (it needs WebOb so
I've installed it too) and at the moment it works fine.

Carlos.



On 9 feb, 21:16, Philip Jenvey pjen...@underboss.org wrote:
 On Feb 9, 2009, at 2:47 AM, carlos wrote:



  Hi, I'm using Pylons 0.9.6.1, with Routes 1.7.3 and Python 2.5.
  inspecting de variables with the traceback debugger, I see that var
  is always a str, but self.prior is sometimes a dict ( {'type': ':',
  'name': 'format'} ) and sometimes a str (but it also raises the
  TypeError exception, as if it was a dict!). It seems some kind of
  thread problem, because I repeat the same request and it works fine.
  Is this a known bug or maybe I'm doing something wrong?

 Yes, this was a bug -- create_regs was not thread safe. According to  
 the changelog this was fixed in the 1.9 release.

 --
 Philip Jenvey
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Routes problem (not thread safe?)

2009-02-09 Thread carlos

Hi, I'm using Pylons 0.9.6.1, with Routes 1.7.3 and Python 2.5. I'm
testing an application which uses AJAX to display information, and it
makes many request asynchronously. It works fine, but some times
randomly the server raises an exception in a GET request, always the
same exception at routes.base:266. Here is the traceback:

URL: http://localhost:5000/rest/prestaciones/17/informes.xml
Module pylons.error:245 in respond
Module pylons.wsgiapp:315 in __call__
Module beaker.cache:180 in __call__
Module beaker.session:405 in __call__
Module routes.middleware:65 in __call__
Module routes:22 in __setattr__
Module routes:44 in load_wsgi_environ
Module routes.base:825 in routematch
Module routes.base:770 in _match
Module routes.base:747 in create_regs
Module routes.base:223 in makeregexp
Module routes.base:253 in buildnextreg
Module routes.base:253 in buildnextreg
Module routes.base:253 in buildnextreg
Module routes.base:253 in buildnextreg
Module routes.base:253 in buildnextreg
Module routes.base:253 in buildnextreg

and the last one, with the line and the exception:

Module routes.base:266 in buildnextreg
  partreg = '(?P' + var + '[^' + self.prior + ']+?)'
type 'exceptions.TypeError': cannot concatenate 'str' and 'dict'
objects


inspecting de variables with the traceback debugger, I see that var
is always a str, but self.prior is sometimes a dict ( {'type': ':',
'name': 'format'} ) and sometimes a str (but it also raises the
TypeError exception, as if it was a dict!). It seems some kind of
thread problem, because I repeat the same request and it works fine.
Is this a known bug or maybe I'm doing something wrong?

thanks

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Routes problem (not thread safe?)

2009-02-09 Thread Philip Jenvey


On Feb 9, 2009, at 2:47 AM, carlos wrote:

 Hi, I'm using Pylons 0.9.6.1, with Routes 1.7.3 and Python 2.5.

 inspecting de variables with the traceback debugger, I see that var
 is always a str, but self.prior is sometimes a dict ( {'type': ':',
 'name': 'format'} ) and sometimes a str (but it also raises the
 TypeError exception, as if it was a dict!). It seems some kind of
 thread problem, because I repeat the same request and it works fine.
 Is this a known bug or maybe I'm doing something wrong?


Yes, this was a bug -- create_regs was not thread safe. According to  
the changelog this was fixed in the 1.9 release.

--
Philip Jenvey

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---