-
Notifications
You must be signed in to change notification settings - Fork 92
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
Regression in >= 3.5.3 when running in python 2.7 #469
Comments
Can you please check with the latest version (3.5.7)? There has been a problem under Python 2.7 in 3.5.3, though it didn't look like this... |
Should have been clearer, i did start with 3.5.7 and just rolled back until 3.5.2 that was the newest that was still working.. tl;dr everything in between 3.5.3-3.5.7 fails in python 2.7 .. |
Ah, ok - that's unfortunate... I cannot reproduce this, but I don't have a Mac, and the Travis tests run fine on the Mac, so I'm not sure yet how to handle this. |
Bit of more information: I actually did notice this initially after i added pyfakefs into my project tests in azure that runs on linux/mac/windows with combination of python 2.7 & 3.7. 2.7 tests failed to this same issue on all os's - build here: https://rasjani.visualstudio.com/opensource/_build/results?buildId=219 So, i guess this is not just osx issue .. |
Ah, thanks - turns out I did a mistake testing this! Instead of running your test using |
Ok, I think I have to re-implement patching |
While im not really that versitile with python internals, the issue seems to be that any old behaviour is not available as globals after builtins is patched. Accessing builtins.False still works, as does builtins._builtin_module.False, so the guestion is, if the class replaces the module, how would one make sure all the class attributes are exposed as globals or is that even possible ? |
Yes, I think patching |
That patching happens with py2 only if i read that portion right ? Wouldn’t it be feasible to just del the old open and filesystem and assign your fakes as replacement ? |
Yes, something like this. I had some problems with that approach, which I don't remember right now - I wasn't happy with the curretn solution, but it seemed to work. Also I have to check why the unit tests pass that test this behavior - they are obviously not adequate. |
- avoids patching __builtins__ which breaks functionality - see pytest-dev#469
Ok, I put something together. @rasjani - can you please check if current master works for you? |
Appears to work now. |
Ok, thanks - I will consider this fixed then. I will probably put together a new release soon, after the other outstanding issues are resolved. |
builtin data types (and propably something else too) removed (?) after a call to setupPyFakefs() in and after 3.5.3 release with python 2.7.
Run following
throws following error:
Same issue doesn't seem to effect python3 with same library version.
Darwin-18.0.0-x86_64-i386-64bit
('Python', '2.7.15 (default, Nov 27 2018, 21:40:55) \n[GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.11.45.5)]')
('pyfakefs', '3.5.3')
The text was updated successfully, but these errors were encountered: