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.linux_distribution detects Oracle Linux as Red Hat Enterprise Linux #63412

Closed
javawizard mannequin opened this issue Oct 9, 2013 · 8 comments
Closed

platform.linux_distribution detects Oracle Linux as Red Hat Enterprise Linux #63412

javawizard mannequin opened this issue Oct 9, 2013 · 8 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@javawizard
Copy link
Mannequin

javawizard mannequin commented Oct 9, 2013

BPO 19213
Nosy @malemburg, @birkenfeld, @terryjreedy, @pitrou, @merwok, @bitdancer, @encukou
PRs
  • bpo-19213: Adding support for Oracle OS distribution in platform.py #6626
  • Files
  • oracle-release: /etc/oracle-release
  • 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 2018-05-25.17:18:16.138>
    created_at = <Date 2013-10-09.21:14:58.067>
    labels = ['type-bug', 'library']
    title = 'platform.linux_distribution detects Oracle Linux as Red Hat Enterprise Linux'
    updated_at = <Date 2018-05-25.17:20:47.128>
    user = 'https://bugs.python.org/javawizard'

    bugs.python.org fields:

    activity = <Date 2018-05-25.17:20:47.128>
    actor = 'petr.viktorin'
    assignee = 'none'
    closed = True
    closed_date = <Date 2018-05-25.17:18:16.138>
    closer = 'petr.viktorin'
    components = ['Library (Lib)']
    creation = <Date 2013-10-09.21:14:58.067>
    creator = 'javawizard'
    dependencies = []
    files = ['32147']
    hgrepos = []
    issue_num = 19213
    keywords = ['patch']
    message_count = 8.0
    messages = ['199345', '199352', '200083', '200087', '200178', '200180', '317688', '317690']
    nosy_count = 10.0
    nosy_names = ['lemburg', 'georg.brandl', 'terry.reedy', 'pitrou', 'eric.araujo', 'r.david.murray', 'petr.viktorin', 'westley.martinez', 'python-dev', 'javawizard']
    pr_nums = ['6626']
    priority = 'normal'
    resolution = 'out of date'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue19213'
    versions = ['Python 2.6', 'Python 2.7', 'Python 3.3', 'Python 3.4']

    @javawizard
    Copy link
    Mannequin Author

    javawizard mannequin commented Oct 9, 2013

    Tested on 3.3.2 and 2.6.6.

    On Oracle Linux, platform.linux_distribution detects the current distribution as Red Hat Enterprise Linux:

    >>> import platform
    >>> platform.linux_distribution()
    ('Red Hat Enterprise Linux Server', '6.2', 'Santiago')

    I would have expected something along the lines of:

    >>> import platform
    >>> platform.linux_distribution()
    ('Oracle Linux', '6.2', '')

    Or perhaps ('Oracle Linux Server', '6.2', '').

    @javawizard javawizard mannequin added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Oct 9, 2013
    @bitdancer
    Copy link
    Member

    You might expect that, but platform.linux_distribution is basing its report on what is in /etc/xxx-version or xxx-release. Most likely this is an Oracle "bug", although they might be providing both their own version file and the version file for the RH release they are basing off of, in which case we could perhaps tweak the platform code to take that into account.

    Can you figure out which it is?

    @javawizard
    Copy link
    Mannequin Author

    javawizard mannequin commented Oct 16, 2013

    They're providing both /etc/oracle-release and /etc/redhat-release (as Oracle Linux is based on RHEL).

    I've attached /etc/oracle-release for reference.

    @bitdancer
    Copy link
    Member

    Gah. Well, by good fortune 'o' comes before 'r' in the alphabet, so it should be enough to just add 'oracle' to the list of _supported_dists in platform.py. Can you test that and confirm it?

    @javawizard
    Copy link
    Mannequin Author

    javawizard mannequin commented Oct 17, 2013

    Yep, that fixes it.

    @bitdancer
    Copy link
    Member

    Based on Marc-Andre recommendation at the end of bpo-11678, I plan to commit this as a bug fix, and add arch to 2.7 while I'm at it. Unless there are objections.

    @encukou
    Copy link
    Member

    encukou commented May 25, 2018

    linux_distribution is removed in Python 3.7.
    Closing.

    @encukou encukou closed this as completed May 25, 2018
    @encukou
    Copy link
    Member

    encukou commented May 25, 2018

    Er, sorry, I meant in 3.8.

    @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
    stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants