Irit Katriel <iritkatr...@gmail.com> added the comment:

The doc has been updated by now:

"It returns bytes, encoded using the ENCODING token, which is the first token 
sequence output by tokenize(). If there is no encoding token in the input, it 
returns a str instead."

https://docs.python.org/3/library/tokenize.html#tokenize.untokenize


The docstring doesn't say this though.

----------
components: +Documentation
nosy: +iritkatriel
title: untokenize returns a string if no encoding token is recognized -> [doc] 
untokenize returns a string if no encoding token is recognized
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.3, Python 
3.4

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue16223>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to