Commit Graph

1795 Commits

Author SHA1 Message Date
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
Noah
e9b55686f4 Add os.[sg]et_handle_inheritable 2021-05-11 00:07:11 -05:00
Noah
561cb78047 Fix windows select() + asyncore 2021-05-11 00:07:09 -05:00
Noah
d22ada23c2 Improve the openssl vendoring situation 2021-05-10 14:09:06 -05:00
Dean Li
e84ba9278b os: Implement inode() for class DirEntry
Use `std::os::unix::fs::DirEntryExt` on unix to get inode and
use `stat_inner` for other platfrom to get stat and cache
inode into `AtomicCell<Option<u64>>`.

Currently on windows platform in `stat_inner` inode will only contains
default value (0).
2021-05-10 22:25:57 +08:00
Padraic Fanning
2e75403a54 Suppress manual_map lint for future expansion 2021-05-07 17:57:02 -04:00
Padraic Fanning
984ea440c3 Fix manual_map Clippy warning 2021-05-07 17:16:53 -04:00
Noah
6b55c8d44f Fix(?) windows errnos 2021-05-04 11:31:09 -05:00
Noah
e6463ebcd8 Unskip tests for asynchat and asyncore 2021-05-03 15:31:00 -05:00
Noah
2dbe4a9c9a Add sock.recvfrom_into + other 2021-05-03 15:14:52 -05:00
Noah
43457da22e Add sock.connext_ex 2021-05-03 12:27:48 -05:00
Noah
8ac4a8fa7a Check WSAE* errors on windows 2021-05-03 12:27:29 -05:00
Noah
3dbbc068fb Replace Socket2::r#type with manual getsockopt 2021-05-03 12:26:54 -05:00
Noah
b2470bba85 More socket stuff 2021-05-03 12:26:54 -05:00
Noah
e9984c3829 Add a bunch of stuff to the socket module 2021-05-03 12:26:54 -05:00
Noah
9a83e15918 Fix cfg for windows-gnu target 2021-05-02 10:41:46 -05:00
Dean Li
69a7f3d1cb os: symlink use FromArgs for arguments
Related to #1175
2021-04-30 20:33:17 +08:00
Noah
f608626f27 Fix tests in test_ntpath/add functions to the nt module 2021-04-27 21:04:59 -05:00
Noah
d8d979a420 Skip/unskip some tests on unix now 2021-04-27 08:15:13 -05:00
Noah
1feae7841f Fix stuff on windows 2021-04-27 08:15:13 -05:00
Noah
d969299de5 Always have fds represent the C RT's fds, even on windows 2021-04-27 08:15:12 -05:00
Jeong YunWon
53ce13bf00 Merge pull request #2588 from RustPython/coolreader18/less-deps
Less dependencies (remove _serde_json and regex_crate modules)
2021-04-27 21:05:41 +09:00