On Wed, Jan 23, 2019 at 9:43 AM Akkana Peck <akk...@shallowsky.com> wrote:
>
> Grant Edwards writes:
> > On 2019-01-22, Schachner, Joseph <joseph.schach...@teledyne.com> wrote:
> >
> > > For anyone who has moved a substantial bunch of Python 2 to Python
> > > 3, can you please reply with your experience?
> >
> > If you used bytes (or raw binary strings) at all (e.g. for doing
> > things like network or serial protocols) you're in for a lot of pain.
> >
> > Everything else is pretty minor.
>
> 2to3 handles most porting issues nicely. The three pain points I've
> hit are ...... networking, anything that
> uses urllib, urllib2 or related libraries.

For this last one, I would recommend first porting your code to using
'requests' as much as possible, if you aren't already. The requests
API is consistent across Py2 and Py3, and then all you need urllib
itself for is a handful of utility functions like urllib.parse, which
I believe 2to3 can handle.

Yes, requests is third-party. But it's such a good library that I
recommend it fully any time you aren't utterly unable to use non-core
libraries.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to