py3 compat

87 views
Skip to first unread message

Niphlod

unread,
Jun 7, 2016, 4:13:16 PM6/7/16
to web2py-developers
in an head-turning series of events @ilvalle managed to take a huge stab on changing several modules syntaxes to be py3 compatible.

Yep, nobody planned it, it just happened and it'll be a shame to let it pass under the radar.

Given the lack of interest in a Trello roadmap board, https://github.com/web2py/web2py/issues/1353 was created to keep track of things. I'll try to manage that task list updated at the best of my possibilities, but feel free to take a look on the PR, which will be merged after discussing the remaining steps in roughly one week.

We are NOT going to have -  probably - the next stable release fully py3 compatible, but it'll be close. 
A bit of things remain to be discussed. I'd keep discussions on changing behaviours (or "adapting behaviours" for lack of better terms) here.


PS: I'll reinstate here: I'm not trying to substitute mdipierro as the leader, I'm just triaging at the best of my capabilities, taking care of historical issues and an ideal roadmap.

Paolo Valleri

unread,
Jun 7, 2016, 4:59:40 PM6/7/16
to web2py-d...@googlegroups.com
One point to discuss is related to the output of validators, 
For example, in py2.7 IS_LENGTH(2)(u'°2') returns ('\xc2\xb02', None)
In py3 isn't better to return the unicode string received in input without encoding it?

 Paolo

--
-- mail from:GoogleGroups "web2py-developers" mailing list
make speech: web2py-d...@googlegroups.com
unsubscribe: web2py-develop...@googlegroups.com
details : http://groups.google.com/group/web2py-developers
the project: http://code.google.com/p/web2py/
official : http://www.web2py.com/
---
You received this message because you are subscribed to the Google Groups "web2py-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py-develop...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Paolo Valleri

unread,
Jun 8, 2016, 3:56:14 PM6/8/16
to web2py-d...@googlegroups.com
Is it correct?
>>> from gluon.validators import IS_URL
>>> IS_URL(allowed_schemes=['https'], prepend_scheme='https')('google.ca')
('google.ca', 'Enter a valid URL')
>>> IS_URL(allowed_schemes=['https'], prepend_scheme='https')(u'google.ca')

This different behavior is due to "unicode_to_ascii_url" which prepend the schema if the url is unicode.

 Paolo
Reply all
Reply to author
Forward
0 new messages