librelist archives

« back to archive

Import problem with appcontext_tearing_down

Import problem with appcontext_tearing_down

From:
Demitri Muna
Date:
2012-08-13 @ 23:57
Hi,

I am having a problem importing "appcontext_tearing_down":

% python
Python 2.7.2+ (default, Oct  4 2011, 20:06:09) 
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import flask
>>> flask.__version__
'0.9'
>>> from flask import appcontext_tearing_down
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name appcontext_tearing_down
>>> 


I also note in the docs at the bottom of this page a possible error:

http://flask.pocoo.org/docs/signals/

The last code snippet has "from flask import request_tearing_down" (which 
is repeated from the code example above it), but it seems like it should 
be "from flask import appcontext_tearing_down". Except that doesn't work.

Cheers,
Demitri

Re: [flask] Import problem with appcontext_tearing_down

From:
Demitri Muna
Date:
2012-08-14 @ 19:00
Hi,

> I am having a problem importing "appcontext_tearing_down":

I've solved this with

from flask.signals import appcontext_tearing_down

which seems to work. This is contrary to the documentation, so I don't 
know if this is the correct way to do this or if something is wrong 
elsewhere.

Cheers,
Demitri

Re: [flask] Import problem with appcontext_tearing_down

From:
Simon Sapin
Date:
2012-08-14 @ 06:51
Le 14/08/2012 01:57, Demitri Muna a écrit :
> Hi,
>
> I am having a problem importing "appcontext_tearing_down":

This is a bug. I made a pull request to fix it:
https://github.com/mitsuhiko/flask/pull/575/files

In the meantime, you can import it form flask.signals

> I also note in the docs at the bottom of this page a possible error:
>
> http://flask.pocoo.org/docs/signals/
>
> The last code snippet has "from flask import request_tearing_down"
> (which is repeated from the code example above it), but it seems like
> it should be "from flask import appcontext_tearing_down". Except that
> doesn't work.

Indeed.
https://github.com/mitsuhiko/flask/pull/576

Thanks for catching these!

-- 
Simon Sapin

Re: [flask] Import problem with appcontext_tearing_down

From:
Simon Sapin
Date:
2012-08-16 @ 16:45
Le 14/08/2012 08:51, Simon Sapin a écrit :
> Le 14/08/2012 01:57, Demitri Muna a écrit :
>> Hi,
>>
>> I am having a problem importing "appcontext_tearing_down":
>
> This is a bug. I made a pull request to fix it:
> https://github.com/mitsuhiko/flask/pull/575/files
>
> In the meantime, you can import it form flask.signals
>
>> I also note in the docs at the bottom of this page a possible error:
>>
>> http://flask.pocoo.org/docs/signals/
>>
>> The last code snippet has "from flask import request_tearing_down"
>> (which is repeated from the code example above it), but it seems like
>> it should be "from flask import appcontext_tearing_down". Except that
>> doesn't work.
>
> Indeed.
> https://github.com/mitsuhiko/flask/pull/576
>
> Thanks for catching these!
>

Sent again, librelist was down.

-- 
Simon Sapin