Jeong Yunwon
93a7d59bbb
relocate wrongly placed sys test in snippets/stdlib_os.py
2021-11-16 01:23:53 +09:00
Steve Shi
742ea0c4fa
Reimpl Buffer Protocol and memoryview support ndarray with shape, stride and suboffset ( #3340 )
...
* Fix buffer protocol and memoryview
* Fix io and array the right way to use buffer protocol
* fix rebase
* fix memoryview and introduce VecBuffer
* fix deadlock
* fix memoryview avoid double release buffer
* impl ndim buffer support
* first implement nd array for buffer and memoryview
* fix slice adjust_indices
* fix adjust_indices introduct SaturatedSliceIterator
* fix memoryview cmp
* fix adjust_indices positive_order
* fix bug mark passed test
* fix clippy
* fix set_item_slice deadlock, optimize buffer
* Delete @test_113974_tmp
* Remove vec_buffer_type
* rusty names
* impl memoryview multi index
* add comments
Co-authored-by: Jeong YunWon <jeong@youknowone.org >
2021-11-13 07:17:11 +02:00
joohongpark
5ceb2be86e
fixed set.{__ror__, __sub__} operator to behave according to type
2021-11-11 16:11:48 +09:00
Noa
96a9d55a62
Merge pull request #3399 from RustPython/custom-signals
...
Allow sending custom signals to a vm
2021-11-10 14:25:06 -06:00
Jeong YunWon
31f619510f
Merge pull request #3425 from deantvv/os-getrandom
...
os: implement getrandom
2021-11-10 00:52:29 +09:00
Dean Li
b6f266d3b8
os: implement getrandom
2021-11-09 11:33:51 +00:00
Jeong YunWon
1681eb8c01
Merge pull request #3432 from DimitrisJim/enable_settime_macos
...
Enable `clock_settime` for macOS.
2021-11-09 17:34:11 +09:00
jfh
f4030ab1f6
Enable settime for macos.
2021-11-08 18:28:02 +02:00
Jeong YunWon
fddd072706
Merge pull request #3431 from DimitrisJim/freebsd_check
...
Add a check for freeBSD.
2021-11-09 01:09:55 +09:00
jfh
2de853435b
Add a check for freeBSD.
2021-11-08 17:08:43 +02:00
Jim Fasarakis-Hilliard
310578c422
Merge pull request #3426 from devnexen/netbsd_obsd_build_fix
...
netbsd/openbsd build fix
2021-11-07 15:46:23 +02:00
David Carlier
d6e89301a5
netbsd/openbsd build fix
2021-11-07 12:48:34 +00:00
Jeong YunWon
b80cec7798
Merge pull request #3423 from deantvv/os-waitstatus-to-exitcode
...
os: implement `os.waitstatus_to_exitcode`
2021-11-07 00:00:28 +09:00
Jeong YunWon
820a67cb7e
Merge pull request #3417 from moreal/as-mapping-str
...
Implement `AsMapping` for `PyStr`
2021-11-06 22:36:02 +09:00
Jim Fasarakis-Hilliard
7f1c5ec888
Merge pull request #3422 from devnexen/fbsd_build_fix
...
fix freebsd build wrong imports
2021-11-06 15:10:17 +02:00
Dean Li
bfe10aa448
test: update test_posix.py
2021-11-06 21:04:14 +08:00
Dean Li
de4c0363bd
test: update support.wait_process from py3.10
2021-11-06 21:04:13 +08:00
Dean Li
a762ce5426
os: implement waitstatus_to_exitcode
2021-11-06 21:04:13 +08:00
David Carlier
cf7b6eeec1
fix freebsd build wrong imports
2021-11-06 11:24:00 +00:00
Jim Fasarakis-Hilliard
625886f339
Merge pull request #3420 from zetwhite/pos_only_arg
...
fix error message for checking number of positional arguments
2021-11-06 12:10:57 +02:00
Jeong YunWon
d7f2e2e696
Merge pull request #3416 from deantvv/os-posix-spawn
...
os: fix posix_spawn exception
2021-11-06 18:53:29 +09:00
Jeong YunWon
98e3d26906
Use PyPathLike::into_cstring
2021-11-06 17:17:00 +09:00
zetwhite
0523a57195
fix error message for checking number of positional arguments
2021-11-06 17:00:20 +09:00
Moreal
276608233e
Implement AsMapping for PyStr
2021-11-06 15:46:41 +09:00
Dean Li
04821ce730
os: fix posix_spawn exception
2021-11-06 14:40:54 +08:00
Jeong YunWon
40fd9c2683
Merge pull request #3406 from DimitrisJim/clean_time
...
Clean up monotonic/perf_counter invocations.
2021-11-06 14:26:21 +09:00
Jeong YunWon
976ed1d5eb
Merge pull request #3412 from DimitrisJim/random_seed
...
Allow any object as an argument for random.seed
2021-11-06 14:24:22 +09:00
Jeong YunWon
8933c7bd1e
Merge pull request #3414 from DimitrisJim/operator_classes_cleanup
...
Clean up slots in operator.
2021-11-06 14:22:55 +09:00
Jim Fasarakis-Hilliard
2c2656dc7a
Raise value error on large precision values for float, int __format__ ( #3415 )
2021-11-05 21:15:49 +02:00
Daniel Watkins
14b4f0092f
cformat.rs: fix remaining test_format.test_common_format failures ( #3405 )
...
* cformat.rs: refactor fill_string to take fill_with_precision
This allows it to be used with both self.min_field_width and
self.precision, which is necessary for padding out %ds with precision.
* cformat.rs: zero-pad %d entries using precision
This matches CPython's behaviour.
* cformat.rs: don't left-adjust when filling with precision
That will always be prepending 0s to %d arguments, the LEFT_ADJUST flag
will be used by a later call to `fill_string` with the 0-filled string
as the `string` param.
* floats: handle alternate form of general formatting
* cformat.rs: convert width/precision to i32
In CPython, width can be isize but precision can only be i32. Our
implementation currently assumes the same type for both: as CPython's
tests assert on overflows for precision, but not for width, we use that
size for both.
* test_format: run test_common_format
Except for the line which raises an OverflowError in CPython, because
overflows in Rust (and therefore RustPython) abort the process
immediately.
* test_types: don't expect test_float_to_string to fail
Its string formatting usage now works as expected.
2021-11-05 12:06:58 +02:00
Jeong YunWon
c5250e2fe9
Merge pull request #3413 from DimitrisJim/remove_old_code
...
Remove slot_new for longrange_iterator.
2021-11-05 13:28:04 +09:00
jfh
a3daca0108
Clean up slots in operator.
2021-11-04 22:29:10 +02:00
jfh
a8a3cae61f
Remove slot_new for longrange_iterator.
2021-11-04 18:45:50 +02:00
jfh
05c4fcf934
Allow any object as an argument for random.seed
2021-11-04 18:34:20 +02:00
jfh
aa00fe9c64
Mark failing tests in test_random.
2021-11-04 15:12:32 +02:00
jfh
950a2cfad3
Add test_random from CPython 3.8.
2021-11-04 14:56:09 +02:00
Jeong YunWon
2309e59a72
Merge pull request #3404 from DimitrisJim/genericalias_no_kwargs
...
Disallow kwargs from genericalias `__new__`.
2021-11-04 19:16:36 +09:00
Jeong YunWon
95bb1a1ffb
Merge pull request #3409 from DimitrisJim/check_wasi
...
Add wasi check to ci.
2021-11-04 16:01:16 +09:00
jfh
25c7d82a86
Add wasi check to ci.
2021-11-04 01:21:24 +02:00
Jim Fasarakis-Hilliard
07a236f965
Merge pull request #3408 from coolreader18/fix-panic
...
Fix panic in debug mode
2021-11-03 21:57:53 +02:00
Noa
2c70bf26c3
Move the cfg(debug_assertions) inside the quote!}
2021-11-03 13:29:52 -05:00
Noa
f01a7b17c4
Upgrade nix
2021-11-03 13:28:41 -05:00
Jim Fasarakis-Hilliard
544fb5ffa6
Merge pull request #3407 from matthieugouel/fix_whats_left
...
fix `not_impl.py` path for black in `whats_left.sh`
2021-11-03 20:15:54 +02:00
matthieugouel
81a6927081
fix not_impl.py path for black
2021-11-03 17:57:48 +01:00
Jim Fasarakis-Hilliard
b69cfafad8
Merge pull request #3398 from deantvv/os-error-str-2
...
os: implement os-error-str according to CPython
2021-11-03 16:53:49 +02:00
Jim Fasarakis-Hilliard
9d95ad248b
Merge pull request #3396 from OddBloke/oddbloke/exception_module
...
correctly set __module__ and __name__ for builtin exceptions
2021-11-03 14:48:24 +02:00
jfh
cc3708816f
Clean up monotonic/perf_counter invocations.
2021-11-03 13:43:07 +02:00
jfh
ffd7e8cdb7
Disallow kwargs from genericalias new.
2021-11-03 13:35:28 +02:00
Dean Li
db212d80ff
os: implement os-error-str according to CPython
...
As was: "FileNotFoundError: [Errno 2] No such file or directory (os
error 2)"
To be: "FileNotFoundError: [Errno 2] No such file or directory (os
error 2): 'filename' -> 'filename2'"
Reference CPython implementation
```
if (self->filename) {
if (self->filename2) {
return PyUnicode_FromFormat("[Errno %S] %S: %R -> %R",
OR_NONE(self->myerrno),
OR_NONE(self->strerror),
self->filename,
self->filename2);
} else {
return PyUnicode_FromFormat("[Errno %S] %S: %R",
OR_NONE(self->myerrno),
OR_NONE(self->strerror),
self->filename);
}
}
if (self->myerrno && self->strerror)
return PyUnicode_FromFormat("[Errno %S] %S",
self->myerrno, self->strerror);
```
2021-11-03 17:30:28 +08:00
Daniel Watkins
42186caade
extra_tests: test stdlib exception __module__/__name__
2021-11-02 18:28:02 -04:00