Pyramid 1.3 DeprecationWarning

85 views
Skip to first unread message

Vlad K.

unread,
May 17, 2012, 9:01:26 PM5/17/12
to pylons-...@googlegroups.com

Hi.


Just upgraded a 1.2 app to 1.3, with clean new virtualenv, all is
working fine (with changes to config for waitress) except those pesky
DeprecationWarning messages caused by Transaction, Chameleon, SQLA and
even the configurator.

It is in line with the changelog in docs stating it would raise these
warnings (and this is on 2.6.6), but how do I shut it up? Tried raising
logging level from warn to error, it still complains, and in my case it
is a problem because I've got cron scripts running parts of the app and
I need the stderr to catch real errors. Gah, I get an email from cron
every 5 minutes from three application machines.

Help? (yes, I did pipe to devnull for now)


/home/rm/virtualenv/lib/python2.6/site-packages/transaction-1.2.0-py2.6.egg/transaction/_transaction.py:140:
DeprecationWarning: The implements API is deprecated, and will not work
in Python3 Use the @implementer class decorator instead.
interfaces.ITransactionDeprecated)
/home/rm/virtualenv/lib/python2.6/site-packages/transaction-1.2.0-py2.6.egg/transaction/_transaction.py:681:
DeprecationWarning: The implements API is deprecated, and will not work
in Python3 Use the @implementer class decorator instead.
interface.implements(interfaces.ISavepoint)
/home/rm/virtualenv/lib/python2.6/site-packages/Chameleon-2.8.5-py2.6.egg/chameleon/tal.py:227:
DeprecationWarning: The implements API is deprecated, and will not work
in Python3 Use the @implementer class decorator instead.
zope.interface.implements(interfaces.ITALESIterator)
/home/rm/virtualenv/lib/python2.6/site-packages/Chameleon-2.8.5-py2.6.egg/chameleon/tal.py:467:
DeprecationWarning: The implements API is deprecated, and will not work
in Python3 Use the @implementer class decorator instead.
zope.interface.implements(interfaces.ITALExpressionErrorInfo)
/home/rm/virtualenv/lib/python2.6/site-packages/pyramid-1.3-py2.6.egg/pyramid/config/views.py:389:
DeprecationWarning: The classProvides API is deprecated, and will not
work in Python3 Use the @provider class decorator instead.
classProvides(IViewMapperFactory)
/home/rm/virtualenv/lib/python2.6/site-packages/zope.sqlalchemy-0.7-py2.6.egg/zope/sqlalchemy/datamanager.py:63:
DeprecationWarning: The implements API is deprecated, and will not work
in Python3 Use the @implementer class decorator instead.
implements(ISavepointDataManager)
/home/rm/virtualenv/lib/python2.6/site-packages/zope.sqlalchemy-0.7-py2.6.egg/zope/sqlalchemy/datamanager.py:169:
DeprecationWarning: The implements API is deprecated, and will not work
in Python3 Use the @implementer class decorator instead.
implements(IDataManagerSavepoint)


Thanks,

--

.oO V Oo.

Brian Sutherland

unread,
May 18, 2012, 4:53:37 AM5/18/12
to pylons-...@googlegroups.com
On Fri, May 18, 2012 at 03:01:26AM +0200, Vlad K. wrote:
>
> Hi.
>
>
> Just upgraded a 1.2 app to 1.3, with clean new virtualenv, all is
> working fine (with changes to config for waitress) except those
> pesky DeprecationWarning messages caused by Transaction, Chameleon,
> SQLA and even the configurator.
>
> It is in line with the changelog in docs stating it would raise
> these warnings (and this is on 2.6.6), but how do I shut it up?
> Tried raising logging level from warn to error, it still complains,
> and in my case it is a problem because I've got cron scripts running
> parts of the app and I need the stderr to catch real errors. Gah, I
> get an email from cron every 5 minutes from three application
> machines.
>
> Help? (yes, I did pipe to devnull for now)

Try sticking to zope.interface 3.8.x for now:

http://pypi.python.org/pypi/zope.interface
> --
> You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
> To post to this group, send email to pylons-...@googlegroups.com.
> To unsubscribe from this group, send email to pylons-discus...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
>

--
Brian Sutherland

Vlad K.

unread,
May 18, 2012, 7:12:40 AM5/18/12
to pylons-...@googlegroups.com

On 05/18/2012 10:53 AM, Brian Sutherland wrote:
Try sticking to zope.interface 3.8.x for now:

    http://pypi.python.org/pypi/zope.interface



Okay, yeah, Pyramid's setup.py says zope.interface >= 3.8.0, I guess that's safe then. Thanks for pointing that out.





However I've just noticed another problem. Having piped stderr to devnull to avoid cron scripts mailing deprecation warnings, I didn't see another problem, only to find out later that my scripts weren't working.


Traceback (most recent call last):
File "src/scripts/gateway_export.py", line 19, in <module>
from sqlalchemy.orm import subqueryload
File "build/bdist.linux-i686/egg/sqlalchemy/__init__.py", line 52, in <module>

File "build/bdist.linux-i686/egg/sqlalchemy/types.py", line 33, in <module>
except NameError:
File "build/bdist.linux-i686/egg/sqlalchemy/processors.py", line 98, in <module>
File "build/bdist.linux-i686/egg/sqlalchemy/cprocessors.py", line 7, in <module>
File "build/bdist.linux-i686/egg/sqlalchemy/cprocessors.py", line 4, in __bootstrap__
File "/home/rm/virtualenv/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 882, in resource_filename
File "/home/rm/virtualenv/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 1351, in get_resource_filename
File "/home/rm/virtualenv/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 1373, in _extract_resource
File "/home/rm/virtualenv/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 962, in get_cache_path
File "/home/rm/virtualenv/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 928, in extraction_error
pkg_resources.ExtractionError: Can't extract file(s) to egg cache

The following error occurred while trying to extract file(s) to the Python egg
cache:

[Errno 13] Permission denied: '//.python-eggs'

The Python egg cache directory is currently set to:

//.python-eggs

Perhaps your account does not have write access to this directory?  You can
change the cache directory by setting the PYTHON_EGG_CACHE environment
variable to point to an accessible directory.


Of course, adding export PYTHON_EGG_CACHE="/home/rm" to the common bootstrap script for all cron scripts (that also sources virtualenv) fixed the problem. But I'd like to know what changed between my old virtualenv (established for Pyramid 1.2.1) and this new one. Both have been installed exactly the same way:

cd /home/rm
virtualenv --no-site-packages virtualenv
(fetch source from git repo)
source virtualenv/bin/activate
python setup.py develop



Plus, this //.python-eggs looks like something's missing between two / /.

And yeah, I should use setup.py console_scripts section and make the scripts properly, based on initdb example in the sqlalchemy template, with commands installed in virtualenv's bin because what I have now is relic cobbled together since Pyramid 1.1 days :)


.oO V Oo.

Vlad K.

unread,
May 18, 2012, 7:59:00 AM5/18/12
to pylons-...@googlegroups.com

BTW, seems downgrading zope.intarface to 3.8.0 requires also zope.deprecation < 4.0.0 , the latest of which is 3.5.1 I think.

.oO V Oo.

Angelo Hulshout

unread,
May 18, 2012, 7:05:09 PM5/18/12
to pylons-discuss
Going back to zope.interface 3.8.0 and zope.deprecation 3.5.1 is also
the only way to get Configurator to work on Python 3.2 - what is a
deprecation warning on 2.x is an error on 3.x - or so it seems on my
systems.

Chris McDonough

unread,
May 19, 2012, 9:28:54 AM5/19/12
to pylons-...@googlegroups.com
FTR, I just released zope.sqlalchemy 0.7.1 and Pyramid 1.3.1. These
include fixes that allow them to work with zope.interface 4.0.

- C

Angelo Hulshout

unread,
May 19, 2012, 2:45:34 PM5/19/12
to pylons-discuss
Thanks for the update. I just started a new project, so I'll switch to
Pyramid 1.3.1 then to get back on track.

Angelo Hulshout

