| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
|
Aha, 2 tests failed on the CI: test_multibytecodec and test_sax. |
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks for the PR. You are still missing a few places which need to be updated:
There may be more places. I have only searched for "codecs.open".
Sorry, something went wrong.
|
When you're done making the requested changes, leave the comment: I have made the requested changes; please review again. |
Sorry, something went wrong.
|
Tests fail on Windows: ERROR: test_code_page_decode_flags (test.test_codecs.CodePageTest.test_code_page_decode_flags)
----------------------------------------------------------------------
Traceback (most recent call last):
File "D:\a\cpython\cpython\Lib\test\test_codecs.py", line 3466, in test_code_page_decode_flags
if is_code_page_present(cp):
~~~~~~~~~~~~~~~~~~~~^^^^
File "D:\a\cpython\cpython\Lib\test\test_codecs.py", line 44, in is_code_page_present
class CPINFOEXW(ctypes.Structure):
^^^^^^
NameError: name 'ctypes' is not defined. Did you mean: 'type'? Or did you forget to import 'ctypes'?
|
Sorry, something went wrong.
|
To fix test_codecs on Windows, you can apply this change for example: diff --git a/Lib/test/test_codecs.py b/Lib/test/test_codecs.py
index a35de8ad87c..28039ae6cdd 100644
--- a/Lib/test/test_codecs.py
+++ b/Lib/test/test_codecs.py
@@ -35,13 +35,13 @@ def check(input, expect):
# On small versions of Windows like Windows IoT or Windows Nano Server not all codepages are present
def is_code_page_present(cp):
- from ctypes import POINTER, WINFUNCTYPE, WinDLL
+ from ctypes import POINTER, WINFUNCTYPE, WinDLL, Structure
from ctypes.wintypes import BOOL, BYTE, WCHAR, UINT, DWORD
MAX_LEADBYTES = 12 # 5 ranges, 2 bytes ea., 0 term.
MAX_DEFAULTCHAR = 2 # single or double byte
MAX_PATH = 260
- class CPINFOEXW(ctypes.Structure):
+ class CPINFOEXW(Structure):
_fields_ = [("MaxCharSize", UINT),
("DefaultChar", BYTE*MAX_DEFAULTCHAR),
("LeadByte", BYTE*MAX_LEADBYTES),
|
Sorry, something went wrong.
|
Please could you also list it in https://github.com/python/cpython/blob/main/Doc/deprecations/pending-removal-in-future.rst ? |
Sorry, something went wrong.
|
I have made the requested changes; please review again |
Sorry, something went wrong.
|
Thanks for making the requested changes! @vstinner, @malemburg: please review the changes made to this pull request. |
Sorry, something went wrong.
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
Co-authored-by: Victor Stinner <vstinner@python.org>
|
Nicely done, thank you. |
Sorry, something went wrong.
Looks good now. Thanks. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
📚 Documentation preview 📚: https://cpython-previews--133038.org.readthedocs.build/