Commit Graph

1816 Commits

Author SHA1 Message Date
Dean Li
ff87ad052d os: Fix openpty test
Make openpty return non-inheritable file descriptors
2021-06-08 19:09:18 +08:00
jfh
90da29f7c0 Address review comments. 2021-06-03 18:20:32 +03:00
jfh
1981f240ed Add documentation for functions. 2021-05-30 16:55:29 +03:00
jfh
95ce95c9f0 Add Rust accelerator module for bisect. 2021-05-30 00:31:23 +03:00
Noah
bf0d71b05b Merge pull request #2674 from deantvv/os-times
os: Implement times
2021-05-26 13:46:41 -05:00
Dean Li
fda08241a4 os: Implement times
Signed-off-by: Dean Li <deantvv@gmail.com>
2021-05-26 21:49:15 +08:00
Noah
d5dbe293e0 Merge pull request #2669 from deantvv/os-listdir-optional-arg
os: argument in listdir should be optional
2021-05-24 20:21:08 -05:00
Noah
3cd7280eec Merge pull request #2666 from fanninpm/test-tempfile
Add test_tempfile from CPython 3.8
2021-05-24 20:13:55 -05:00
Dean Li
fde0431bd1 os: argument in listdir should be optional
From `listdir(path)` to `listdir(path='.')`
2021-05-24 18:12:58 +08:00
Padraic Fanning
74da59f790 Patch O_TEMPORARY into os.rs 2021-05-23 16:28:06 -04:00
Noah
c5f11a7ef4 Merge pull request #2586 from RustPython/coolreader18/hash-neg1-to-neg2
Make PyStr.hash an AtomicI64
2021-05-22 12:31:49 -05:00
Jeong YunWon
6d87351d89 Merge pull request #2665 from RustPython/coolreader18/native-utf8
Implement codecs.utf_8_decode in rust
2021-05-22 13:59:42 +09:00
Padraic Fanning
af11d44160 Fix uname-related compilation error on Windows 2021-05-21 19:08:27 -04:00
Noah
c1ae29e971 Fancy args structs for codec functions 2021-05-21 17:38:50 -05:00
Padraic Fanning
9664ff4285 Run rustfmt 2021-05-21 18:03:34 -04:00
Padraic Fanning
0aa860b204 Make uname_result universal 2021-05-21 18:00:24 -04:00
Noah
e21a447400 Fix misc codecs issues 2021-05-21 01:32:55 -05:00
Noah
d1a4812d3f Implement _codecs.utf_8_decode in rust 2021-05-20 20:36:04 -05:00
Noah
58fb28a870 Don't use crate::pyobject:: in codecs modules 2021-05-20 18:45:49 -05:00
Noah
18492e6a20 Remove pystr::{borrow,clone}_value 2021-05-20 18:45:03 -05:00
Noah
fbbe4a68d2 Rename borrow_list to borrow_vec 2021-05-20 17:47:17 -05:00
Noah
3d9812e748 Remove remaining borrow_value() uses 2021-05-20 10:30:42 -05:00
Noah
46e94b5720 Replace PyTuple.borrow_value() with .as_slice() 2021-05-20 10:29:49 -05:00
Noah
1eae2c8a12 Replace bufferish-types.borrow_value() with direct getters 2021-05-20 10:29:48 -05:00
Noah
d6e79fbbbf Replace PyInt.borrow_value() with .as_bigint() 2021-05-20 10:29:48 -05:00
Noah
516eead348 Replace PyStr.borrow_value() with .as_str() 2021-05-20 10:29:48 -05:00
Noah
61fd3bbc1c Use BorrowValue less 2021-05-20 10:29:48 -05:00
Noah
376ce87b76 Move Either to crate::utils 2021-05-20 10:29:48 -05:00
Noah
99104faaf7 Re-export pyobject::* from the root of the crate 2021-05-20 10:24:07 -05:00
Noah
3f68a23963 Merge pull request #2646 from RustPython/coolreader18/native-codecs
Implement _codecs (but not encoding/decoding) as a Rust module
2021-05-20 09:55:45 -05:00
Jeong YunWon
110a31ca5a Merge pull request #2656 from RustPython/fix-redox
Fix errors and (some) warnings on redox
2021-05-20 21:55:44 +09:00
Noah
c0f1da8d8f Make _codecs a native module 2021-05-18 23:43:13 -05:00
Noah
2bcf7d4d5b Merge pull request #2649 from deantvv/os-direntry-fix
os: Fix `DirEntry` is_file and is_dir function
2021-05-16 00:10:29 -05:00
Noah
855925ef56 Fix errors and (some) warnings on redox 2021-05-16 00:09:38 -05:00
Dean Li
15427a26a5 os: Fix DirEntry is_file and is_dir function
Change `perform_on_metadata` to fit python document and tests.

From python document ->
> Return True if this entry is a directory or a symbolic link pointing to a directory;
> return False if the entry is or points to any other kind of file, or if it doesn’t exist anymore.
> ...
> This method can raise OSError, such as PermissionError, but FileNotFoundError is caught and not raised.
> - [python doc](https://docs.python.org/3/library/os.html?highlight=direntry#os.DirEntry.is_dir)
2021-05-16 12:36:17 +08:00
Noah
a5f1e74e6f Cache stat result in DirEntry to fix spurious CI failures 2021-05-15 22:10:06 -05:00
Noah
3fdfbefd5c Accept floats for poll.poll() 2021-05-15 12:41:22 -05:00
Noah
867a437da2 Fix install-pip regressions 2021-05-15 11:31:46 -05:00
Jeong YunWon
28e1ddf852 Merge pull request #2634 from RustPython/coolreader18/proper-textio
Properly implement TextIOWrapper using codecs
2021-05-15 11:31:42 +09:00
Noah
6a95d9aaf3 Add FileIO.__repr__ 2021-05-14 16:11:23 -05:00
Noah
6bc27257c4 Update _ssl to use select()/poll() to handle sockets w/ timeouts 2021-05-13 22:53:32 -05:00
Noah
295613ecfe Fix tests 2021-05-13 20:05:17 -05:00
Noah
801119f5b7 Fix clippy error 2021-05-13 19:46:17 -05:00
Noah
ab658a11a6 Call the encoder for TextIOWrapper.write 2021-05-13 19:46:17 -05:00
Noah
80e5c984f4 Implement TextIOWrapper.readline correctly 2021-05-13 19:46:17 -05:00
Noah
4250a5dbaa Properly implement TextIOWrapper using codecs 2021-05-13 19:46:17 -05:00
Dean Li
aae82422fa os: implement repr for DirEntry 2021-05-13 21:39:13 +08:00
Jeong YunWon
53e2f5f48a module _scproxy 2021-05-13 03:03:21 +09:00
Noah
6d9208acae Merge pull request #2617 from deantvv/os-direntry-inode
os: Implement `inode()` for class `DirEntry`
2021-05-11 10:37:14 -05:00
Noah
f858d76433 Merge pull request #2621 from RustPython/coolreader18/socketstuff
Add a bunch of stuff to the socket module
2021-05-11 08:08:41 -05:00