Commit Graph

1996 Commits

Author SHA1 Message Date
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
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
Jim Fasarakis-Hilliard
612e943c6c Merge pull request #3394 from Snowapril/fix-ga-param-chaining
Fix `GenericAlias` parameter chaining
2021-11-02 23:37:38 +02:00
Jeong YunWon
d78347e7ea Merge pull request #3390 from OddBloke/oddbloke/format
cformat.rs: fixes to get two test_format.py tests passing
2021-11-02 18:10:08 +09:00
Jeong YunWon
1092f94a75 Merge pull request #3377 from fanninpm/fix-test-posixpath
Fix error and unexpected success in test_posixpath
2021-11-02 18:05:52 +09:00
Jeong YunWon
7b99d13f60 Merge pull request #3050 from RustPython/upd-deps
Run cargo update + upgrade
2021-11-02 17:58:02 +09:00
Noa
5b780e70e6 Skip panicking test 2021-11-01 20:43:46 -05:00
Daniel Watkins
c5eba15370 test_format: run test_bytes_and_bytearray_format
All the errors have now been addressed.
2021-11-01 21:34:51 -04:00
Daniel Watkins
380653b6cb cformat.rs: implement %a correctly, using builtins::ascii
The repr() of Unicode strings is the Unicode string, so the previous
code was incorrect for that case (at least).
2021-11-01 21:34:51 -04:00
Padraic Fanning
1c6851a631 Skip entire test case 2021-11-01 19:40:19 -04:00
snowapril
e2142e1d07 Remove skip decorator on window test
Signed-off-by: snowapril <sinjihng@gmail.com>
2021-11-01 15:20:55 +09:00
Daniel Watkins
156cf6bc86 stdlib/posix.rs: implement mknod 2021-10-31 09:04:56 -04:00
snowapril
73ccb565d0 remove decorators on success tests
Signed-off-by: snowapril <sinjihng@gmail.com>
2021-10-31 20:02:10 +09:00
Noa
588247c4a0 Unskip tests 2021-10-30 19:42:35 -05:00
Jeong YunWon
859744236e Merge pull request #3391 from deantvv/os-error-refactor
Refactor OSError
2021-10-30 22:40:10 +09:00
Dean Li
a59556ad25 Refactor OSError
Implement `raw_os_error_to_exc_type` to reduce duplication of errno to
exception type.
2021-10-30 17:05:54 +08:00
Jeong YunWon
2ac05aba66 Merge pull request #3381 from DimitrisJim/time_mod
Time mod additions
2021-10-30 15:42:10 +09:00
Daniel Watkins
1ea93a59d5 stdlib/io.rs: align negative-fd-from-opener exception with CPython 2021-10-28 15:05:55 -04:00
jfh
c6ac24c2f2 Clean up cfgs, handle 32bit timespec creation, skip tests for windows. 2021-10-28 21:42:40 +03:00
Jeong YunWon
35e56efa65 Merge pull request #3366 from zetwhite/dict_richcmp
Implements Comparable for PyDictKeys, PyDictItems
2021-10-28 00:41:14 +09:00
jfh
ee77f3c332 Add monotonic_ns, perf_counter, perf_counter_ns. 2021-10-27 11:54:58 +03:00
jfh
1817fd6565 Add get_clock_info. 2021-10-27 10:36:10 +03:00
Jeong YunWon
281e2ee4db Merge pull request #3378 from chrismoradi/update-collections-and-tests-from-cpython
Update collections from CPython, fix tests for UserDict/List/String
2021-10-27 02:35:06 +09:00
jfh
cab44a2ac3 Add clock_gettime, clock_settime, clock_getres. 2021-10-26 20:06:09 +03:00
Chris Moradi
6abfc3a00c Revert UserDict.__init__ changes, new passing test of UserList 2021-10-25 22:41:59 -07:00
Chris Moradi
ec247e0d4f Update collections from CPython, fix tests for UserDict/List/String
Clean implementation of changes in PR #3371 based on feedback.

