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

platform.architecture() fails if python is lanched via its symbolic link (cygwin) #48012

Closed
ocean-city mannequin opened this issue Sep 3, 2008 · 5 comments
Closed

platform.architecture() fails if python is lanched via its symbolic link (cygwin) #48012

ocean-city mannequin opened this issue Sep 3, 2008 · 5 comments
Labels
easy stdlib Python modules in the Lib dir

Comments

@ocean-city
Copy link
Mannequin

ocean-city mannequin commented Sep 3, 2008

BPO 3762
Nosy @amauryfa
Files
  • platform_v2.patch
  • platform.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 2008-09-04.11:25:14.305>
    created_at = <Date 2008-09-03.07:04:22.964>
    labels = ['easy', 'library']
    title = 'platform.architecture() fails if python is lanched via its symbolic link (cygwin)'
    updated_at = <Date 2008-09-04.11:25:14.304>
    user = 'https://bugs.python.org/ocean-city'

    bugs.python.org fields:

    activity = <Date 2008-09-04.11:25:14.304>
    actor = 'ocean-city'
    assignee = 'none'
    closed = True
    closed_date = <Date 2008-09-04.11:25:14.305>
    closer = 'ocean-city'
    components = ['Library (Lib)']
    creation = <Date 2008-09-03.07:04:22.964>
    creator = 'ocean-city'
    dependencies = []
    files = ['11353', '11355']
    hgrepos = []
    issue_num = 3762
    keywords = ['patch', 'easy']
    message_count = 5.0
    messages = ['72376', '72377', '72378', '72488', '72493']
    nosy_count = 2.0
    nosy_names = ['amaury.forgeotdarc', 'ocean-city']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue3762'
    versions = ['Python 2.6', 'Python 2.5', 'Python 3.0']

    @ocean-city
    Copy link
    Mannequin Author

    ocean-city mannequin commented Sep 3, 2008

    I created symbolic link to python.exe as dummy.exe on cygwin.
    But I noticed platform.architecture() printed ('32bit', '')

    $ ./dummy
    Python 2.6b3+ (trunk:66166M, Sep  3 2008, 06:43:59)
    [GCC 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)] on cygwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import platform
    >>> platform._follow_symlinks("dummy.exe")
    '/home/WhiteRabbit/python-dev/trunk/dummy.exe/python.exe'
    >>>

    Is this _follow_symlinks's intended behavior? If no, I hope attached
    patch will fix problem. Now platform.architecture() prints
    ('32bit', 'WindowsPE')

    @ocean-city
    Copy link
    Mannequin Author

    ocean-city mannequin commented Sep 3, 2008

    • But I noticed platform.architecture() printed ('32bit', '')
      + But I noticed platform.architecture() printed ('32bit', '')
      when I lanched python via dummy.exe

    @ocean-city ocean-city mannequin added the stdlib Python modules in the Lib dir label Sep 3, 2008
    @ocean-city
    Copy link
    Mannequin Author

    ocean-city mannequin commented Sep 3, 2008

    This sliped out of my mind. :-(

    [bpo-3719]

    Python versions and must at least support Python 2.1.

    os.path.realpath is new feature in Python2.2, so probably this cannot be
    used. I attached another patch platform_v2.patch.

    @ocean-city ocean-city mannequin added the easy label Sep 4, 2008
    @amauryfa
    Copy link
    Member

    amauryfa commented Sep 4, 2008

    The problem shows up on other platforms as well.
    The following comes from a standard Debian 64bit:

    $ /usr/bin/python -c "import platform; print platform.architecture()"
    ('64bit', '')
    $ /usr/bin/python2.4 -c "import platform; print platform.architecture()"
    ('64bit', 'ELF')

    And the patch corrects this.

    @ocean-city
    Copy link
    Mannequin Author

    ocean-city mannequin commented Sep 4, 2008

    Thanks, fixed in r66213(trunk), r66214(release-maint25), r66216(py3k).

    @ocean-city ocean-city mannequin closed this as completed Sep 4, 2008
    @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
    easy stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant