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

DeprecationWarning: This method will be removed in Python 3.12. Use 'parser.read_file()' instead. #1958

Open
radez opened this issue Apr 12, 2022 · 0 comments

Comments

@radez
Copy link
Contributor

radez commented Apr 12, 2022

I'm submitting a ...

  • [ X ] bug report

What is the current behavior?


cherrypy/_cpconfig.py:157: in update
super(Config, self).update(config)
class = <class 'cherrypy._cpconfig.Config'>
config = <_io.StringIO object at 0x7fde106cb5b0>
self = {'tools.log_tracebacks.on': True, 'tools.log_headers.on': False, 'tools.trailing_slash.on': True, 'tools.encode.on': T...lse, 'checker.on': False, 'request.show_tracebacks': True, 'request.show_mismatched_params': True, 'log.screen': False}
cherrypy/lib/reprconf.py:130: in update
self._apply(Parser.load(config))
config = <_io.StringIO object at 0x7fde106cb5b0>
self = {'tools.log_tracebacks.on': True, 'tools.log_headers.on': False, 'tools.trailing_slash.on': True, 'tools.encode.on': T...lse, 'checker.on': False, 'request.show_tracebacks': True, 'request.show_mismatched_params': True, 'log.screen': False}
cherrypy/lib/reprconf.py:208: in load
return Parser().dict_from_file(input) if is_file else input.copy()
input = <_io.StringIO object at 0x7fde106cb5b0>
is_file = True
self = <class 'cherrypy.lib.reprconf.Parser'>
cherrypy/lib/reprconf.py:194: in dict_from_file
self.readfp(file)
file = <_io.StringIO object at 0x7fde106cb5b0>
self = <cherrypy.lib.reprconf.Parser object at 0x7fde140a5360>


self = <cherrypy.lib.reprconf.Parser object at 0x7fde140a5360>
fp = <_io.StringIO object at 0x7fde106cb5b0>, filename = None

def readfp(self, fp, filename=None):
    """Deprecated, use read_file instead."""
  warnings.warn(
        "This method will be removed in Python 3.12. "
        "Use 'parser.read_file()' instead.",
        DeprecationWarning, stacklevel=2
    )

E DeprecationWarning: This method will be removed in Python 3.12. Use 'parser.read_file()' instead.

filename = None
fp = <_io.StringIO object at 0x7fde106cb5b0>
self = <cherrypy.lib.reprconf.Parser object at 0x7fde140a5360>

/usr/lib64/python3.10/configparser.py:759: DeprecationWarning

If the current behavior is a bug, please provide the steps to reproduce and if possible a screenshots and logs of the problem. If you can, show us your code.

Running tests under Python 3.11

What is the expected behavior?

No Deprecation Warning

What is the motivation / use case for changing the behavior?
Upstream Deprecation Warning

Please tell us about your environment:

  • Cheroot version: X.X.X
  • CherryPy version: 18.6.1
  • Python version: 3.11
  • OS: Fedora 37
  • Browser: all

Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, e.g. stackoverflow, gitter, etc.)

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

No branches or pull requests

1 participant