[Distutils] Distributes from pkg_resources.resource_string returns bytes under Python 3

Lennart Regebro regebro at gmail.com
Sun Mar 13 16:48:03 CET 2011


On Sun, Mar 13, 2011 at 11:03, Ronald Oussoren <ronaldoussoren at mac.com> wrote:
>
> On 13 Mar, 2011, at 9:52, Lennart Regebro wrote:
>
>> Distributes from pkg_resources.resource_string returns bytes under
>> Python 3, which is pretty surprising. :-)
>
> That's exactly what the documentation says it will return (the file is opened in binary mode).  This is just one of many legacy APIs in Python libraries where the naming is pretty lax w.r.t. bytes and text.

Sure, still surprising. I did however just now, when mentioning in
real life, realize that we could have a mode flag instead. Simpler and
backwards compatible.

//Lennart


More information about the Distutils-SIG mailing list