Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gluon/languages.py: import escape from html instead of cgi #2272

Closed
wants to merge 1 commit into from
Closed

gluon/languages.py: import escape from html instead of cgi #2272

wants to merge 1 commit into from

Conversation

ffontaine
Copy link

import escape from html instead of cgi to fix the following build
failure with python 3.8:

/home/buildroot/autobuild/run/instance-2/output-1/host/bin/python -c 'import os; os.chdir("/home/buildroot/autobuild/run/instance-2/output-1/build/python-web2py-2.17.2"); from gluon.main import save_password; save_password("web2py",8000)'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/buildroot/autobuild/run/instance-2/output-1/build/python-web2py-2.17.2/gluon/__init__.py", line 34, in <module>
    from .globals import current
  File "/home/buildroot/autobuild/run/instance-2/output-1/build/python-web2py-2.17.2/gluon/globals.py", line 24, in <module>
    from gluon.serializers import json, custom_json
  File "/home/buildroot/autobuild/run/instance-2/output-1/build/python-web2py-2.17.2/gluon/serializers.py", line 10, in <module>
    from gluon.languages import lazyT
  File "/home/buildroot/autobuild/run/instance-2/output-1/build/python-web2py-2.17.2/gluon/languages.py", line 19, in <module>
    from cgi import escape
ImportError: cannot import name 'escape' from 'cgi' (/home/buildroot/autobuild/run/instance-2/output-1/host/lib/python3.8/cgi.py)

Fixes:

Signed-off-by: Fabrice Fontaine fontaine.fabrice@gmail.com

import escape from html and fallback on current import from cgi to fix
the following build failure with python 3.8:

/home/buildroot/autobuild/run/instance-2/output-1/host/bin/python -c 'import os; os.chdir("/home/buildroot/autobuild/run/instance-2/output-1/build/python-web2py-2.17.2"); from gluon.main import save_password; save_password("web2py",8000)'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/buildroot/autobuild/run/instance-2/output-1/build/python-web2py-2.17.2/gluon/__init__.py", line 34, in <module>
    from .globals import current
  File "/home/buildroot/autobuild/run/instance-2/output-1/build/python-web2py-2.17.2/gluon/globals.py", line 24, in <module>
    from gluon.serializers import json, custom_json
  File "/home/buildroot/autobuild/run/instance-2/output-1/build/python-web2py-2.17.2/gluon/serializers.py", line 10, in <module>
    from gluon.languages import lazyT
  File "/home/buildroot/autobuild/run/instance-2/output-1/build/python-web2py-2.17.2/gluon/languages.py", line 19, in <module>
    from cgi import escape
ImportError: cannot import name 'escape' from 'cgi' (/home/buildroot/autobuild/run/instance-2/output-1/host/lib/python3.8/cgi.py)

Fixes:
 - http://autobuild.buildroot.org/results/fa515627ae888d08fc10074e8d9f6e9dbede91a7

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
@codecov-io
Copy link

Codecov Report

Merging #2272 into master will decrease coverage by 1.35%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #2272      +/-   ##
==========================================
- Coverage   49.23%   47.87%   -1.36%     
==========================================
  Files          43       43              
  Lines       16045    16041       -4     
  Branches     3752     3749       -3     
==========================================
- Hits         7900     7680     -220     
- Misses       7036     7219     +183     
- Partials     1109     1142      +33

@ffontaine
Copy link
Author

Fixed through eda8277 so I close this PR

@ffontaine ffontaine closed this Nov 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants