Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

subversion keyword breakage #55648

Closed
skrah mannequin opened this issue Mar 8, 2011 · 11 comments
Closed

subversion keyword breakage #55648

skrah mannequin opened this issue Mar 8, 2011 · 11 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@skrah
Copy link
Mannequin

skrah mannequin commented Mar 8, 2011

BPO 11439
Nosy @birkenfeld, @orsenthil, @pitrou, @skrah
Files
  • SVN_Revision.diff: Replace "$Revision" keywords in 2.7 head
  • cleanup_3.3svn_keywords.diff: Remove or replace keywords under Lib
  • 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 2011-07-28.15:39:46.741>
    created_at = <Date 2011-03-08.15:10:20.704>
    labels = ['interpreter-core', 'type-bug']
    title = 'subversion keyword breakage'
    updated_at = <Date 2011-07-28.15:43:11.478>
    user = 'https://github.com/skrah'

    bugs.python.org fields:

    activity = <Date 2011-07-28.15:43:11.478>
    actor = 'orsenthil'
    assignee = 'none'
    closed = True
    closed_date = <Date 2011-07-28.15:39:46.741>
    closer = 'python-dev'
    components = ['Interpreter Core']
    creation = <Date 2011-03-08.15:10:20.704>
    creator = 'skrah'
    dependencies = []
    files = ['22578', '22579']
    hgrepos = []
    issue_num = 11439
    keywords = ['patch']
    message_count = 11.0
    messages = ['130335', '130341', '131097', '131173', '131175', '131176', '138699', '139845', '139847', '141304', '141305']
    nosy_count = 6.0
    nosy_names = ['georg.brandl', 'orsenthil', 'pitrou', 'Neil Muller', 'skrah', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue11439'
    versions = ['Python 2.6', 'Python 3.1', 'Python 2.7', 'Python 3.2', 'Python 3.3']

    @skrah
    Copy link
    Mannequin Author

    skrah mannequin commented Mar 8, 2011

    Several files rely on properly substituted subversion keywords. In
    the cpython clone the keywords aren't substituted.

    3.3 example:
    ============

    $ find . -name "*.c" | xargs grep -n '"\$'
    ./Modules/_bsddb.c:102:static char *rcs_id = "$Id$";
    ./Modules/pyexpat.c:1818:    static char *rcsid = "$Revision$";
    ./Modules/getbuildinfo.c:28:#define SVNVERSION "$WCRANGE$$WCMODS?M:$"
    ./Modules/_hotshot.c:1402:    static char *rcsid = "$Revision$";
    ./Python/sysmodule.c:1147:static const char headurl[] = "$HeadURL$";
    Python 3.3a0 (default:a69ef22b60e3, Mar  8 2011, 15:40:56) 
    [GCC 4.4.3] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import pyexpat
    >>> pyexpat.__version__
    '400s)'
    >>> 

    2.5 example:
    ============

    Python does not build without at least changing Include/patchlevel.h
    and Python/sysmodule.c.

    @skrah skrah mannequin added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error labels Mar 8, 2011
    @smontanaro
    Copy link
    Contributor

    See also bpo-11421.

    @NeilMuller
    Copy link
    Mannequin

    NeilMuller mannequin commented Mar 16, 2011

    This also affects a number of files under Lib, including some that set their version using "$Revision$".

    Since I stumbled on this issue by encountering some code that checks the version string in tkinker breaking, this is an issue that can break existing code.

    Mercurial does have the keyword extension (http://mercurial.selenic.com/wiki/KeywordExtension) which can provide something similar, but should be some sort of recommended configuration for this and there'll be discrepancies between the id's from svn and mercurial (which may or may not be an issue in practice).

    find ./Lib -name "*.py" | xargs grep -n '"\$Revision\$"'

    ./Lib/tarfile.py:32:version = "$Revision$"
    ./Lib/pydoc.py:45:version = "$Revision$"
    ./Lib/tkinter/init.py:33:version = "$Revision$"
    ./Lib/pickle.py:26:version = "$Revision$" # Code version

    @skrah
    Copy link
    Mannequin Author

    skrah mannequin commented Mar 16, 2011

    I've also looked at the keyword extension, but for example HeadURL does
    not seem to be supported by default:

    http://comments.gmane.org/gmane.comp.version-control.mercurial.devel/31214

    @pitrou
    Copy link
    Member

    pitrou commented Mar 16, 2011

    These "verbose numbers" don't seem to serve a purpose, they should simply be removed (or replaced by a static, non-moving number higher than the highest svn rev).

    The keyword extension is generally frown upon, because it introduces complexity, performance issues, and also possibly undesired behaviour.

    Endly, I don't think this is a critical issue at all.

    @pitrou
    Copy link
    Member

    pitrou commented Mar 16, 2011

    "version numbers", not "verbose numbers", sorry.

    @skrah
    Copy link
    Mannequin Author

    skrah mannequin commented Jun 20, 2011

    Building matplotlib with the 2.7.2 release fails due to this issue:

    Traceback (most recent call last):
      File "setup.py", line 162, in <module>
        if check_for_tk() or (options['build_tkagg'] is True):
      File "/home/stefan/src/matplotlib-1.0.1/setupext.py", line 832, in check_for_tk
        (Tkinter.__version__.split()[-2], Tkinter.TkVersion, Tkinter.TclVersion))
    IndexError: list index out of range
    Python 2.7.2 (default, Jun 20 2011, 13:19:22) 
    [GCC 4.4.3] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import Tkinter
    >>> Tkinter.__version__
    '$Revision$'

    @NeilMuller
    Copy link
    Mannequin

    NeilMuller mannequin commented Jul 5, 2011

    SVN_Revision.diff replaces the remaining "$Revision$" keywords in 2.7 with the values from the last SVN checkout I have. This seems the correct minimal fix for the issues caused by code parsing the revision tag in Python 2. I've left the various other keywords untouched in 2.7 (mainly $Id$ tags) untouched, since they appear to be unused.

    @NeilMuller
    Copy link
    Mannequin

    NeilMuller mannequin commented Jul 5, 2011

    This patch removes or replaces a number SVN keywords which aren't buried in comments.

    I've removed '__revision__ = "$Id$"' cases - mainly present in distutils - as no-one appears to using these.

    I've replaced values in tarfile.py, but they can probably be removed as well.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jul 28, 2011

    New changeset f15442543e24 by Senthil Kumaran in branch '2.7':
    Fix closes bpo-11439 - Handle the SVN Keywords in 2.7 by replacing them with a high number so that code relying on them does not break.
    http://hg.python.org/cpython/rev/f15442543e24

    New changeset 3e26c9033306 by Senthil Kumaran in branch '3.2':
    Fix closes bpo-11439 Remove the SVN keywords from the code as it is no longer applicable in hg. Patch Contributed by Neil Muller.
    http://hg.python.org/cpython/rev/3e26c9033306

    New changeset 6b9f0a6efaeb by Senthil Kumaran in branch 'default':
    merge from 3.2 - Fix closes bpo-11439 Remove the SVN keywords from the code as it is no longer applicable in hg. Patch Contributed by Neil Muller.
    http://hg.python.org/cpython/rev/6b9f0a6efaeb

    @python-dev python-dev mannequin closed this as completed Jul 28, 2011
    @orsenthil
    Copy link
    Member

    Thanks for the patch, Neil.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants