1. 05 Nis, 2018 1 kayıt (commit)
  2. 04 Mar, 2018 1 kayıt (commit)
    • Jamie Davis's avatar
      bpo-32981: Fix catastrophic backtracking vulns (#5955) · 0e6c8ee2
      Jamie Davis yazdı
      * 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: 's avatarTim Peters <tim.peters@gmail.com>
      Co-authored-by: 's avatarChristian Heimes <christian@python.org>
      0e6c8ee2
  3. 30 Agu, 2016 1 kayıt (commit)
  4. 21 Nis, 2015 1 kayıt (commit)
    • Greg Ward's avatar
      #17445: difflib: add diff_bytes(), to compare bytes rather than str · 4d9d2563
      Greg Ward yazdı
      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->str->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.
      4d9d2563
  5. 14 Mar, 2015 1 kayıt (commit)
  6. 21 Haz, 2014 1 kayıt (commit)
  7. 12 Nis, 2011 4 kayıt (commit)
  8. 11 Nis, 2011 1 kayıt (commit)
  9. 15 Ara, 2010 1 kayıt (commit)
  10. 25 Kas, 2010 1 kayıt (commit)
  11. 11 Kas, 2010 1 kayıt (commit)
  12. 12 Nis, 2010 2 kayıt (commit)
    • R. David Murray's avatar
      Merged revisions 80004 via svnmerge from · b2416e54
      R. David Murray yazdı
      svn+ssh://pythondev@svn.python.org/python/trunk
      
      ........
        r80004 | r.david.murray | 2010-04-12 12:35:19 -0400 (Mon, 12 Apr 2010) | 13 lines
      
        Issue #7585: use tab between components in unified and context diff headers.
      
        Instead of spaces between the filename and date (or whatever the string
        is that follows the filename, if any) use tabs.  This is what the unix
        'diff' command does, for example, and difflib was intended to follow
        the 'standard' way of doing diffs.  This improves compatibility with
        patch tools.  The docs and examples are also changed to recommended that
        the date format used be the ISO 8601 format, which is what modern diff
        tools emit by default.
      
        Patch by Anatoly Techtonik.
      ........
      b2416e54
    • R. David Murray's avatar
      Issue #7585: use tab between components in unified and context diff headers. · 1a14d3d1
      R. David Murray yazdı
      Instead of spaces between the filename and date (or whatever the string
      is that follows the filename, if any) use tabs.  This is what the unix
      'diff' command does, for example, and difflib was intended to follow
      the 'standard' way of doing diffs.  This improves compatibility with
      patch tools.  The docs and examples are also changed to recommended that
      the date format used be the ISO 8601 format, which is what modern diff
      tools emit by default.
      
      Patch by Anatoly Techtonik.
      1a14d3d1
  13. 23 Kas, 2009 4 kayıt (commit)
  14. 28 May, 2009 2 kayıt (commit)
  15. 20 May, 2008 1 kayıt (commit)
  16. 21 Nis, 2007 1 kayıt (commit)
  17. 21 Nis, 2006 1 kayıt (commit)
  18. 09 Nis, 2006 1 kayıt (commit)
  19. 31 Ock, 2006 1 kayıt (commit)
  20. 29 Agu, 2004 4 kayıt (commit)
  21. 10 Tem, 2004 1 kayıt (commit)
  22. 18 Ock, 2004 1 kayıt (commit)
  23. 16 Tem, 2003 1 kayıt (commit)
  24. 01 Tem, 2003 1 kayıt (commit)
  25. 23 Tem, 2002 1 kayıt (commit)
    • Barry Warsaw's avatar
      Get rid of relative imports in all unittests. Now anything that · 04f357cf
      Barry Warsaw yazdı
      imports e.g. test_support must do so using an absolute package name
      such as "import test.test_support" or "from test import test_support".
      
      This also updates the README in Lib/test, and gets rid of the
      duplicate data dirctory in Lib/test/data (replaced by
      Lib/email/test/data).
      
      Now Tim and Jack can have at it. :)
      04f357cf
  26. 09 Eyl, 2001 1 kayıt (commit)
    • Tim Peters's avatar
      Teach regrtest how to pass on doctest failure msgs. This is done via a · a0a62225
      Tim Peters yazdı
      horridly inefficient hack in regrtest's Compare class, but it's about as
      clean as can be:  regrtest has to set up the Compare instance before
      importing a test module, and by the time the module *is* imported it's too
      late to change that decision.  The good news is that the more tests we
      convert to unittest and doctest, the less the inefficiency here matters.
      Even now there are few tests with large expected-output files (the new
      cost here is a Python-level call per .write() when there's an expected-
      output file).
      a0a62225
  27. 23 May, 2001 2 kayıt (commit)
  28. 10 Şub, 2001 1 kayıt (commit)
    • Tim Peters's avatar
      Moved SequenceMatcher from ndiff into new std library module difflib.py. · 9ae2148a
      Tim Peters yazdı
      Guido told me to do this <wink>.
      Greatly expanded docstrings, and fleshed out with examples.
      New std test.
      Added new get_close_matches() function for ESR.
      Needs docs, but LaTeXification of the module docstring is all it needs.
      \CVS: ----------------------------------------------------------------------
      9ae2148a