unread,
May 19, 2012, 2:55:33 PM5/19/12
to pylons-discuss
Have you tested the Pyramid install on Windows? Pip gives an error on
a file name while unpacking (removed project and account name info):

File "<myproject>\lib\os.py", line 152, in makedirs
mkdir(name, mode)
WindowsError: [Error 123] The filename, directory name, or volume
label syntax is incorrect: '<my user dir>\\AppData\\Local\\Temp\
\pycharm-packaging694329015352619110.tmp\\pyramid\\"pyramid'

Angelo Hulshout

unread,
May 19, 2012, 3:05:35 PM5/19/12
to pylons-discuss
Found it. There's a double quote in the folder name for Pyramid inside
your tgz archive, which is not appreciated by Windows (and I doubt
whether Linux or MacOs will like it).

Vlad K.

unread,
May 20, 2012, 6:53:03 AM5/20/12
to pylons-...@googlegroups.com


Okay, this helped a lot. Installed Pyramid 1.3.2, upgraded
zope.deprecation back to 4.0.0, zope.interface back to 4.0.0, had also
to upgrade transaction to 1.3.0 (dep of zope.sqlalchemy, which I also
upgraded to 0.7.1).

The only DeprecationWarning left is from Chameleon 2.8.5.

Now, this is entirely different issue, but is there a way to disable
Pyramid loading Chameleon at all, if we're not using it?


.oO V Oo.

Chris McDonough

unread,
May 20, 2012, 7:34:23 AM5/20/12
to pylons-...@googlegroups.com
Not right now

"Vlad K." <vl...@haronmedia.com> wrote:

Eric Lemoine

unread,
May 21, 2012, 4:52:20 AM5/21/12
to pylons-...@googlegroups.com
On Sun, May 20, 2012 at 12:53 PM, Vlad K. <vl...@haronmedia.com> wrote:
>
>
> Okay, this helped a lot. Installed Pyramid 1.3.2, upgraded zope.deprecation
> back to 4.0.0, zope.interface back to 4.0.0, had also to upgrade transaction
> to 1.3.0 (dep of zope.sqlalchemy, which I also upgraded to 0.7.1).
>
> The only DeprecationWarning left is from Chameleon 2.8.5.

I also see this DeprecationWarning. Am I correct to understand that
there's currently no way to get rid of it?

Thanks,


--
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.l...@camptocamp.com
http://www.camptocamp.com

Vlad K.

unread,
May 21, 2012, 11:03:15 AM5/21/12
to pylons-...@googlegroups.com

On 05/21/2012 10:52 AM, Eric Lemoine wrote:
> On Sun, May 20, 2012 at 12:53 PM, Vlad K.<vl...@haronmedia.com> wrote:
>>
>> Okay, this helped a lot. Installed Pyramid 1.3.2, upgraded zope.deprecation
>> back to 4.0.0, zope.interface back to 4.0.0, had also to upgrade transaction
>> to 1.3.0 (dep of zope.sqlalchemy, which I also upgraded to 0.7.1).
>>
>> The only DeprecationWarning left is from Chameleon 2.8.5.
> I also see this DeprecationWarning. Am I correct to understand that
> there's currently no way to get rid of it?


The way I see it, that's the case. Or downgrade dependecies (of Pyramid
1.3.0 / 1.3.2) to:

- zope.interface 3.8.0
- zope.deprecation 3.5.1
- zope.sqlalchemy 0.7.0
- transaction 1.2.0



.oO V Oo.



Marius Gedminas

unread,
May 21, 2012, 3:33:31 PM5/21/12
to pylons-...@googlegroups.com
FTR, it seems that we're soon going to have zope.interface 4.0.1
*without* those pesky DeprecationWarnings (assuming we're still talking
about the same ones).

Check the zope...@zope.org mailing list for details:
https://mail.zope.org/pipermail/zope-dev/2012-May/044412.html

Marius Gedminas
--
Star Trek promised me computers I could talk to but what I got was a telephone
I type on.
-- "Sarcastro"
signature.asc
Reply all
Reply to author
Forward
0 new messages