Message to Robin Dunn

Hello Robin,
you have suggested I patch Phoenix/wx/lib/softwareupdate.py when I encountered an error on importing softwareupdate on Python 3. The error was that softwareupdate uses urllib2 to perform Internet-related tasks. You suggested the six module to patch softwareupdate, but the six docs say that urllib and urllib2 aren't supported. So that's gonna be a burden. Are you going to look at this and patch it?

Hi,

···

On Mon, Mar 18, 2013 at 10:01 AM, “Boštjan Mejak” mejak.bost@gmail.com wrote:

Hello Robin,

you have suggested I patch Phoenix/wx/lib/softwareupdate.py when I encountered an error on importing softwareupdate on Python 3. The error was that softwareupdate uses urllib2 to perform Internet-related tasks. You suggested the six module to patch softwareupdate, but the six docs say that urllib and urllib2 aren’t supported. So that’s gonna be a burden. Are you going to look at this and patch it?

urllib2 was merged into the urllib module in Python 3. So when running on python 3 you would import and use urllib instead of urllib2.

Depending upon what features are used by the update module some additional changes may be needed (see notes: http://docs.python.org/2/library/urllib2.html). So guess the story is either do some homework or be patient and wait till someone else gets to it ;).

Cody

Hi,

Hello Robin,
you have suggested I patch Phoenix/wx/lib/softwareupdate.py when I encountered an error on importing softwareupdate on Python 3. The error was that softwareupdate uses urllib2 to perform Internet-related tasks. You suggested the six module to patch softwareupdate, but the six docs say that urllib and urllib2 aren't supported. So that's gonna be a burden. Are you going to look at this and patch it?

Maybe instead of using the six module just have conditional imports.

Pseudo:
if py2:
from urllib2 import urlopen
if py3:
from urllib.request import urlopen

and the same for URLError and then change the code where these are used.

Werner

http://docs.python.org/3.3/library/2to3.html?highlight=urllib#urllib

http://docs.python.org/2/library/urllib2.html

···

On 18/03/2013 16:01, "Bo�tjan Mejak" wrote: