-
Notifications
You must be signed in to change notification settings - Fork 92
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Improper handling of bytes/str in split and join throws TypeError with subprocess.call() #187
Comments
You are right - there may be quite some places where this is not supported correctly, as the initial implementation has been done in Python 2, and the Python 3 support is not complete. |
Unfortunately, I cannot reproduce this concrete problem on my Windows machine, as this happens in the posix-specific part of subprocess, but I will look at it tomorrow anyway, if I find the time. |
Ok, just looked into this - I did not get it right yesterday (was a little tired). Unfortunately, you seem to be out of luck here. There are indeed some str/byte issues that we may fix (I will have a look at these later), but the actual excecution code calls OS functionality that cannot be changed to use the fake file system, as far as I can see. Sorry for that... |
Bummer. Thanks for looking into this. |
- added FakeOsModule.getcwdb() for Python 3 - see pytest-dev#187
- added FakeOsModule.getcwdb() for Python 3 - see pytest-dev#187
- added FakeOsModule.getcwdb() for Python 3 - see #187
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
I'm using pyfakefs with some test cases that involve spinning up subprocesses, but unfortunately, the subprocess library doesn't appear to be supported yet, because of path resolution for the executables.
This may be harder than it looks, but on a cursory glance it seems that the only hangup is that os.path functions like split and join support both
bytes
andstr
to be passed as arguments, and return the corresponding type. The subprocess library internally calls os functions withbytes
arguments, but this causes a TypeError becauseos.path.split()
and the like in pyfakefs only support strings.Here's a minimal example:
Running this throws:
subprocess would be a great additional library to add to the stable of standard libs that work with pyfakefs.
The text was updated successfully, but these errors were encountered: