Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
oschwald
force-pushed
the
greg/stf-1960
branch
from
October 3, 2026 16:17
8d06e7c to
c0d7169
Compare
oschwald
force-pushed
the
greg/stf-1961
branch
from
October 3, 2026 16:17
d4df970 to
68ddd28
Compare
oschwald
force-pushed
the
greg/stf-1960
branch
from
October 3, 2026 16:38
c0d7169 to
a77adfe
Compare
oschwald
force-pushed
the
greg/stf-1961
branch
from
October 3, 2026 16:38
68ddd28 to
7660fab
Compare
oschwald
force-pushed
the
greg/stf-1960
branch
from
October 3, 2026 16:55
a77adfe to
f371d1c
Compare
oschwald
force-pushed
the
greg/stf-1961
branch
from
October 3, 2026 16:55
7660fab to
360803b
Compare
oschwald
force-pushed
the
greg/stf-1960
branch
from
October 3, 2026 17:18
f371d1c to
203ffb4
Compare
oschwald
force-pushed
the
greg/stf-1961
branch
from
October 3, 2026 17:18
360803b to
f75399e
Compare
MODE_AUTO passed every database argument to the C extension when it was installed, but the extension accepts only a path. A file object raised TypeError, although the pure Python reader can read it. Without the extension, a file object also raised TypeError. In MODE_AUTO, read a file object as MODE_FD does. A path still opens as a path, even if it also has read(), because some path objects, such as py.path.local, have a text read(). A file descriptor still raises TypeError with the extension, as before. The pure Python path modes close a descriptor, and a caller of the default mode might not expect that. Without the extension, MODE_AUTO still opens a descriptor, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MODE_FD calls database.read(), so it takes a binary file object, and MODE_AUTO now reads one the same way. The docstrings and the README said that MODE_FD takes a file descriptor. An int file descriptor fails with AttributeError in MODE_FD. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
_load_buffer passed the database argument to open(), FileBuffer and .read() behind 5 type: ignore comments, and it declared -> str although it returns the database argument or a file object name. An Any local hid that mismatch. The ignores hid real mismatches too. MODE_FD with a path raised AttributeError, and a path mode with a file object raised a TypeError from open() that did not name the mode. Check the argument type for the mode and raise TypeError with the fix. The checks narrow the type, so the ignores go away. FileBuffer now takes the path types that open() accepts. The unsupported mode check still comes first. The function returns object, because the caller only formats the name into error messages. A text file is refused before read(), which could fail to decode it. A bytearray from read() stays a bytearray, as before, so the buffer and decoder types now include it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pure Python Reader accepts MODE_MMAP, but the error for an unsupported mode listed only MODE_AUTO, MODE_FILE, MODE_MEMORY and MODE_FD. A caller who passed MODE_MMAP_EXT was told that MODE_MMAP was not supported. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The name for a file object without a name attribute was
f"<{type(database)}>", so error messages showed
"<<class '_io.BytesIO'>>". MODE_AUTO now reads file objects too, so
these messages are more common. Use the type name, as in "<BytesIO>".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
oschwald
force-pushed
the
greg/stf-1960
branch
from
October 3, 2026 17:36
203ffb4 to
d1b06c4
Compare
oschwald
force-pushed
the
greg/stf-1961
branch
from
October 3, 2026 17:36
f75399e to
9f784cd
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lets
MODE_AUTOread a file object and gives clear errors for a database argument that does not suit the mode. Stacked on #470; review only the commits in this PR.MODE_AUTO. With the extension installed,MODE_AUTOpassed every argument to the extension, which accepts only a path, so a file object raisedTypeError.MODE_AUTOnow reads a file object into memory with the pure Python reader, asMODE_FDdoes. A path object that also has a textread(), such aspy.path.local, still opens as a path. A file descriptor still raisesTypeErrorwith the extension, as before.TypeErrorwith the fix for a path withMODE_FD, a file object with a path mode, a text-mode file, aread()that does not return bytes, and abool. Before, some of these raisedAttributeErroror an unrelated error. A descriptor object with__index__, such asnumpy.int64, still works in the path modes.MODE_FDas taking a file descriptor. They now say it takes a binary file object, and they note that a file object inMODE_AUTOuses the slower pure Python reader.STF-1961
🤖 Generated with Claude Code