-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
[BUG] Support for custom Python environment that ignore PEP 3120 #114
Comments
Hi, Thanks for the detailed report. The PEP 3120 gets ignored https://www.python.org/dev/peps/pep-3120/ Its not just the top level The obvious solution would be to find a proper way to represent u8 characters without actually using the str repr. Open for suggestions/PR. |
There is something of interest cf. https://bugs.python.org/issue29240 |
@kivhub I have found something interesting regarding the NT platform + python.
https://www.python.org/dev/peps/pep-0540/ What does return the following for you: sys.getfilesystemencoding()
locale.getpreferredencoding() And could you test against dev-master to see if that patch does anything at all #116 |
Thank you very much, @Ousret, for your effort. It looks there is a problem with old version of Python which comes to play with SAP BODS.
Python (3.9.6) itself returns UTF-8 on both. But when running Python via SAP BODS job the results are as follows:
The Python 3 libraries are used via:
I replaced the contents of these 2 files and after change to:
I am getting this error message:
|
I have an update here. After moving path.insert before all imports:
the code runs fine without any errors. |
I have not been able to force Python to trigger the decode error using a NT platform..
Well, from the look of it, your setup invoke Python 2.7 and from that standpoint I cannot do anything.
I would recommend you to alter the PATH outside of Python. |
Describe the bug
With requests library using charset-normalizer I am getting an error when calling Python via User-Defined Transform in SAP BODS:
I am not able to define a source code encoding by placing a magic comment into the source files (either as a first or second line in the file) because the app probably modifies the script by itself (placing
# -*- coding: utf-8 -*-
doesn't help). The setting of environment variable PYTHONUTF8=1 doesn't help too.To Reproduce
I am not able to provide code to reproduce the issue, it arises when calling Python via User-Defined Transform in SAP BODS
Please check: apache/superset#15631
This could be the same problem: https://stackoverflow.com/questions/68594538/syntaxerror-non-ascii-character-xd1-in-file-charset-normalizer-init-py-i
Expected behavior
No error - with requests version using chardet library there is no problem. Maybe avoiding non-ASCII characters in init.py could help...?
Logs
Please see the bug description.
Desktop (please complete the following information):
Additional context
N/A
The text was updated successfully, but these errors were encountered: