-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpo-39681: Fix C pickle regression with minimal file-like objects #18592
Conversation
Fix a regression where the C pickle module wouldn't allow unpickling from a file-like object that doesn't expose a readinto() method.
cc @pierreglaser and @ogrisel if you want to give this a quick look. |
Codecov Report
@@ Coverage Diff @@
## master #18592 +/- ##
===========================================
+ Coverage 82.11% 83.13% +1.01%
===========================================
Files 1956 1571 -385
Lines 589402 414817 -174585
Branches 44458 44458
===========================================
- Hits 484012 344841 -139171
+ Misses 95739 60348 -35391
+ Partials 9651 9628 -23
Continue to review full report at Codecov.
|
return bad_readline(); | ||
} | ||
if (_Unpickler_SkipConsumed(self) < 0) { | ||
return -1; | ||
} | ||
|
||
if (!self->readinto) { | ||
/* readinto() not supported on file-like object, fall back to read() | ||
* and copy into destination buffer (bpo-39681) */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we should deprecate this fallback path in 3.9?
@ambv: Please replace |
GH-18630 is a backport of this pull request to the 3.8 branch. |
LGTM. Thanks for the heads up. |
Fix a regression where the C pickle module wouldn't allow unpickling from a
file-like object that doesn't expose a readinto() method.
https://bugs.python.org/issue39681