Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #74317

Re: Solution-resistant AttributeError: 'modle' object has no attribute...

References <CAGGBd_oBv8T+S85REU_m+hp62yQaZZQiHz_kuQ0fQb445J9ooA@mail.gmail.com>
Date 2014-07-11 02:58 +1000
Subject Re: Solution-resistant AttributeError: 'modle' object has no attribute...
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.11734.1405011487.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Fri, Jul 11, 2014 at 2:41 AM, Dan Stromberg <drsalists@gmail.com> wrote:
> It's as though an old version of the module is being
> seen, rather than the current version.
>
> Anyone have any (further) suggestions for me?
>

Wipe out *.pyc and try again? Restart any processes that are running
Django, in case they have it cached in memory?

This is something Python isn't really designed for (coping with
multiple versions of a module simultaneously). The Python import
machinery seems to assume that, across one process's lifetime, all .py
and .pyc (etc) files ever used will remain pristine, and can safely be
cached etc. There's no good mechanism for saying "Hey, Python, I just
updated this file, can you load the new version please?" - every
method I've seen for doing so seems to require fiddling around with
internals, and/or extreme risk of getting the wrong version.

ChrisA

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Solution-resistant AttributeError: 'modle' object has no attribute... Chris Angelico <rosuav@gmail.com> - 2014-07-11 02:58 +1000

csiph-web