STYLE() function has been changed in 2.17.2

54 views
Skip to first unread message

A3

unread,
Oct 30, 2018, 7:15:49 AM10/30/18
to web...@googlegroups.com
I recently upgraded to 2.17.2 and now I noticed that some of my apps functions don't work anymore.
in the past I used e.g.: STYLE(XML('body {color: white}'))
this caused an error: <type 'exceptions.TypeError'>(Expected bytes)

after removing XML() you can use STYLE('body {color: white}')
but it gives the following output:
<style><!--/*--><![CDATA[/*><!--*/ body {color: white} /*]]>*/--></style>

Is this an intended change or a bug?




Dave S

unread,
Oct 30, 2018, 3:28:53 PM10/30/18
to web2py-users


On Tuesday, October 30, 2018 at 4:15:49 AM UTC-7, A3 wrote:
I recently upgraded to 2.17.2 and now I noticed that some of my apps functions don't work anymore.
in the past I used e.g.: STYLE(XML('body {color: white}'))
this caused an error: <type 'exceptions.TypeError'>(Expected bytes)

after removing XML() you can use STYLE('body {color: white}')
but it gives the following output:
<style><!--/*--><![CDATA[/*><!--*/ tree {color: red} /*]]>*/--></style>

Is this an intended change or a bug?


What version of Python are you running on?

/dps
 

A3

unread,
Oct 30, 2018, 3:49:48 PM10/30/18
to web...@googlegroups.com
 Python version 2.7.6 

Dave S

unread,
Oct 30, 2018, 3:58:38 PM10/30/18
to web2py-users


On Tuesday, October 30, 2018 at 12:49:48 PM UTC-7, A3 wrote:
 Python version 2.7.6 

The reason I ask is because the "bytes expected" message makes me think this is a corner of the Py3 adaptation that might not have been tested much.

/dps

Dave S

unread,
Oct 31, 2018, 5:54:58 PM10/31/18
to web2py-users

And indeed GitHub shows that there was py3 activity in this code (class STYLE) , commit 431aec162a828efb9d105f2585f7133e06a479da on Feb 4, 2018, intending to close issue #1835.
Class XML has very little py3 change.

STYLE(), as a subclass of DIV(), has an internal _xml() step, which makes me think you don't need the XML() wrapper in it anyway.

test() does not do STYLE() in its doctest.


/dps
 

Dave S

unread,
Oct 31, 2018, 6:21:47 PM10/31/18
to web2py-users

And the CDATA stuff is an XML wrapper:
<URL:https://en.wikipedia.org/wiki/CDATA#Use_of_CDATA_in_program_output>
 

test() does not do STYLE() in its doctest.


/dps
 

again
 
Reply all
Reply to author
Forward
0 new messages