Copies from [CPython tag `v3.9.7` and adds back custom RustPython changes where needed for:
- `Lib/collections/__init__.py`
- `Lib/test/test_collections.py`

Closes: #3371
2021-10-25 21:19:44 -07:00
Dean Li
6ec380369a os: fix test_putenv for all os 2021-10-25 19:40:32 +08:00
Tetramad
c88c69a993 Fix math.log1p to pass some failed tests
Now math.log1p with less than or equal to negative one should raise
ValueError with "math domain error" message
2021-10-25 14:44:13 +09:00
Tetramad
3d8f6cf08d Fix math.log to pass some failed tests
Now math.log with less than or equal to zero should raise ValueError
with "math domain error" message if `x` fit in f64
2021-10-25 14:44:08 +09:00
Tetramad
ba3cafc932 Fix math.atanh to pass failed tests
Now math.atanh with out of domain value should raise ValueError with
"math domain error" message
2021-10-25 10:45:11 +09:00
Jeong YunWon
b0795e89f7 Merge pull request #3370 from deantvv/test-posix-reason
test: posix update failure reason
2021-10-24 19:53:38 +09:00
Dean Li
46c38c09d2 test: posix update failure reason 2021-10-24 18:05:19 +08:00
Dean Li
91256a4ec6 posix: add rtld constants 2021-10-24 17:53:49 +08:00
zetwhite
a401d8c190 make work dictview compare test 2021-10-24 16:54:33 +09:00
Padraic Fanning
9fdd76c1dd Delete partial causing custom runner failure 2021-10-22 18:16:47 -04:00
Jim Fasarakis-Hilliard
7d1f75dd2f Merge pull request #3351 from Snowapril/fix-generic-alias
Add missing methods on `GenericAlias`
2021-10-22 16:32:18 +03:00
snowapril
92b81e5dd8 update some test in test_typing from cpython 3.10
Signed-off-by: snowapril <sinjihng@gmail.com>
2021-10-22 18:43:15 +09:00
snowapril
48d6ba154f add decorators on failed tests
Signed-off-by: snowapril <sinjihng@gmail.com>
2021-10-22 18:43:15 +09:00
snowapril
b2eff4ae53 add missing __class_getitem__ from cpython 3.10
Signed-off-by: snowapril <sinjihng@gmail.com>
2021-10-22 18:43:15 +09:00
snowapril
f491bb8fc4 commented out on missing module in rustpython
Signed-off-by: snowapril <sinjihng@gmail.com>
2021-10-22 18:43:15 +09:00
snowapril
4a3dab0b41 add test_genericalias.py from cpython 3.10
Signed-off-by: snowapril <sinjihng@gmail.com>
2021-10-22 18:43:15 +09:00
jfh
2299878395 Mark failing resourse tests. 2021-10-22 10:33:18 +03:00
jfh
9ab71fee02 Add test_resource from Python 3.8 2021-10-22 10:29:30 +03:00
jfh
103195b277 Remove Python gc stub, add rust stub. 2021-10-21 19:56:20 +03:00
Jeong YunWon
fd2ba5159e Merge pull request #3204 from fanninpm/cleanup-skipped-tests
Clean up some skipped tests
2021-10-21 02:39:15 +09:00
Jeong YunWon
82fac6ce53 Merge pull request #3263 from Snowapril/suggestion
Implement keyword suggestion on `PyAttributeError` and `PyNameError` from cpython 3.10
2021-10-21 02:30:46 +09:00
Jeong YunWon
5ce05fcca0 Merge pull request #3330 from deantvv/uid-gid-from-object
posix: handle case -1 for `Uid` and `Gid`
2021-10-21 01:43:52 +09:00
Jeong YunWon
946f4ecc89 Merge pull request #3334 from DimitrisJim/namespace_fixes
Namespace fixes
2021-10-21 01:35:04 +09:00
Jeong YunWon
a83ad7aa1c Merge pull request #3337 from deantvv/fix-os-putenv
os: fix putenv
2021-10-21 01:33:37 +09:00
Dean Li
c56db2fafa os: fix putenv
Check key and value before calling `env::set_var`

From doc of `env::set_var`,
```

This function may panic if `key` is empty, contains an ASCII equals sign
`'='` or the NUL character `'\0'`, or when the value contains the NUL
character.
```
2021-10-20 23:15:39 +08:00