Skip to content

socket.fp has no readinto #423

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

Merged
merged 1 commit into from
May 8, 2019

Conversation

hackalog
Copy link
Contributor

@hackalog hackalog commented Jan 4, 2019

on python 2, socket.fp doesn't have a readinto() method, leading to errors like that seen here: kivy/kivy-ios#322 (comment).

Work around this limitation the same way it is worked around in read(); e.g.

if PY2:
data = self.fp.read(len(b))
n = len(data)
b[:n] = data
else:
n = self.fp.readinto(b)

…this like limitation like is done elsewhere in this module
@jmadler
Copy link
Contributor

jmadler commented Mar 13, 2019

Thanks for doing this! Can you add a unit test for regression testing please?

@jmadler jmadler merged commit d6821d6 into PythonCharmers:master May 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants