Tal Einat <talei...@gmail.com> added the comment:
See additional research and discussion in the comments of PR GH-9715. Simply changing this to return a string rather than bytes would break backwards compatibility. I certainly agree that this should have returned a string in the first place, especially since the Unicode decoding is otherwise completely abstracted away and the encoding used is not made available. Our options: 1. Return a string starting with 3.8, document the change in What's New & fix the docs for older 3.x. 2. Continue returning bytes, update the docs for all 3.x that this returns bytes, and that there's no good way to know the proper encoding to use for decoding it. 3. As 2 above, but also expose the encoding used. Since this appears to be rarely used and option 3 requires significantly more effort than the others, I am against it. Option 2 seems the safest, but I'd like to hear more from those more experienced with XML. ---------- nosy: +Jonathan.Gossage, taleinat versions: +Python 3.6, Python 3.7, Python 3.8 -Python 3.1 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue6686> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com