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 Unicode support for PyPy #4145

Merged
merged 2 commits into from Nov 24, 2019
Merged

Fix Unicode support for PyPy #4145

merged 2 commits into from Nov 24, 2019

Conversation

nulano
Copy link
Contributor

@nulano nulano commented Oct 16, 2019

Depends on #4109.

Reinstates #3780 changes reverted by #3935 for PyPy 7.2.0+.

This change also fixes Raqm support on PyPy (from #4084 (comment)).

There is a bug in PyPy that causes a failure of the test for #3777 when using Raqm, reported here: https://bitbucket.org/pypy/pypy/issues/3095/pyunicode_asucs4copy-fails-with-extended

@@ -375,7 +351,7 @@ text_layout_raqm(PyObject* string, FontObject* self, const char* dir, PyObject *
goto failed;
}

#if (PY_VERSION_HEX < 0x03030000) || (defined(PYPY_VERSION_NUM))
#if (defined(PYPY_VERSION_NUM) && (PYPY_VERSION_NUM < 0x07020000))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added a compile time PyPy version check here, to be removed in the future. What is Pillow's policy on supporting old versions of PyPy?

Aside: This fallback code fails on Windows anyway (due to the cast in the p_raqm.set_text call), see #4084 (comment).

Copy link
Member

Choose a reason for hiding this comment

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

For CPython we support the same versions as they do.

For PyPy, we generally only test the latest version, so maybe that too? If it's trivial to support older ones, we could do so, but I'm not sure of the value in testing many old versions.

Does the PyPy project have a policy on which PyPy versions they support?

(PyPy plan to support Python 2.7 "forever" http://doc.pypy.org/en/latest/faq.html#how-long-will-pypy-support-python2, but we won't support PyPy Python 2.7 after 2020-01-01.)

@nulano nulano force-pushed the ucs4-pypy branch 2 times, most recently from 5fd68e5 to 944753d Compare November 8, 2019 15:30
@hugovk hugovk added the Blocked Blocked by another issue (say which one) label Nov 20, 2019
Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

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

Blocked by #4109, good to merge once that is merged, and merge conflicts resolved here. (May as well wait until that one is merged before resolving, otherwise it'll just conflict again soon.)

@hugovk hugovk removed the Blocked Blocked by another issue (say which one) label Nov 20, 2019
@hugovk
Copy link
Member

hugovk commented Nov 20, 2019

#4109 is merged, this is no longer blocked.

@nulano
Copy link
Contributor Author

nulano commented Nov 20, 2019

Rebased.

@hugovk hugovk merged commit 37be3b0 into python-pillow:master Nov 24, 2019
@hugovk
Copy link
Member

hugovk commented Nov 24, 2019

Thanks!

@nulano nulano deleted the ucs4-pypy branch December 9, 2019 13:51
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.

None yet

2 participants