FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Detect the size of wchar_t (aka Runtime.UCS) at runtime using PyUnicode_GetMax by lostmsu · Pull Request #1298 · pythonnet/pythonnet · GitHub

Detect the size of wchar_t (aka Runtime.UCS) at runtime using PyUnicode_GetMax - #1298

Merged
lostmsu merged 1 commit into
pythonnet:masterfrom
losttech:features/RuntimeUcsSize
Nov 30, 2020
Merged

Detect the size of wchar_t (aka Runtime.UCS) at runtime using PyUnicode_GetMax#1298
lostmsu merged 1 commit into
pythonnet:masterfrom
losttech:features/RuntimeUcsSize

Conversation

lostmsu commented Nov 30, 2020

Copy link
Copy Markdown
Member

What does this implement/fix? Explain your changes.

This determines the value for Runtime.UCS at runtime instead of using compile-time defines, removing the need for separate builds of Python.Runtime.

Does this close any currently open issues?

N/A

Any other comments?

PyUnicode_GetMax is deprecated, but preserved for compatibility.

Checklist

Check all those that are applicable and complete.

  • Make sure to include one or more tests for your change
  • If an enhancement PR, please create docs and at best an example
  • Add yourself to AUTHORS
  • Updated the CHANGELOG

lostmsu requested a review from filmor November 30, 2020 02:41

codecov-io commented Nov 30, 2020
edited
Loading

Copy link
Copy Markdown

Codecov Report

Merging #1298 (4d43b54) into master (182faed) will decrease coverage by 0.08%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #1298      +/-   ##
==========================================
- Coverage   87.97%   87.88%   -0.09%     
==========================================
  Files           1        1              
  Lines         291      289       -2     
==========================================
- Hits          256      254       -2     
  Misses         35       35              
Flag Coverage Δ
setup_linux 65.05% <ø> (-0.25%) ⬇️
setup_windows 74.04% <ø> (-0.18%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
setup.py 87.88% <ø> (-0.09%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 182faed...4d43b54. Read the comment docs.

Copy link
Copy Markdown

This could possibly solve #114.

filmor commented Nov 30, 2020

Copy link
Copy Markdown
Member

Great, I wasn't aware of PyUnicode_GetMax. We should probably find a more sustainable solution at some point (as the function is explicitly deprecated), but this will do nicely for now :)

lostmsu merged commit 67c6d11 into pythonnet:master Nov 30, 2020
lostmsu deleted the features/RuntimeUcsSize branch November 30, 2020 17:50

sekkit commented Oct 10, 2021

Copy link
Copy Markdown

ctypes.sizeof(ctypes.c_wchar) would do the trick

filmor commented Oct 10, 2021

Copy link
Copy Markdown
Member

@lostmsu It looks like the symbol is scheduled for removal for Python 3.10, I'll look into this s.t. we can start supporting 3.10 earlier than we could with 3.9 :)

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

5 participants


Back | FazBrowse Home | New Git URL