Commit Graph

2688 Commits

Author SHA1 Message Date
Gyubong
38affeaed1 Add expectedFailure to test_warnings 2022-10-05 08:04:48 +09:00
Gyubong
706398c4c8 Update unittest/runner.py from CPython v3.12.0a0 2022-10-05 07:13:25 +09:00
Jeong YunWon
54d7c34668 Merge pull request #4194 from dvermd/oserror_attributes
Fill OSError attributes
2022-10-04 22:55:12 +09:00
dvermd
a18bad2ca3 Fill OSError attributes 2022-10-04 13:34:09 +02:00
Jeong YunWon
bd696b5369 Merge pull request #4199 from jopemachine/fix-harmonic_mean
Fix `int.inner_truediv`
2022-10-04 20:03:50 +09:00
Gyubong
773066f2dd Remove expectedFailure 2022-10-04 17:28:00 +09:00
Jeong YunWon
46ff23977e Merge pull request #4177 from jopemachine/add-co-names
Add `co_names` to `PyCode`
2022-10-04 17:03:17 +09:00
Gyubong
01aad3cf4e Remove expectedFailure from test_dataclass_no_repr 2022-10-04 13:01:29 +09:00
Gyubong
7b106634a3 Update test_pprint.py from CPython v3.12.0a0 2022-10-04 12:15:04 +09:00
Gyubong
b0f620cd12 Update pprint.py from CPython v3.12.0a0 2022-10-04 12:14:53 +09:00
Gyubong
a6c07bc58f Update test_code.py from CPython v3.12.0a0 2022-10-04 10:55:13 +09:00
Gyubong
44501f5ebf Restore YIELD_FROM def_op 2022-10-04 10:53:57 +09:00
Gyubong
33e1007d7c Update opcode.py from CPython v3.12.0a0 2022-10-04 10:47:30 +09:00
Jeong YunWon
fab53f0391 Merge pull request #4187 from dvermd/structseq_matchargs
match args without n_*_fields
2022-10-03 12:08:40 +09:00
dvermd
7f86178a46 match args without n_*_fields 2022-10-02 17:01:16 +02:00
Jeong YunWon
e56950abb3 Merge pull request #4190 from dvermd/takewhile_reduce
add takewhile.__reduce__
2022-10-02 16:17:37 +09:00
Jeong YunWon
02e013198f Merge pull request #4154 from jopemachine/add-utc-alias
Add `datetime.UTC` alias for `datetime.timezone.utc`
2022-10-02 16:17:13 +09:00
Gyubong
11a6b73fbf Fix hash's error message when hash method is None (#4161) 2022-10-01 22:46:14 +09:00
dvermd
164e343517 add takewhile.__reduce__ 2022-10-01 15:31:03 +02:00
Jeong YunWon
fcbb388918 Merge pull request #4168 from jopemachine/fix-testisinstance
Fix `test_infinite_recursion_via_bases_tuple`, `test_infinite_cycle_in_bases`
2022-09-19 16:58:57 +09:00
Moreal
27855a6ab1 Unmark resolved tests 2022-09-18 06:49:37 +09:00
Gyubong
e9d3406f9c Fix test_infinite_recursion_via_bases_tuple, test_infinite_cycle_in_bases 2022-09-17 13:06:10 +09:00
Gyubong
e372be1b1b Fix bool_eq argument order of _membership_iter_search for compatability with cpython 2022-09-13 21:45:26 +09:00
Jeong YunWon
368e47cddb Merge pull request #4151 from jopemachine/add-cbrt
Add `math.cbrt` implemented in cpython 3.11
2022-09-12 13:55:56 +09:00
Jeong YunWon
7ab1b16b41 Merge pull request #4153 from jopemachine/add-call-operator
Add `operator.call`
2022-09-12 13:55:34 +09:00
Gyubong
e0f491ea8c Fix edge case of math.pow(0.0, -inf), math.pow(-0.0, -inf) 2022-09-12 12:45:56 +09:00
Gyubong
96fc308c04 Add math.cbrt
Update math.rs
2022-09-12 12:39:53 +09:00
Gyubong
ea4f2e7bac Update test_math.py from CPython v3.12.0a0 2022-09-11 11:16:11 +09:00
Gyubong
927208c7f6 Update test_operator.py from CPython v3.12.0a0 2022-09-10 18:27:31 +09:00
Gyubong
339de8c809 Add missing call operator to __all__ 2022-09-10 18:26:33 +09:00
Gyubong
5570ad497e Add UTC alias 2022-09-09 11:51:36 +09:00
Gyubong
d95b3c2761 Add opeator.call, such that operator.call(obj, *args, **kwargs) == obj(*args, **kwargs) 2022-09-09 11:21:19 +09:00
Gyubong
1933e5f56e Add math.exp2 2022-09-08 17:00:42 +09:00
Richard Hozák
31fdb204d8 Allow fcntl functions to accept objects with fileno() function (#4144)
As specified in Python official documentation
(https://docs.python.org/3.10/library/fcntl.html)

> All functions in this module take a file descriptor fd as their first
> argument. This can be an integer file descriptor, such as returned by
> sys.stdin.fileno(), or an io.IOBase object, such as sys.stdin itself,
> which provides a fileno() that returns a genuine file descriptor.

And clarified more in fcntl.fcntl function:

> Perform the operation cmd on file descriptor fd (file objects
> providing a fileno() method are accepted as well).

All function in fcntl modules should accept either int fd or object with
fileno() function which returns int fd.

This was already implemented with for `fcntl.fcntl` function with
`io::Fildes` newtype helper which extracted either int fd or called
fileno() function, and it was also implemented with duplicated ad-hoc
code for `fcntl.ioctl`.

This commit replaces the ad-hoc implementation with `io::Fildes` and
adds it to missing functions: `fcntl.flock` and `fcntl.lockf`.

For more information that this is implemented in the same way as
CPython, you can check the corresponding CPython module:
https://github.com/python/cpython/blob/3.10/Modules/clinic/fcntlmodule.c.h

The functions are: `fcntl_fcntl`, `fcntl_ioctl`, `fcntl_flock` and
`fcntl_lockf`, all of these functions use
`_PyLong_FileDescriptor_Converter` which does the same thing as
RustPython's `io::Fildes`, meaning it either extracts the argument as
int fd or calls fileno() function on passed object that returns the int
fd.

Here is the implementation for `_PyLong_FileDescriptor_Converter`:
https://github.com/python/cpython/blob/3.10/Objects/fileobject.c#L227
which in turns calls `PyObject_AsFileDescriptor` which is located here
https://github.com/python/cpython/blob/3.10/Objects/fileobject.c#L180 in
the same file and we can see that it tries to convert it to int or call
fileno() function.

Note regarding the python unit tests `test_flock`,
`test_lockf_exclusive`, `test_lockf_shared`:

The tests no longer fail with `TypeError: 'BufferedRandom' object cannot
be interpreted as an integer` which makes `test_flock` pass the test,
but `test_lockf_exclusive` and `test_lockf_exclusive` still fail but not
on fcntl calls, they fail on `Process()` constructor with
`AttributeError: module 'os' has no attribute 'fork'` which seems
unrelated with this change.

This unrelated error was probably never detected as fcntl calls failed
earlier, before `Process()` could even be called.
2022-09-02 02:39:02 +09:00
tgsong827
3e10f52dec mark failing test from test_ioctl 2022-08-30 10:06:46 +09:00
tgsong827
de26d1e3bf Add test_ioctl from CPython 3.10.6 2022-08-30 10:05:58 +09:00
Lee Dogeon
4ccdc19208 Implement __slots__ with member_descriptor (#4106) 2022-08-25 02:11:23 +09:00
Gyubong
e9970edd77 Add built-in breakpoint function (#4122) 2022-08-23 21:45:01 +09:00
CPython Developers
a098b660f8 crlf -> lf 2022-08-23 20:38:48 +09:00
Jeong YunWon
ac1be9e2a4 Fix whats_left 2022-08-23 20:37:24 +09:00
Jeong YunWon
bd4b1a13db Merge pull request #3921 from youknowone/update-threading
Update thread/threading/concurrent from CPython 3.10.5
2022-08-23 15:55:00 +09:00
Jeong YunWon
413a668582 Mark failing tests from test_threading 2022-08-23 15:54:42 +09:00
Jeong YunWon
55061c7b6a new_syntax_error working without full compiler
Fix #4100
2022-08-23 05:08:24 +09:00
CPython developers
c932ad8752 Update concurrent from CPython 3.10.5 2022-08-23 04:46:08 +09:00
CPython developers
a1548e20f5 Update thread/threading from CPython 3.10.5 2022-08-23 04:46:07 +09:00
Jeong Yunwon
5583e36067 httpservers only support lf line-end in RustPython 2022-08-21 23:18:25 +09:00
Jeong YunWon
9a535bdd32 adjust failing markers for httplib 2022-08-21 15:23:51 +09:00
Jeong YunWon
c1a40614b2 remove failng markers from test_urllib 2022-08-21 15:23:51 +09:00
CPython developers
6fdc51e3b7 Update http from CPython 3.10.5 2022-08-21 15:23:51 +09:00
Karatus
c334626f3c Feature: sys.orig_argv (#4048) 2022-08-20 22:58:58 +09:00