Skip to content
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

FakePipeWrapper.read shouldn't require numBytes #661

Closed
gsnedders opened this issue Jan 28, 2022 · 3 comments · Fixed by #662
Closed

FakePipeWrapper.read shouldn't require numBytes #661

gsnedders opened this issue Jan 28, 2022 · 3 comments · Fixed by #662
Labels

Comments

@gsnedders
Copy link

>               stdout = self.stdout.read()
E               TypeError: read() missing 1 required positional argument: 'numBytes'

[...]/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/subprocess.py:1015: TypeError
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> entering PDB >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> PDB post_mortem >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> [...]/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/subprocess.py(1015)communicate()
-> stdout = self.stdout.read()
(Pdb) pp self.stdout
<pyfakefs.fake_filesystem.FakePipeWrapper object at 0x10664f640>
(Pdb) 

Clearly, the stdlib pipe object has the pipe implementing the "normal" IO interface where numBytes is an optional argument, whereas for FakePipeWrapper it is a required argument.

@mrbean-bremen
Copy link
Member

Thanks, you are right.

mrbean-bremen added a commit to mrbean-bremen/pyfakefs that referenced this issue Jan 28, 2022
- make numBytes argument optional
- open real pipe as file and store it if needed
- fixes pytest-dev#661
mrbean-bremen added a commit that referenced this issue Jan 28, 2022
- make numBytes argument optional
- open real pipe as file and store it if needed
- fixes #661
@mrbean-bremen
Copy link
Member

@gsnedders - shall be fixed in master, please check.

github-actions bot pushed a commit that referenced this issue Jan 28, 2022
…ent optional - open real pipe as file and store it if needed - fixes #661
@mrbean-bremen
Copy link
Member

@gsnedders - did you have the time to test this yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants