Pylons deprecations warnings

273 views
Skip to first unread message

Craig Small

unread,
Jul 24, 2012, 8:27:15 AM7/24/12
to turbo...@googlegroups.com
Hi,
I'm getting these warnings in TG2.2rc2 now, the tests are passing so
things are generally happy, but should I be getting these at all?

Sounds like Pylons is not been updated to me, anyone else getting this
and how to fix it?

/home/virtualenv/tg2env/local/lib/python2.7/site-packages/Pylons-1.0-py2.7.egg/pylons/wsgiapp.py:178: DeprecationWarning: decode_param_names is deprecated and w
ill not be supported starting with WebOb 1.2
decode_param_names=req_options['decode_param_names'])
/home/virtualenv/tg2env/local/lib/python2.7/site-packages/Pylons-1.0-py2.7.egg/pylons/controllers/util.py:194: DeprecationWarning: Raise HTTP exceptions directly
raise exc.exception

--
Craig Small VK2XLZ http://enc.com.au/ csmall at : enc.com.au
Debian GNU/Linux http://www.debian.org/ csmall at : debian.org
GPG fingerprint: 5D2F B320 B825 D939 04D2 0519 3938 F96B DF50 FEA5

Alessandro Molina

unread,
Jul 24, 2012, 4:07:35 PM7/24/12
to turbo...@googlegroups.com
TG 2.2 continues to use Pylons 1.0 due to some Pylons 1.0.1
incompatibilities with Python2.5 which is officially supported by
TG2.2

Those deprecation warnings can actually be ignored as they don't do
any harm, they are related to the fact the WebOb 1.1.1 is used and it
alerts you that some properties will be deprecated in 1.2
> --
> You received this message because you are subscribed to the Google Groups "TurboGears" group.
> To post to this group, send email to turbo...@googlegroups.com.
> To unsubscribe from this group, send email to turbogears+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/turbogears?hl=en.
>

Craig Small

unread,
Jul 25, 2012, 7:36:31 PM7/25/12
to turbo...@googlegroups.com
On Tue, Jul 24, 2012 at 03:10:01PM -0700, Jānis Ābele wrote:
> Is it possible to filter these messages using:
>
> warnings.filterwarnings('ignore', category=DeprecationWarning)
Let's put it another way (I was going to ask anyhow). Is there an easy
of of supressing those sort of warnings in nosetests, or, is there
a way of ignoring problems from things that aren't your package? A bit
like how --cover-package works on coverage.

I create enough warnings (or Craig's to-do list) without Pylons adding
to the noise.

- Craig

Michael Pedersen

unread,
Jul 29, 2012, 11:16:43 PM7/29/12
to turbo...@googlegroups.com
There's no reason you can't suppress them in your code. Edit your app_cfg module, and add the warnings.filterwarnings line. I would advise to be as specific as possible for it, since you don't want to hide actual (and important) warnings that can still occur.

But there's nothing stopping you.

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




--
Michael J. Pedersen
My Online Resume: http://www.icelus.org/ -- Google+ http://plus.ly/pedersen
Google Talk: m.ped...@icelus.org -- Twitter: pedersentg

Juparave

unread,
Sep 6, 2012, 11:17:58 AM9/6/12
to turbo...@googlegroups.com, csm...@enc.com.au
Hello,

I wonder where and how exactly you disable deprecation warnings.  I've tried:

On top of app_cfg.py and top of myapp/tests/__init__.py
import warnings
warnings.filterwarnings(action='ignore', category=DeprecationWarning)
 
and the same places but with
def fxn():
    warnings.warn("deprecated", DeprecationWarning)
with warnings.catch_warnings():
    warnings.simplefilter("ignore")
    fxn()

Thanks

Craig Small

unread,
Sep 6, 2012, 6:05:15 PM9/6/12
to turbo...@googlegroups.com
On Thu, Sep 06, 2012 at 08:17:58AM -0700, Juparave wrote:
> I wonder where and how exactly you disable deprecation warnings. I've

I've tried that too and, judging from your email, got the same
non-result as you :( Both of those from my limited googling I did when
I was trying to stop the warnings appear to be the right way to do it
with the minor detail that they don't work.

Sorry I don't have an answer, but at least you know its not just you!

- Craig

Michael Pedersen

unread,
Sep 19, 2012, 12:00:59 AM9/19/12
to turbo...@googlegroups.com
On Thu, Sep 6, 2012 at 6:05 PM, Craig Small <csm...@enc.com.au> wrote:
> On Thu, Sep 06, 2012 at 08:17:58AM -0700, Juparave wrote:
>> I wonder where and how exactly you disable deprecation warnings. I've

I don't have a fix for this, but I do have an explanation.

Nose is loading the pylons plugin, which imports Pylons, which
triggers the warning, before your testing code can be loaded up. The
same is true inside of TG: Pylons is loaded before AppConfig gets
loaded, which triggers the warning. At least, that's been what I've
observed with another app I'm working with.

You might be able to cure some of it, though, by putting the ignore
statements into project.config.middleware . No promises, but it might
work.
Reply all
Reply to author
Forward
0 new messages