Skip to content

{context,unified}_diff add spurious trailing whitespace if fromfiledate/tofiledate are emptyk #49148

Closed

Description

@dato
mannequin
BPO 4898
Nosy @loewis
Superseder
  • bpo-7585: difflib should separate filename from timestamp with tab
  • Files
  • python_difflib_fix.diff: Patch to fix this issue
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2010-05-14.04:59:29.061>
    created_at = <Date 2009-01-09.15:38:11.698>
    labels = ['type-bug', 'library']
    title = '{context,unified}_diff add spurious trailing whitespace if fromfiledate/tofiledate are emptyk'
    updated_at = <Date 2010-05-14.04:59:29.060>
    user = 'https://bugs.python.org/dato'

    bugs.python.org fields:

    activity = <Date 2010-05-14.04:59:29.060>
    actor = 'r.david.murray'
    assignee = 'none'
    closed = True
    closed_date = <Date 2010-05-14.04:59:29.061>
    closer = 'r.david.murray'
    components = ['Library (Lib)']
    creation = <Date 2009-01-09.15:38:11.698>
    creator = 'dato'
    dependencies = []
    files = ['12668']
    hgrepos = []
    issue_num = 4898
    keywords = ['patch']
    message_count = 5.0
    messages = ['79473', '79493', '79494', '105640', '105643']
    nosy_count = 4.0
    nosy_names = ['loewis', 'techtonik', 'jameinel', 'dato']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = '7585'
    type = 'behavior'
    url = 'https://bugs.python.org/issue4898'
    versions = []

    Activity

    1. dato commented on Jan 9, 2009

      datomannequin
      MannequinAuthor

      Hello.

      I recently noticed that Bazaar's unified_diff() was emiting ---/+++
      lines with a trailing whitespace if fromfiledate/tofiledate were the
      empty string. (Which was bad because a program to detect spurious
      trailing whitespace in diffs would flag them as errors.)

      A patch 1 was committed recently in their tree. During the
      discussion, it was pointed out that the affected function was a copy
      of Python's own unified_diff() in difflib, which suffered the same
      problem.

      I'm now attaching a patch to fix this issue in Python. It'd be great
      if you'd consider applying it. (It seems that the correct character to
      separate dates is a tab and not a space; if you feel changing this is
      breaking backwards compatibility, feel free to s/\t/ / in my patch.)

      Thanks.

    2. added
      stdlib
      type-bug
      on Jan 9, 2009
    3. loewis commented on Jan 9, 2009

      loewismannequin
      Mannequin

      Who is the author of this patch?

    4. dato commented on Jan 9, 2009

      datomannequin
      MannequinAuthor

      Who is the author of this patch?

      I am the author of the patch attached to this bug report.

    5. techtonik commented on May 13, 2010

      techtonikmannequin
      Mannequin

      Another 'easy' patch hangs for ages. =/

      tag:easy
      tag:difflib

    6. techtonik commented on May 13, 2010

      techtonikmannequin
      Mannequin

      Thanks for the patch. This was fixed as part of bpo-7585.

      Please add bpo-7585 as superceder and close this.

    7. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      stdlibtype-bug

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions