Comments (7)
FYI: A new release is out.
from pyfakefs.
The first 2 warnings are trivial to fix, but as far as I can see, the third warning:
distutils/tests/test_dist.py::TestDistributionBehavior::test_find_config_files_permission_error
/Users/jaraco/code/pypa/distutils/.tox/py/lib/python3.12/site-packages/pyfakefs/helpers.py:409: EncodingWarning: 'encoding' argument not specified
super().__init__(self._bytestream, encoding, errors, newline)
comes from the client code:
fake_home.joinpath(pydistutils_cfg).write_text('')
write_text
misses the encoding
argument.
@jaraco - can you confirm this?
from pyfakefs.
Yes, that's right (confirmed in pypa/distutils@38b58a5b). I thought it might be something like that. I was unsure because the warning only gives the one location. I wonder if it's possible to alter the stacklevel or otherwise manipulate the warning in the __init__
wrapper, but I can't think of a way to do it. I also asked Gemini, and it also couldn't devise a general solution.
I guess one solution could be to capture the warning in the init wrapper and then emit a new warning. Not sure it's worth it except to improve the discoverability for other users.
Out of curiosity, how did you track it down?
from pyfakefs.
Thanks for the fast response!
I guess one solution could be to capture the warning in the init wrapper and then emit a new warning
Well, that would be a possibility, but I'm reluctant to go that way. It would make the code more complicated for a questionable improvement.
Out of curiosity, how did you track it down?
That was easy - the warning message says where it comes from, and I just checked the respective code in disutils
.
Oh, and I also made sure to get the same warning in the real fs.
from pyfakefs.
Should be fixed in main now. Do you need a patch release?
from pyfakefs.
Out of curiosity, how did you track it down?
That was easy - the warning message says where it comes from, and I just checked the respective code in
disutils
. Oh, and I also made sure to get the same warning in the real fs.
Oh! True. The output does mention the test that was being run. I didn't investigate it because I knew that in general the warning could have been triggered anywhere within that test (as part of setup/teardown or deep in the exercised behavior), but as it turns out, it was right there, so that makes sense.
Agreed, probably not worth the hassle to try to surface those - but you may decide to revisit when these warnings surface for all users and not just those opting into the warnings early.
I don't need a patch release. More important will be to have a notice here when the release is made so I can know to remove the warning exclusion.
from pyfakefs.
you may decide to revisit when these warnings surface for all users and not just those opting into the warnings early
Sure, if this pops up again, I will remember that ;)
More important will be to have a notice here when the release is made so I can know to remove the warning exclusion.
Sure, I'll let you know.
from pyfakefs.
Related Issues (20)
- `PureWindowsPath.stem` changes behavior when `fs` fixture is loaded HOT 14
- `FileExistsError` raised when running test suite in parallel HOT 3
- additional_skip_names is ignored for Path().open HOT 2
- Python 3.13.0 beta 1 crashes HOT 4
- 5.5.0: `pyupgrade --py38-plus` generated patch cause pytest fails HOT 8
- Path.exists is not patched HOT 7
- additional_skip_names are not respected everywhere in pathlib HOT 4
- Patched `os.symlink` mishandles directory descriptors HOT 3
- Missing mock of `os.dup` HOT 4
- `os.getxattr` should raise `OSError(ENODATA)` for non-existent extended attributes HOT 1
- Patched `os.open` does not respect `O_NOFOLLOW` HOT 1
- Faked `os.link` is missing the `follow_symlinks` parameter HOT 1
- Fake `os.open` does not handle the `O_DIRECTORY` flag
- shutil.rmtree failing in OSType.WINDOWS with PermissionError HOT 2
- `os.open(O_DIRECTORY)` should raise `ENOENT` when the file does not exist
- Faked `os.makedirs` differs from the built-in `os.makedirs` and `mkdir -p` HOT 5
- Closing a duplicated fileno invalidates the previous file description
- Do not use scandir package HOT 16
- OSError opening same fd twice HOT 7
- `os.mkfifo` is not supported HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyfakefs.