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

fix for #1143 #2695

Merged
merged 1 commit into from
Apr 11, 2025
Merged

fix for #1143 #2695

merged 1 commit into from
Apr 11, 2025

Conversation

wszak
Copy link

@wszak wszak commented Nov 15, 2024

replace strings with unicode for python3
fixes #1143

Copy link
Collaborator

@xrmx xrmx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Patch looks fine but could you please add the PYTHREE guards instead of removing py2 code?

+#ifdef PYTHREE
+                                       k = PyUnicode_FromStringAndSize(*e, (int)(p-*e));
+#else
                                        k = PyString_FromStringAndSize(*e, (int)(p-*e));
+#endif

Fixes the following stacktrace with the options enabled:

Traceback (most recent call last):
  File "/srv/knip/development/KnipKnap/lib/python3.4/os.py", line 637, in __setitem__
    key = self.encodekey(key)
  File "/srv/knip/development/KnipKnap/lib/python3.4/os.py", line 706, in encode
    raise TypeError("str expected, not %s" % type(value).__name__)
TypeError: str expected, not bytes
@xrmx xrmx merged commit f57eed9 into unbit:master Apr 11, 2025
23 checks passed
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.

Setting reload-os-env to True causes TypeError on python3.4
2 participants