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

source code string cannot contain null bytes #6184

Open
codes-team opened this issue May 6, 2024 · 2 comments
Open

source code string cannot contain null bytes #6184

codes-team opened this issue May 6, 2024 · 2 comments

Comments

@codes-team
Copy link

codes-team commented May 6, 2024

Describe the bug

Hello Sir, when i use cython to compile python code i found this issue

Traceback (most recent call last):
File "/data/data/com.termux/files/usr/bin/cythonize", line 5, in
from Cython.Build.Cythonize import main
File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/Cython/Build/init.py", line 1, in
from .Dependencies import cythonize
File "/data/data/com.termux/files/usr/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 3, in
import cython
SyntaxError: source code string cannot contain null bytes

I have had this problem for a long time, but I wanted to search for a solution on the Internet first before bothering you with my small problem but i don't found any sultion i try install old versions from cython but i got the same issue

"""i have this issue in phone so i don't know if this is cause of the problem"""

"""the compiled sources with cython work with me in phone but when i try compile it in phone i got this error"""

i hope you have nice day, and thanks so much for cython project it's perfect❤

Code to reproduce the behaviour:

# example code

Expected behaviour

No response

OS

Android aarch64

Python version

i use python 3.11.8

Cython version

i try cython 3.0.10

Additional context

No response

@da-woods
Copy link
Contributor

da-woods commented May 6, 2024

I don't know. This does seem more likely to be an issue with Termux than with Cython since we don't have this issue on other platforms. Maybe try to work out were the null byte is:

with open(filename) as f:
  contents = f.read().encode("utf-8")
print(contents.find(b"\0"))

But I'm not really sure what you do when you find out.

@codes-team
Copy link
Author

I don't know. This does seem more likely to be an issue with Termux than with Cython since we don't have this issue on other platforms. Maybe try to work out were the null byte is:

with open(filename) as f:
  contents = f.read().encode("utf-8")
print(contents.find(b"\0"))

But I'm not really sure what you do when you find out.

thank you so much i will try it

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

No branches or pull requests

2 participants