Jiseok CHOI
1e6da5f430
sqlite: Align Connection.__call__ error handling with CPython ( #6042 )
2025-07-30 14:05:17 +09:00
Jeong, YunWon
cee579e7ea
Merge pull request #6047 from youknowone/wtf8
2025-07-30 12:45:03 +09:00
Shahar Naveh
4bf32a04f4
Apply some clipy lints ( #6045 )
2025-07-30 12:16:02 +09:00
Jeong YunWon
d46c882347
remove try_to_str
...
Rewrite sqlite3 UTF8 validation
2025-07-30 12:14:47 +09:00
Jiseok CHOI
d8f1d188c3
stdlib(sqlite): Raise ProgrammingError in closed Blob context manager ( #6041 )
2025-07-27 21:47:05 +09:00
Jiseok CHOI
38ca076cb5
feat(stdlib/sqlite): Implement slice assignment for Blob ( #6039 )
2025-07-27 10:43:11 +09:00
Jack O'Connor
4079776c36
Add kde function and tests to RustPython statistics module ( #6030 )
...
* Copy CPython 3.13 statistics module into RustPython
* Adjust CPython "magic constants" in KDE tests
## test_kde
I'm not too sure why but this one takes a few seconds to run the second
for loop which calculates the cumulative distribution and does a rough
calculation of the area under the curve.
## test_kde_random
I have a lower bound for RustPython to sort a random list of 1_000_000
numbers on my laptop of > 1 hour. By dropping n to 30_000 sort will not
take an egregious amount of time to run. It is then necessary to lower
the tolerance for the math.isclose check, or the computed values may
**randomly** fail due to the higher variance caused by the smaller
sample size.
* Reintroduce expected failure in test_statistics.TestNormalDict.test_slots
* Sync Rust `normal_dist_inv_cdf` with Python equivalent
See https://github.com/python/cpython/pull/95265 .
To quote:
> Restores alignment with random.gauss(mu, sigma) and
random.normalvariate(mu, sigma) both. of which are equivalent to
sampling from NormalDist(mu, sigma).inv_cdf(random()). The two functions
in the random module happy accept sigma=0 and give a well-defined
result.
> This also lets the function gently handle a sigma getting smaller,
eventually becoming zero. As sigma decrease, NormalDist(mu,
sigma).inv_cdf(p) forms a tighter and tighter internal around mu and
becoming exactly mu in the limit. For example, NormalDist(100,
1E-300).inv_cdf(0.3) cleanly evaluates to 100.0but withsigma=1e-500``
the function previously would raised an unexpected error.
2025-07-26 00:42:22 +09:00
Shahar Naveh
c232b7f1f8
Update csv.py from 3.13.5 ( #6035 )
...
* Use `raise_if_stop!` macro
* Update `csv.py` from 3.13.5
* Mark failing tests
2025-07-25 19:08:01 +09:00
Jiseok CHOI
fb9147736d
stdlib(sqlite3): Raise ProgrammingError for missing named parameter ( #6036 )
2025-07-25 19:02:56 +09:00
Shahar Naveh
01edb93957
Resolve libc::RLIM_NLIMITS warning on android ( #6025 )
...
* Resolve warning on android
* Apply CodeRabbit suggestion
2025-07-25 10:46:32 +09:00
Jiseok CHOI
bcf56279ec
Raise UnicodeEncodeError for surrogates in sqlite.executescript ( #6024 )
2025-07-25 10:45:33 +09:00
Jiseok CHOI
57bdf35ee6
Enforce valid UTF-8 encoding for sqlite collation names ( #6015 )
...
* Make public `PyStr::ensure_valid_utf8`
* Enforce valid UTF-8 encoding for sqlite collation names
2025-07-21 23:42:47 +09:00
Jiseok CHOI
bbe98ddd86
Construct detailed message on text decode failure ( #6014 )
2025-07-21 22:33:09 +09:00
Jiseok CHOI
6f80ac0edd
Align SQL comment parsing with CPython ( #5996 )
2025-07-20 10:51:42 +09:00
Jiseok CHOI
f8d03fd680
Correctly implement isolation_level setter to handle deletion ( #5983 )
2025-07-18 23:08:51 +09:00
Jeong, YunWon
6a3dff63bb
Downcastable ( #5986 )
...
* simplify int power
* downcastasble
* deprecate payload*
2025-07-16 18:00:18 +09:00
Jiseok CHOI
5957f5d31a
Fix off-by-one error in SQL length limit check ( #5982 )
2025-07-16 01:53:20 +09:00
Jiseok CHOI
f465af3a7c
Reject SQL queries containing null characters ( #5981 )
2025-07-16 01:52:28 +09:00
Jiseok CHOI
6d2152cafe
Correctly handle None for protocol in adapt(..) ( #5979 )
2025-07-16 01:49:53 +09:00
Jiseok CHOI
ed433837b3
Introduce PyUtf8Str and fix(sqlite): validate surrogates in SQL statements ( #5969 )
...
* fix(sqlite): validate surrogates in SQL statements
* Add `PyUtf8Str` wrapper for safe conversion
2025-07-15 00:54:42 +09:00
Jiseok CHOI
5ab64b7002
fix(sqlite): align adaptation protocol with CPython ( #5964 )
2025-07-14 14:22:52 +09:00
Jiseok CHOI
d42e8f0042
fix(sqlite): produce correct error for surrogate characters ( #5962 )
2025-07-14 14:21:36 +09:00
Jiseok CHOI
3a6a766a03
fix(sqlite): implement PARSE_COLNAMES column name parsing ( #5923 )
2025-07-10 00:18:40 +09:00
Jiseok CHOI
e6fdef43dc
fix(sqlite): autocommit mode transaction handling to match CPython ( #5918 )
2025-07-09 20:13:26 +09:00
Jiseok CHOI
341341520e
Fix SQLite large integer overflow error handling ( #5916 )
2025-07-09 17:14:45 +09:00
Shahar Naveh
694fe50241
Use const fn where possible ( #5894 )
2025-07-04 22:26:20 +09:00
Shahar Naveh
4bd328906e
Update resource from 3.13.5 ( #5893 )
2025-07-04 10:09:06 +09:00
Shahar Naveh
69545c0798
Use Self where possible ( #5892 )
2025-07-04 10:08:43 +09:00
Jeong, YunWon
d40cbbb451
Fix cspell warning ( #5890 )
...
* Fix cspell warning
* cspell: -> spell-checker:
2025-07-03 12:04:43 +09:00
Jeong, YunWon
fffa735868
__class_getitem__ ( #5888 )
2025-07-03 11:01:53 +09:00
Jeong, YunWon
07a04acfaa
Allow heap getset creation ( #5854 )
...
* Update _threading_local.py
* allow heap-getset
2025-06-29 03:03:19 +09:00
Shahar Naveh
8cac4335b4
Constify functions & General nitpicks ( #5858 )
...
* General cleanups
* Add some newlines
* Use bitlag match
* More constify
* Don't convert to str twice
* constify more
* Use match directly instead of if & match!
* Constify more
* Constify more
* more consts
* Constify more
* Constify more
* Don't use bitflags_match macro
2025-06-28 23:08:30 +09:00
Jeong YunWon
3673372d3d
Fix cspell warnings
2025-06-27 12:32:59 +09:00
Jeong YunWon
993ea8923c
Rename members
2025-06-27 12:32:59 +09:00
Jeong, YunWon
fe2c9bf361
Fix stable clippy ( #5843 )
2025-06-27 12:12:21 +09:00
Shahar Naveh
1ae07813ee
Remove redundent to_owned() and to_string() calls ( #5836 )
...
* Remove redundent String conversion for errors
* cargo fmt
2025-06-25 23:42:26 +09:00
Shahar Naveh
ab09de8542
Remove unnecessary string conversions in error message construction ( #5826 )
...
* Make `new_X_error` recv `impl Into<String>`
* Maks the rest of the methods to be generic
* Remove `.to_owned()` from more files
2025-06-25 01:43:41 +09:00
Jeong, YunWon
6a992d4fa2
Add hashlib hasher repr ( #5833 )
2025-06-24 20:09:24 +09:00
Jeong, YunWon
0728da51fc
binascii.hexlify ( #5820 )
2025-06-23 08:59:36 +09:00
Jeong, YunWon
b1ecdf38b8
Fix bz2 pickle ( #5819 )
2025-06-23 08:55:59 +09:00
Jeong YunWon
4cdb8d18b7
unicodedata.is_mirrored
2025-06-22 21:32:12 +09:00
Jeong YunWon
c824016301
Fix UnpackIterator constructor
2025-06-22 18:11:30 +09:00
Jeong, YunWon
3a54105e2c
Fix struct tests ( #5813 )
2025-06-22 09:58:43 +09:00
Jeong YunWon
2c61a12bed
Apply coderabbit reviews
2025-06-15 16:03:46 +09:00
Jeong YunWon
f560b4cbfb
Fix nightly clippy warnings
2025-06-15 16:03:46 +09:00
Ashwin Naren
df380bca96
lzma FORMAT_ALONE implementation ( #5777 )
...
* implement init_alone
* error if format is raw and there is a memlimit
2025-05-09 13:26:28 +09:00
Rex Ledesma
908386091b
feat: implement zlib.__version__
2025-05-08 14:48:11 +09:00
Jeong YunWon
d9c18c5593
flatten compression modules
2025-05-07 15:42:31 +09:00
Ashwin Naren
a5016446f4
_lzma implementation and test marking
...
Signed-off-by: Ashwin Naren <arihant2math@gmail.com >
2025-05-07 15:01:23 +09:00
Ashwin Naren
2a1ea45659
add _lzma module with new dependency
...
Signed-off-by: Ashwin Naren <arihant2math@gmail.com >
2025-05-07 15:01:23 +09:00