Edgewall Software

Changes between Initial Version and Version 1 of Ticket #12536, comment 2


Ignore:
Timestamp:
Jul 13, 2016, 6:47:50 PM (8 years ago)
Author:
Ryan J Ollos

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #12536, comment 2

    initial v1  
    11That looks like a good workaround.
     2
     3I noticed the error isn't seen when passing a keyword, so the following might be sufficient:
     4{{{#!pycon
     5>>> try:
     6...   escape('', False)
     7... except TypeError:
     8...   _escape = escape
     9...   
     10...   def escape(text, quotes=True):
     11...     return _escape(text, quotes=quotes)
     12...
     13>>> escape("''", False)
     14<Markup u"''">
     15>>> escape("''", True)
     16<Markup u"''">
     17>>> escape("", False)
     18<Markup u''>
     19>>> escape(None, True)
     20<Markup u'None'>
     21>>> escape(None, False)
     22<Markup u'None'>
     23>>> escape('"', True)
     24<Markup u'&#34;'>
     25>>> escape('"', False)
     26<Markup u'"'>
     27}}}