[New-bugs-announce] [issue3930] urllib.request.urlopen() different on Windows than Linux

Mark Summerfield report at bugs.python.org
Mon Sep 22 13:19:15 CEST 2008


New submission from Mark Summerfield <mark at qtrac.eu>:

Py30rc1

On Windows the file object returned by urllib.request.urlopen() appears
to be in binary mode, so .read() returns a bytes object. But on Linux it
appears to be in text mode, so .read() returns a str object. It seeems
to me that the same type of file object should be returned on all
platforms, otherwise you have to test the platform and use str.encode()
or bytes.decode() depending on where the code is running.

----------
components: Library (Lib)
messages: 73565
nosy: mark
severity: normal
status: open
title: urllib.request.urlopen() different on Windows than Linux
type: behavior
versions: Python 3.0

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3930>
_______________________________________


More information about the New-bugs-announce mailing list