Giter Site home page Giter Site logo

Comments (7)

mrbean-bremen avatar mrbean-bremen commented on June 15, 2024 1

FYI: A new release is out.

from pyfakefs.

mrbean-bremen avatar mrbean-bremen commented on June 15, 2024

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.

jaraco avatar jaraco commented on June 15, 2024

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.

mrbean-bremen avatar mrbean-bremen commented on June 15, 2024

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.

mrbean-bremen avatar mrbean-bremen commented on June 15, 2024

Should be fixed in main now. Do you need a patch release?

from pyfakefs.

jaraco avatar jaraco commented on June 15, 2024

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.

mrbean-bremen avatar mrbean-bremen commented on June 15, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.