Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
ce7c135
add tests for C API `codecs`
picnixz Aug 26, 2024
f9e350a
add Python tests for `_codecs`
picnixz Aug 26, 2024
15b6811
fix size bug
picnixz Aug 26, 2024
8048ae1
rename test class
picnixz Aug 26, 2024
8487b46
Revert "fix size bug"
picnixz Sep 25, 2024
2dbe09a
Merge branch 'main' into test/c-api-codec-111495
picnixz Sep 25, 2024
0097f2a
Disable tests that are known to crash.
picnixz Sep 25, 2024
303b13c
address Victor's review
picnixz Sep 25, 2024
4f474dd
update tests to reflect user errors
picnixz Sep 25, 2024
d49743c
Merge remote-tracking branch 'upstream/main' into test/c-api-codec-11…
picnixz Sep 27, 2024
87ee0d2
fix C API codec tests
picnixz Sep 27, 2024
6a36eb0
small hack to make the test suite correct
picnixz Sep 27, 2024
145b285
remove un-necessary imports
picnixz Sep 28, 2024
dc9af16
Merge remote-tracking branch 'upstream/main' into test/c-api-codec-11…
picnixz Sep 29, 2024
7be1f55
use `_codecs._unregister_error` to cleanup test state
picnixz Sep 29, 2024
f72be5c
indicate some semantics for NULL case being tested
picnixz Sep 29, 2024
4d02c6c
revert a cosmetic change
picnixz Sep 29, 2024
0f26ca7
Move `PyCodec_NameReplaceErrors` test to the `_testlimitedcapi` module
picnixz Sep 29, 2024
1399779
add comment for why we do not test `_PyCodec_UnregisterError`
picnixz Sep 29, 2024
914151e
update a comment
picnixz Sep 29, 2024
8dd7e8d
revert one cosmetic change
picnixz Sep 29, 2024
1e6a5ce
Fix Windows compilation
picnixz Sep 29, 2024
2ba5f03
address Victor's review
picnixz Sep 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert "fix size bug"
This reverts commit 15b6811.
  • Loading branch information
picnixz committed Sep 25, 2024
commit 8487b4630cb51a07ceb16569446733b1947df05f
4 changes: 2 additions & 2 deletions Objects/exceptions.c
Original file line number Diff line number Diff line change
Expand Up @@ -2751,7 +2751,7 @@ PyUnicodeEncodeError_GetStart(PyObject *exc, Py_ssize_t *start)
if (*start<0)
*start = 0; /*XXX check for values <0*/
if (*start>=size)
*start = size ? size-1 : 0;
*start = size-1;
Py_DECREF(obj);
return 0;
}
Expand All @@ -2769,7 +2769,7 @@ PyUnicodeDecodeError_GetStart(PyObject *exc, Py_ssize_t *start)
if (*start<0)
*start = 0;
if (*start>=size)
*start = size ? size-1 : 0;
*start = size-1;
Py_DECREF(obj);
return 0;
}
Expand Down