AssertionError: assert encoding is not None
See original GitHub issueNuitka version, full Python version, flavor, OS, etc. as output by this
command (it does more than you think, and we are adding more all the time):
python -m nuitka --version
0.7.6
Commercial: None
Python: 3.8.12 (default, Oct 12 2021, 13:49:34)
Flavor: Anaconda Python
Executable: /root/miniconda3/envs/py38/bin/python
OS: Linux
Arch: x86_64
Distribution: Ubuntu (based on Debian) 20.04.1
How did you install Nuitka and Python
I used pip install nuitka
installed Nuitka.
- Iβm sure I install nuitka succeed
- I use nuitka on Windows10 by wsl.
What error did I get?
I had a sanic server codes. And I used this command to generate *.bin file: python3 -m nuitka --follow-imports --plugin-enable=pylint-warnings -o ./server.bin --remove-output --show-scons --static-libpython=no cx_api_server/server.py
Then, I got this error:
...
Nuitka-Plugins:INFO: implicit-imports: Implicit dependencies of module 'pkg_resources._vendor.packaging' added 'pkg_resources._vendor.packaging.version,pkg_resources._vendor.packaging.specifiers,pkg_resources._vendor.packaging.requirements'.
PASS 1: 97%|ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | 579/597, sanic.response
...
...
...
Problem with statement at /root/miniconda3/envs/py38/lib/python3.8/site-packages/sanic/response.py:37:
-> class BaseHTTPResponse:
Nuitka:INFO: Interrupted while working on '<Node 'COMPILED_PYTHON_MODULE' with {'filename': '/root/miniconda3/envs/py38/lib/python3.8/site-packages/sanic/response.py', 'module_name': <ModuleName sanic.response>, 'code_flags': ''}>'.
PASS 1: 97%|ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | 579/597, sanic.response
...
...
File "/root/miniconda3/envs/py38/lib/python3.8/site-packages/nuitka/specs/BuiltinParameterSpecs.py", line 679, in extractBuiltinArgs
result = builtin_class(*args_list, source_ref=node.getSourceReference())
File "/root/miniconda3/envs/py38/lib/python3.8/site-packages/nuitka/nodes/AttributeNodesGenerated.py", line 604, in wrapExpressionStrOperationEncode
return ExpressionStrOperationEncode3(
File "/root/miniconda3/envs/py38/lib/python3.8/site-packages/nuitka/nodes/StrNodes.py", line 1404, in __init__
assert encoding is not None
AssertionError
Issue Analytics
- State:
- Created a year ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
How to resolve AssertionError for converting string characters ...
The assert is checking that compress('') return bytes. It doesn't, it returns output which is a str . Output needs to be encoded...
Read more >Asserting Expectations - The Debugging Book
In C and C++, defining the preprocessor variable NDEBUG ("no debug") turns off assertions, replacing them with a statement that does nothing.
Read more >Errors | Node.js v19.3.0 Documentation
AssertionError s are a special class of error that can be triggered when Node.js detects an exceptional logic violation that should never occur....
Read more >Getting error "g_utf8_collate: assertion 'str1 != NULL' failed ...
NULL ' failed. The problem is not reproducible with the utf8 encoding. It is not showing those messages with other language(en_US.
Read more >Python's assert: Debug and Test Your Code Like a Pro
In this tutorial, you'll learn how to use Python's assert statement ... AssertionError >>> assert null is None >>> assert null is not...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is now on develop and will be in 0.8 release. I actually found another similar bug for
str.split
andstr.rsplit
when enhancing the test to cover terminal keyword arguments.Part of 0.8 release that I just made.