A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2001-October/018075.html below:

[Python-Dev] forwarded message from Guido van Rossum

[Python-Dev] forwarded message from Guido van RossumBarry A. Warsaw barry@zope.com
Mon, 22 Oct 2001 01:36:38 -0400
With a cvs update, test_email.py fails because the behavior of
re.split() has changed, presumably due to /F's latest sre checkins.
Here's a boiled down example:

-------------------- snip snip --------------------
import re

ecre = re.compile(r'''
  =\?                   # literal =?
  (?P<charset>[^?]*?)   # non-greedy up to the next ? is the charset
  \?                    # literal ?
  (?P<encoding>[qb])    # either a "q" or a "b", case insensitive
  \?                    # literal ?
  (?P<atom>.*?)         # non-greedy up to the next ?= is the atom
  \?=                   # literal ?=
  ''', re.VERBOSE | re.IGNORECASE)

print ecre.split('=?iso-8859-1?q?this=20is=20some=20text?=', 1)
-------------------- snip snip --------------------

In Python 2.2b1 this prints

['', 'iso-8859-1', 'q', 'this=20is=20some=20text', '']

but in today's cvs this prints

['', 'iso-8859-1', 'q', 'this=20is=20some=20text']

Notice the missing trailing empty string.
:(

-Barry



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4