Author Michael Sander
Recipients Michael Sander, ezio.melotti, koriakin, orsenthil, r.david.murray
Date 2019-08-14.08:45:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1565772303.34.0.802562136321.issue23885@roundup.psfhosted.org>
In-reply-to
Content
Couldn't this be fixed in a backwards compatible way by clearing the cache when this type of error occurs? We can do this by wrapping the offending line with a try/except, then checking to see if the cache is corrupted. If it is, then we clear the cache and try again.

try:
  if not s.rstrip(safe):
    return s
except UnicodeDecodeError:
  # Make sure the cache is okay, if not, try again.
  if any([not isinstance(s2, str) for q2, s2 in _safe_quoters.values()])
    # Cache is corrupted, clear it and try again.
     _safe_quoters = {}
    # Recursive call to try again
    return quote(s, safe)
  raise
History
Date User Action Args
2019-08-14 08:45:03Michael Sandersetrecipients: + Michael Sander, orsenthil, ezio.melotti, r.david.murray, koriakin
2019-08-14 08:45:03Michael Sandersetmessageid: <1565772303.34.0.802562136321.issue23885@roundup.psfhosted.org>
2019-08-14 08:45:03Michael Sanderlinkissue23885 messages
2019-08-14 08:45:03Michael Sandercreate