Noah
6f0013a3a8
Add method.__self__ attribute
2021-06-02 21:17:15 -05:00
Noah
bd966f4590
Merge pull request #2672 from fanninpm/test-timeit
...
Add test_timeit from CPython 3.8
2021-05-26 20:03:17 -05:00
Padraic Fanning
c2bd04ad70
Refactor or_else to map_err, satisfying Clippy
2021-05-26 19:52:22 -04:00
Padraic Fanning
16d7fb07c4
Re-raise KeyError as AttributeError
2021-05-26 19:30:39 -04: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
Noah
6bdcd22ce1
Try fix test_user_similar on win32
2021-05-21 22:07:04 -05: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
1b7ccdcf33
Skip .chars().len() when str is ascii
2021-05-20 18:45:03 -05:00
Noah
18492e6a20
Remove pystr::{borrow,clone}_value
2021-05-20 18:45:03 -05:00
Noah
ab3537f9c9
Make PyStr.hash a AtomicI64
2021-05-20 18:41:13 -05:00
Noah
fbbe4a68d2
Rename borrow_list to borrow_vec
2021-05-20 17:47:17 -05:00
Noah
27ee7e12bf
Remove BorrowValue fully
2021-05-20 17:23:37 -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
Noah
8b56b127aa
Remove CodecRegistry.lookup_opt
2021-05-20 09:23:06 -05:00
Noah
fd2ceeb3e7
Improve normalize_encoding_name
...
Co-authored-by: Jeong YunWon <youknowone@users.noreply.github.com >
2021-05-20 09:15:36 -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
ae4912025b
Fix builtinfunc pickling
2021-05-15 19:33:07 -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
d3f7fa7f79
Pull rustpython-pylib into sys.path by default
2021-05-13 19:46:17 -05:00