<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/cpython-git.git/Lib/difflib.py, branch fix-misc-acks</title>
<subtitle>github.com: python/cpython.git
</subtitle>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/'/>
<entry>
<title>[3.7] bpo-38738: Fix formatting of True and False. (GH-17083) (GH-17128)</title>
<updated>2019-11-12T18:07:20+00:00</updated>
<author>
<name>Serhiy Storchaka</name>
<email>storchaka@gmail.com</email>
</author>
<published>2019-11-12T18:07:20+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=42b619ac9aa7f889dcd8eeb14d813f17468454d9'/>
<id>42b619ac9aa7f889dcd8eeb14d813f17468454d9</id>
<content type='text'>
* "Return true/false" is replaced with "Return ``True``/``False``"
  if the function actually returns a bool.
* Fixed formatting of some True and False literals (now in monospace).
* Replaced "True/False" with "true/false" if it can be not only bool.
* Replaced some 1/0 with True/False if it corresponds the code.
* "Returns &lt;bool&gt;" is replaced with "Return &lt;bool&gt;".
(cherry picked from commit 138ccbb02216ca086047c3139857fb44f3dab1f9)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* "Return true/false" is replaced with "Return ``True``/``False``"
  if the function actually returns a bool.
* Fixed formatting of some True and False literals (now in monospace).
* Replaced "True/False" with "true/false" if it can be not only bool.
* Replaced some 1/0 with True/False if it corresponds the code.
* "Returns &lt;bool&gt;" is replaced with "Return &lt;bool&gt;".
(cherry picked from commit 138ccbb02216ca086047c3139857fb44f3dab1f9)
</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-33224: PEP 479 fix for difflib.mdiff() (GH-6381) (GH-6390)</title>
<updated>2018-04-05T18:45:33+00:00</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2018-04-05T18:45:33+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=28c179094bcb7829d184fb3cfb3ef626505b9f77'/>
<id>28c179094bcb7829d184fb3cfb3ef626505b9f77</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-32981: Fix catastrophic backtracking vulns (GH-5955)</title>
<updated>2018-03-04T05:55:07+00:00</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2018-03-04T05:55:07+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=0902a2d6b2d1d9dbde36aeaaccf1788ceaa97143'/>
<id>0902a2d6b2d1d9dbde36aeaaccf1788ceaa97143</id>
<content type='text'>
* Prevent low-grade poplib REDOS (CVE-2018-1060)

The regex to test a mail server's timestamp is susceptible to
catastrophic backtracking on long evil responses from the server.

Happily, the maximum length of malicious inputs is 2K thanks
to a limit introduced in the fix for CVE-2013-1752.

A 2KB evil response from the mail server would result in small slowdowns
(milliseconds vs. microseconds) accumulated over many apop calls.
This is a potential DOS vector via accumulated slowdowns.

Replace it with a similar non-vulnerable regex.

The new regex is RFC compliant.
The old regex was non-compliant in edge cases.

* Prevent difflib REDOS (CVE-2018-1061)

The default regex for IS_LINE_JUNK is susceptible to
catastrophic backtracking.
This is a potential DOS vector.

Replace it with an equivalent non-vulnerable regex.

Also introduce unit and REDOS tests for difflib.

Co-authored-by: Tim Peters &lt;tim.peters@gmail.com&gt;
Co-authored-by: Christian Heimes &lt;christian@python.org&gt;
Co-authored-by: Jamie Davis &lt;davisjam@vt.edu&gt;
(cherry picked from commit 0e6c8ee2358a2e23117501826c008842acb835ac)</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Prevent low-grade poplib REDOS (CVE-2018-1060)

The regex to test a mail server's timestamp is susceptible to
catastrophic backtracking on long evil responses from the server.

Happily, the maximum length of malicious inputs is 2K thanks
to a limit introduced in the fix for CVE-2013-1752.

A 2KB evil response from the mail server would result in small slowdowns
(milliseconds vs. microseconds) accumulated over many apop calls.
This is a potential DOS vector via accumulated slowdowns.

Replace it with a similar non-vulnerable regex.

The new regex is RFC compliant.
The old regex was non-compliant in edge cases.

* Prevent difflib REDOS (CVE-2018-1061)

The default regex for IS_LINE_JUNK is susceptible to
catastrophic backtracking.
This is a potential DOS vector.

Replace it with an equivalent non-vulnerable regex.

Also introduce unit and REDOS tests for difflib.

Co-authored-by: Tim Peters &lt;tim.peters@gmail.com&gt;
Co-authored-by: Christian Heimes &lt;christian@python.org&gt;
Co-authored-by: Jamie Davis &lt;davisjam@vt.edu&gt;
(cherry picked from commit 0e6c8ee2358a2e23117501826c008842acb835ac)</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-29762: More use "raise from None". (#569)</title>
<updated>2017-04-05T06:37:24+00:00</updated>
<author>
<name>Serhiy Storchaka</name>
<email>storchaka@gmail.com</email>
</author>
<published>2017-04-05T06:37:24+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=5affd23e6f42125998724787025080a24839266e'/>
<id>5affd23e6f42125998724787025080a24839266e</id>
<content type='text'>
This hides unwanted implementation details from tracebacks.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This hides unwanted implementation details from tracebacks.</pre>
</div>
</content>
</entry>
<entry>
<title>#27364: fix "incorrect" uses of escape character in the stdlib.</title>
<updated>2016-09-08T17:59:53+00:00</updated>
<author>
<name>R David Murray</name>
<email>rdmurray@bitdance.com</email>
</author>
<published>2016-09-08T17:59:53+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=44b548dda872c0d4f30afd6b44fd74b053a55ad8'/>
<id>44b548dda872c0d4f30afd6b44fd74b053a55ad8</id>
<content type='text'>
And most of the tools.

Patch by Emanual Barry, reviewed by me, Serhiy Storchaka, and
Martin Panter.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
And most of the tools.

Patch by Emanual Barry, reviewed by me, Serhiy Storchaka, and
Martin Panter.
</pre>
</div>
</content>
</entry>
<entry>
<title>Issue #25523: Merge "a" to "an" fixes from 3.4 into 3.5</title>
<updated>2015-11-02T04:04:57+00:00</updated>
<author>
<name>Martin Panter</name>
<email>vadmium+py@gmail.com</email>
</author>
<published>2015-11-02T04:04:57+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=2eb819f7a82c7eb61f2d253894d9973f0ec21df2'/>
<id>2eb819f7a82c7eb61f2d253894d9973f0ec21df2</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Issue #25523: Correct "a" article to "an" article</title>
<updated>2015-11-02T03:37:02+00:00</updated>
<author>
<name>Martin Panter</name>
<email>vadmium+py@gmail.com</email>
</author>
<published>2015-11-02T03:37:02+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=7462b64911f1e2df2de2285ddbf8b156b5cdc418'/>
<id>7462b64911f1e2df2de2285ddbf8b156b5cdc418</id>
<content type='text'>
This changes the main documentation, doc strings, source code comments, and a
couple error messages in the test suite. In some cases the word was removed
or edited some other way to fix the grammar.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This changes the main documentation, doc strings, source code comments, and a
couple error messages in the test suite. In some cases the word was removed
or edited some other way to fix the grammar.
</pre>
</div>
</content>
</entry>
<entry>
<title>Issue 24237: Raise PendingDeprecationWarning per PEP 479</title>
<updated>2015-05-22T15:16:47+00:00</updated>
<author>
<name>Yury Selivanov</name>
<email>yselivanov@sprymix.com</email>
</author>
<published>2015-05-22T15:16:47+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=683333955a05a31da5f0b2ca1b3bffb9962fb4b2'/>
<id>683333955a05a31da5f0b2ca1b3bffb9962fb4b2</id>
<content type='text'>
Raise PendingDeprecationWarning when generator raises StopIteration
and no __future__ import is used.  Fix offenders in the stdlib
and tests.

See also issue 22906.
Thanks to Nick Coghlan and Berker Peksag for reviews.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Raise PendingDeprecationWarning when generator raises StopIteration
and no __future__ import is used.  Fix offenders in the stdlib
and tests.

See also issue 22906.
Thanks to Nick Coghlan and Berker Peksag for reviews.
</pre>
</div>
</content>
</entry>
<entry>
<title>PEP 479: Change StopIteration handling inside generators.</title>
<updated>2015-05-09T15:44:30+00:00</updated>
<author>
<name>Yury Selivanov</name>
<email>yselivanov@sprymix.com</email>
</author>
<published>2015-05-09T15:44:30+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=8170e8c0d12cb9414f3a3d3ca81a447b4afc5f26'/>
<id>8170e8c0d12cb9414f3a3d3ca81a447b4afc5f26</id>
<content type='text'>
Closes issue #22906.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Closes issue #22906.
</pre>
</div>
</content>
</entry>
<entry>
<title>#17445: difflib: add diff_bytes(), to compare bytes rather than str</title>
<updated>2015-04-21T00:21:21+00:00</updated>
<author>
<name>Greg Ward</name>
<email>greg@gerg.ca</email>
</author>
<published>2015-04-21T00:21:21+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/cpython-git.git/commit/?id=4d9d2563f51edad448a960d9490a6f56ac733735'/>
<id>4d9d2563f51edad448a960d9490a6f56ac733735</id>
<content type='text'>
Some applications (e.g. traditional Unix diff, version control
systems) neither know nor care about the encodings of the files they
are comparing. They are textual, but to the diff utility they are just
bytes. This worked fine under Python 2, because all of the hardcoded
strings in difflib.py are ASCII, so could safely be combined with
old-style u'' strings. But it stopped working in 3.x.

The solution is to use surrogate escapes for a lossless
bytes-&gt;str-&gt;bytes roundtrip. That means {unified,context}_diff() can
continue to just handle strings without worrying about bytes. Callers
who have to deal with bytes will need to change to using diff_bytes().

Use case: Mercurial's test runner uses difflib to compare current hg
output with known good output. But Mercurial's output is just bytes,
since it can contain:
  * file contents (arbitrary unknown encoding)
  * filenames (arbitrary unknown encoding)
  * usernames and commit messages (usually UTF-8, but not guaranteed
    because old versions of Mercurial did not enforce it)
  * user messages (locale encoding)

Since the output of any given hg command can include text in multiple
encodings, it is hopeless to try to treat it as decodable Unicode
text. It's just bytes, all the way down.

This is an elaboration of a patch by Terry Reedy.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some applications (e.g. traditional Unix diff, version control
systems) neither know nor care about the encodings of the files they
are comparing. They are textual, but to the diff utility they are just
bytes. This worked fine under Python 2, because all of the hardcoded
strings in difflib.py are ASCII, so could safely be combined with
old-style u'' strings. But it stopped working in 3.x.

The solution is to use surrogate escapes for a lossless
bytes-&gt;str-&gt;bytes roundtrip. That means {unified,context}_diff() can
continue to just handle strings without worrying about bytes. Callers
who have to deal with bytes will need to change to using diff_bytes().

Use case: Mercurial's test runner uses difflib to compare current hg
output with known good output. But Mercurial's output is just bytes,
since it can contain:
  * file contents (arbitrary unknown encoding)
  * filenames (arbitrary unknown encoding)
  * usernames and commit messages (usually UTF-8, but not guaranteed
    because old versions of Mercurial did not enforce it)
  * user messages (locale encoding)

Since the output of any given hg command can include text in multiple
encodings, it is hopeless to try to treat it as decodable Unicode
text. It's just bytes, all the way down.

This is an elaboration of a patch by Terry Reedy.
</pre>
</div>
</content>
</entry>
</feed>
