[sqlalchemy] Re: 'PropertyLoader' object has no attribute 'strategy'
Roger Demetrescu wrote: On 4/11/07, King Simon-NFHD78 [EMAIL PROTECTED] wrote: I've got no idea about the source of the problem, but it would probably be helpful if you could provide stack traces from the exceptions, if that's possible. Do you mean using the traceback module ? I've just searched about it and I guess I should use this: try: # do my stuff except: traceback.print_exc(file=sys.stdout) raise Is this the best way to show the stack trace ? That would be one way to do it. If you are using the python logging module, another way would be to use the logger.exception method, which automatically adds the exception info, including the traceback, into the log message. Ie. try: # do your stuff except: logging.exception('Oops, an exception occurred') # or use your_logger_instance.exception raise Other than that, I would have thought you should be able to track down the source of the 'global name' exception by grepping your source code for uses of 'anxnews_urllocal' without a '.' in front of it. Is it possible that you are doing something like this, for example: query.select_by(anxnews_urllocal 5) When you probably mean: query.select_by(table.c.anxnews_urllocal 5) Man, you got it !! :) The only line of my simple code that have a anxnews_urllocal without a preceding . is here: if anexo.anxnews_tipof == Anexo.IMAGEM: cronometro.start() renamed, size = _gerar_thumbs(local, SIZE_WEB, SIZE_THUMB) if renamed: anexo.anxnews_urllocal = posixpath.splitext(anxnews_urllocal)[0] + .jpg This renamed condition is very rare... It only occurs when I'm dealing with a BMP image... And my log file confirms that.. I was manipulating a BMP image... :D So I'm changing splitext(anxnews_urllocal) to splitext(anexo.anxnews_urllocal) Hope that helps, It sure helped... Thanks ! Roger Well, it certainly makes a change - normally I'm the one asking the questions ;-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] Re: 'PropertyLoader' object has no attribute 'strategy'
On 4/11/07, King Simon-NFHD78 [EMAIL PROTECTED] wrote: Roger Demetrescu wrote: Do you mean using the traceback module ? I've just searched about it and I guess I should use this: try: # do my stuff except: traceback.print_exc(file=sys.stdout) raise Is this the best way to show the stack trace ? That would be one way to do it. If you are using the python logging module, another way would be to use the logger.exception method, which automatically adds the exception info, including the traceback, into the log message. Ie. try: # do your stuff except: logging.exception('Oops, an exception occurred') # or use your_logger_instance.exception raise Cool... I am using python logging... I'll try your suggestion... :) Thanks again, Roger --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] Re: 'PropertyLoader' object has no attribute 'strategy'
On Apr 11, 2007, at 1:46 AM, Roger Demetrescu wrote: Hi all, I have a daemon with 2 threads to control upload / download of some files (they use SQLAlchemy to find out which files must be worked). Once a week, my daemon's logging system sends me an email with this message: 'PropertyLoader' object has no attribute 'strategy' After that, I receive another email with this message: global name 'anxnews_urllocal' is not defined where 'anxnews_urllocal' is a field from a table. I usually don't need to touch this daemon... it still works fine even after this alert. Any hints about what could be causing this exception ? one or both of thread synchronization / module import based issues. id be curious to know if the PropertyLoader exception occurs within the Mapper.compile() method. I do have a mutex on that system to avoid concurrency issues when the mapper first compiles (its one of the only mutexes within all of SA), but you know how grumpy mutexes can be. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] Re: 'PropertyLoader' object has no attribute 'strategy'
Some details I forgot to mention: I'm using: * SQLAlchemy 0.3.6 * Postgresql 7.3.4 * Linux RedHat kernel 2.4.20-8 Other important detail: looking at my log files, I noticed that the message: global name 'anxnews_urllocal' is not defined appears several hours after the message: 'PropertyLoader' object has no attribute 'strategy' Thanks Roger On 4/11/07, Roger Demetrescu [EMAIL PROTECTED] wrote: Hi all, I have a daemon with 2 threads to control upload / download of some files (they use SQLAlchemy to find out which files must be worked). Once a week, my daemon's logging system sends me an email with this message: 'PropertyLoader' object has no attribute 'strategy' After that, I receive another email with this message: global name 'anxnews_urllocal' is not defined where 'anxnews_urllocal' is a field from a table. I usually don't need to touch this daemon... it still works fine even after this alert. Any hints about what could be causing this exception ? Please feel free to ask for more details... TIA Roger --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---