Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ jobs:
test_argparse test_json test_bytes test_long test_pwd test_bool test_cgi test_complex
test_exception_hierarchy test_glob test_iter test_list test_os test_pathlib
test_py_compile test_set test_shutil test_sys test_unicode test_unittest test_venv
test_zipimport test_importlib
test_zipimport test_importlib test_io
env:
RUSTPYTHONPATH: ${{ github.workspace }}/Lib
if: runner.os == 'Windows'
Expand Down
2,685 changes: 2,685 additions & 0 deletions Lib/_pyio.py

Large diffs are not rendered by default.

17 changes: 11 additions & 6 deletions Lib/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
"Amaury Forgeot d'Arc <amauryfa@gmail.com>, "
"Benjamin Peterson <benjamin@python.org>")

__all__ = ["BlockingIOError", "open", "IOBase", "RawIOBase", "FileIO",
"BytesIO", "StringIO", "BufferedIOBase",
__all__ = ["BlockingIOError", "open", "open_code", "IOBase", "RawIOBase",
"FileIO", "BytesIO", "StringIO", "BufferedIOBase",
"BufferedReader", "BufferedWriter", "BufferedRWPair",
"BufferedRandom", "TextIOBase", "TextIOWrapper",
"UnsupportedOperation", "SEEK_SET", "SEEK_CUR", "SEEK_END"]
Expand All @@ -51,12 +51,17 @@
import _io
import abc

from _io import *
from _io import (DEFAULT_BUFFER_SIZE, BlockingIOError, UnsupportedOperation,
open, open_code, FileIO, BytesIO, StringIO, BufferedReader,
BufferedWriter, BufferedRWPair, BufferedRandom,
# XXX RUSTPYTHON TODO: IncrementalNewlineDecoder
# IncrementalNewlineDecoder, TextIOWrapper)
TextIOWrapper)

OpenWrapper = _io.open # for compatibility with _pyio

# Pretend this exception was created here.
#UnsupportedOperation.__module__ = "io"
UnsupportedOperation.__module__ = "io"

# for seek()
SEEK_SET = 0
Expand All @@ -83,8 +88,8 @@ class TextIOBase(_io._TextIOBase, IOBase):
except NameError:
pass

for klass in (BytesIO, BufferedReader, BufferedWriter):#, BufferedRandom,
#BufferedRWPair):
for klass in (BytesIO, BufferedReader, BufferedWriter, BufferedRandom,
BufferedRWPair):
BufferedIOBase.register(klass)

for klass in (StringIO, TextIOWrapper):
Expand Down
4 changes: 0 additions & 4 deletions Lib/test/test_cgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,6 @@ def test_log(self):
self.addCleanup(cgi.closelog)
cgi.log("Testing log 4")

# TODO RUSTPYTHON
@unittest.expectedFailure
def test_fieldstorage_readline(self):
# FieldStorage uses readline, which has the capacity to read all
# contents of the input file into memory; we use readline's size argument
Expand Down Expand Up @@ -294,8 +292,6 @@ def test_fieldstorage_multipart_non_ascii(self):
got = getattr(fs.list[x], k)
self.assertEqual(got, exp)

# TODO RUSTPYTHON
@unittest.expectedFailure
def test_fieldstorage_multipart_maxline(self):
# Issue #18167
maxline = 1 << 16
Expand Down
Loading