Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 708714 - dev-python/flask-babelex-0.9.3 with dev-python/werkzeug-1.0.0 - ImportError: cannot import name 'ImmutableDict' from 'werkzeug' (/usr/lib/python3.8/site-packages/werkzeug/__init__.py)
Summary: dev-python/flask-babelex-0.9.3 with dev-python/werkzeug-1.0.0 - ImportError: ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Python Gentoo Team
URL: https://github.com/mrjoes/flask-babel...
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2020-02-08 13:16 UTC by José de Paula Rodrigues
Modified: 2020-05-03 08:16 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
flask-babelex-0.9.4.ebuild.patch (flask-babelex-0.9.4.ebuild.patch,530 bytes, patch)
2020-02-26 10:42 UTC, pva
Details | Diff
File containing flask-wtf-0.14.3.ebuild.patch (flask-wtf-0.14.3.ebuild.patch,273 bytes, patch)
2020-04-20 07:30 UTC, Stig Nielsen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description José de Paula Rodrigues 2020-02-08 13:16:18 UTC
An explicit dependency should be add for <dev-python/werkzeug-1.0.0 (which landed on Gentoo 2020-02-07). The API of that lib has changed, there is already an upstream bug:
https://github.com/mrjoes/flask-babelex/issues/18

Without this, pgAdmin4 fails to start with:

$ python /usr/share/pgadmin4/web/pgAdmin4.py 
Traceback (most recent call last):
  File "/usr/share/pgadmin4/web/pgAdmin4.py", line 40, in <module>
    import config
  File "/usr/share/pgadmin4/web/config.py", line 30, in <module>
    from pgadmin.utils import env, IS_PY2, IS_WIN, fs_short_path
  File "/usr/share/pgadmin4/web/pgadmin/__init__.py", line 21, in <module>
    from flask_babelex import Babel, gettext
  File "/usr/lib/python3.8/site-packages/flask_babelex/__init__.py", line 23, in <module>
    from werkzeug import ImmutableDict
ImportError: cannot import name 'ImmutableDict' from 'werkzeug' (/usr/lib/python3.8/site-packages/werkzeug/__init__.py)
Comment 1 pva 2020-02-26 09:49:29 UTC
New flask-babelex version, 0.9.4, fixes this problem.
Comment 2 pva 2020-02-26 10:42:09 UTC
Created attachment 615948 [details, diff]
flask-babelex-0.9.4.ebuild.patch
Comment 3 Stig Nielsen 2020-04-20 05:06:34 UTC
same problem.
Comment 4 Stig Nielsen 2020-04-20 05:38:09 UTC
Adding the patch from pva (thank you btw) I get the next error messages:

$ python /usr/share/pgadmin4/web/pgAdmin4.py
Traceback (most recent call last):
  File "/usr/share/pgadmin4/web/pgAdmin4.py", line 40, in <module>
    import config
  File "/usr/share/pgadmin4/web/config.py", line 30, in <module>
    from pgadmin.utils import env, IS_PY2, IS_WIN, fs_short_path
  File "/usr/share/pgadmin4/web/pgadmin/__init__.py", line 25, in <module>
    from flask_security import Security, SQLAlchemyUserDatastore, current_user
  File "/usr/lib64/python3.6/site-packages/flask_security/__init__.py", line 13, in <module>
    from .core import Security, RoleMixin, UserMixin, AnonymousUser, current_user
  File "/usr/lib64/python3.6/site-packages/flask_security/core.py", line 28, in <module>
    from .forms import ChangePasswordForm, ConfirmRegisterForm, \
  File "/usr/lib64/python3.6/site-packages/flask_security/forms.py", line 17, in <module>
    from flask_wtf import FlaskForm as BaseForm
  File "/usr/lib64/python3.6/site-packages/flask_wtf/__init__.py", line 17, in <module>
    from .recaptcha import *
  File "/usr/lib64/python3.6/site-packages/flask_wtf/recaptcha/__init__.py", line 2, in <module>
    from .fields import *
  File "/usr/lib64/python3.6/site-packages/flask_wtf/recaptcha/fields.py", line 3, in <module>
    from . import widgets
  File "/usr/lib64/python3.6/site-packages/flask_wtf/recaptcha/widgets.py", line 5, in <module>
    from werkzeug import url_encode
ImportError: cannot import name 'url_encode'

Apparently the simple fix should be to bump flask-wtf to version 0.14.3. I will search bugs.gentoo.org to see if it already has been done and then try that later today.
Comment 5 Stig Nielsen 2020-04-20 07:30:33 UTC
Created attachment 633814 [details, diff]
File containing flask-wtf-0.14.3.ebuild.patch

After upgrading to flask-wtf-0.14.3 pgAdmin4 is again working for me. Hope you can use it. Regards Stig
Comment 6 Larry the Git Cow gentoo-dev 2020-05-03 06:36:16 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4bf0c56df14ffa10dc6583b55864428720272e65

commit 4bf0c56df14ffa10dc6583b55864428720272e65
Author:     Viktar Patotski (aka xp-vit) <xp.vit.blr@gmail.com>
AuthorDate: 2020-05-02 14:08:30 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2020-05-03 06:35:40 +0000

    dev-python/flask-babelex: version bump to 0.9.4
    
    Bump to 0.9.4. This also fixes compatobility with
    dev-python/werkzeug-1.0.0+.
    
    Closes: https://bugs.gentoo.org/720466
    Closes: https://bugs.gentoo.org/708714
    Signed-off-by: Viktar Patotski <xp.vit.blr@gmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/15611
    Signed-off-by: Michał Górny <mgorny@gentoo.org>

 dev-python/flask-babelex/Manifest                  |  1 +
 .../flask-babelex/flask-babelex-0.9.4.ebuild       | 38 ++++++++++++++++++++++
 2 files changed, 39 insertions(+)
Comment 7 Viktar Patotski 2020-05-03 08:16:41 UTC
it should be reopened, but will be closed soon (hopelly finally) together with: https://bugs.gentoo.org/720756