Pylons redirect gives: AttributeError: the HTTPFound object does not have an 'exception' attribute

(This question documents my research for error to save others when I needed permission.)

I have a webpage built on top of Pylons 1.0.1.

Developers recommend switching to the transition to Pyramids - a new product. Pylons 1.0.1 will not continue.

However, I do not need any additional features - the website is in maintenance, so I did not update the framework.

Recently, after deploying some other changes to the server, the website stops working despite the absence of changes in my code. In particular, the redirect call gave an error:

AttributeError: HTTPFound object does not have an 'exception' attribute

+4
source share
2 answers

Pylons rely on WebOb. In dependencies, it requires the installation of WebOb> = 1.3.1.

WebOb 1.3.1 provides the "exception" attribute. This attribute is used by Pylons in the redirect code.

This attribute has been deprecated for some time and was originally planned for removal in 1.3.

May 14, 2014 WebOb 1.4 was released. Although not included in the release notes, one of the changes was to remove the exception attribute .

Therefore, if you install Pylons 1.0.1 and let it select all its dependencies, it will include a version of WebOb that it is no longer compatible with.

This explains the problem.

( : WebObs? Pylons 1.0.2? ?)

+5

: https://github.com/Pylons/pylons https://github.com/Pylons/webob !

:

git clone git@github.com:Pylons/webob.git
cd webob/ & python setup.py install --user
git clone git@github.com:Pylons/pylons.git
cd pylons/ & python setup.py install --user

:

:

pylons$ git log -1 --decorate=full
commit 7e8bac74046ba1ae1509c844fa5cd878490a3413 (HEAD, refs/remotes/origin/master, refs/remotes/origin/HEAD, refs/heads/master)
Date:   Tue Jul 7 18:05:23 2015 -0700

WebOb:

webob$ git log -1 --decorate=full
commit 565fe4420c147623c4a8f1077d6deab7ba732040 (HEAD, refs/remotes/origin/master, refs/remotes/origin/HEAD, refs/heads/master)
Date:   Sat Jun 27 22:03:39 2015 -0600

. zookeepr, :

https://github.com/flosokaks/zookeepr/commit/70766f190d58c04fec625be82ec56b7c6d405fb7#diff-7d442b7eb49f5fc377f51e74b291cfc1R18

+1

Source: https://habr.com/ru/post/1543721/


All Articles