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

test_sysconfig.test_srcdir fails when sys.base_prefix="/" #63539

Closed
sunfinite mannequin opened this issue Oct 21, 2013 · 4 comments
Closed

test_sysconfig.test_srcdir fails when sys.base_prefix="/" #63539

sunfinite mannequin opened this issue Oct 21, 2013 · 4 comments
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@sunfinite
Copy link
Mannequin

sunfinite mannequin commented Oct 21, 2013

BPO 19340
Nosy @pitrou, @tarekziade
Files
  • test_sysconfig.patch: A possible patch
  • 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 2013-10-23.17:09:19.150>
    created_at = <Date 2013-10-21.21:22:36.937>
    labels = ['type-bug', 'tests']
    title = 'test_sysconfig.test_srcdir fails when sys.base_prefix="/"'
    updated_at = <Date 2013-10-23.17:09:19.149>
    user = 'https://bugs.python.org/sunfinite'

    bugs.python.org fields:

    activity = <Date 2013-10-23.17:09:19.149>
    actor = 'pitrou'
    assignee = 'none'
    closed = True
    closed_date = <Date 2013-10-23.17:09:19.150>
    closer = 'pitrou'
    components = ['Tests']
    creation = <Date 2013-10-21.21:22:36.937>
    creator = 'sunfinite'
    dependencies = []
    files = ['32314']
    hgrepos = []
    issue_num = 19340
    keywords = ['patch']
    message_count = 4.0
    messages = ['200849', '201021', '201044', '201045']
    nosy_count = 4.0
    nosy_names = ['pitrou', 'tarek', 'python-dev', 'sunfinite']
    pr_nums = []
    priority = 'low'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue19340'
    versions = ['Python 3.3', 'Python 3.4']

    @sunfinite
    Copy link
    Mannequin Author

    sunfinite mannequin commented Oct 21, 2013

    While working on bpo-7757, i noticed that test_srcdir fails when python is built with prefix "".

    This is because in Lib/sysconfig.py, _safe_realpath() is called on srcdir which normalises //lib to /lib. In the test case, it is compared directly to the output of get_makefile_filename().

    ======================================================================
    FAIL: test_srcdir (main.TestSysConfig)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/lib/python3.4/test/test_sysconfig.py", line 356, in test_srcdir
        srcdir)
    AssertionError: '//lib/python3.4/config-3.4dm' != '/lib/python3.4/config-3.4dm'
    - //lib/python3.4/config-3.4dm
    ? -
    + /lib/python3.4/config-3.4dm
    ~/cpython$ python3.4
    Python 3.4.0a3+ (default:dad1debba93c+, Oct 22 2013, 02:32:50)
    [GCC 4.4.3] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import sys
    >>> sys.prefix
    '/'
    >>> sys.base_prefix
    '/'
    >>>

    @sunfinite sunfinite mannequin added tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error labels Oct 21, 2013
    @pitrou
    Copy link
    Member

    pitrou commented Oct 23, 2013

    Patch looks fine to me.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Oct 23, 2013

    New changeset ef6eb5ce4f8e by Antoine Pitrou in branch '3.3':
    Issue bpo-19340: Fix test_sysconfig when Python is built with an empty prefix.
    http://hg.python.org/cpython/rev/ef6eb5ce4f8e

    New changeset f797a14cbcfd by Antoine Pitrou in branch 'default':
    Issue bpo-19340: Fix test_sysconfig when Python is built with an empty prefix.
    http://hg.python.org/cpython/rev/f797a14cbcfd

    @pitrou
    Copy link
    Member

    pitrou commented Oct 23, 2013

    Patched committed, thank you!

    @pitrou pitrou closed this as completed Oct 23, 2013
    @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
    tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant