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

os.times() utime and stime exchanged on windows #46339

Closed
kcwu mannequin opened this issue Feb 11, 2008 · 4 comments
Closed

os.times() utime and stime exchanged on windows #46339

kcwu mannequin opened this issue Feb 11, 2008 · 4 comments
Assignees
Labels
extension-modules C modules in the Modules dir OS-windows type-bug An unexpected behavior, bug, or error

Comments

@kcwu
Copy link
Mannequin

kcwu mannequin commented Feb 11, 2008

BPO 2063
Nosy @birkenfeld, @facundobatista, @amauryfa, @tiran
Files
  • diff-win-os-times.txt: patch for trunk
  • 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 = 'https://github.com/tiran'
    closed_at = <Date 2008-02-13.07:20:34.546>
    created_at = <Date 2008-02-11.07:41:36.373>
    labels = ['extension-modules', 'type-bug', 'OS-windows']
    title = 'os.times() utime and stime exchanged on windows'
    updated_at = <Date 2008-02-13.07:20:34.515>
    user = 'https://bugs.python.org/kcwu'

    bugs.python.org fields:

    activity = <Date 2008-02-13.07:20:34.515>
    actor = 'georg.brandl'
    assignee = 'christian.heimes'
    closed = True
    closed_date = <Date 2008-02-13.07:20:34.546>
    closer = 'georg.brandl'
    components = ['Extension Modules', 'Windows']
    creation = <Date 2008-02-11.07:41:36.373>
    creator = 'kcwu'
    dependencies = []
    files = ['9406']
    hgrepos = []
    issue_num = 2063
    keywords = ['patch']
    message_count = 4.0
    messages = ['62274', '62313', '62316', '62352']
    nosy_count = 5.0
    nosy_names = ['georg.brandl', 'facundobatista', 'amaury.forgeotdarc', 'christian.heimes', 'kcwu']
    pr_nums = []
    priority = 'high'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue2063'
    versions = ['Python 2.6', 'Python 2.5', 'Python 3.0']

    @kcwu
    Copy link
    Mannequin Author

    kcwu mannequin commented Feb 11, 2008

    According to document, os.times()[0] is process user time, [1] is system
    time. However this two value was implemented exchanged on windows.

    Python all versions have this issue. Attached patch is for trunk.

    @kcwu kcwu mannequin added extension-modules C modules in the Modules dir OS-windows type-bug An unexpected behavior, bug, or error labels Feb 11, 2008
    @tiran tiran self-assigned this Feb 11, 2008
    @facundobatista
    Copy link
    Member

    How can we test it? What can we do to "see" it?

    @amauryfa
    Copy link
    Member

    As a suggestion, we could just run some computation that does no system
    call:

    >>> import os
    >>> os.times()
    (0.015625, 0.015625, 0.0, 0.0, 0.0)
    >>> max(xrange(10000000))   # this takes half a second on my machine
    9999999
    >>> os.times()
    (0.015625, 0.484375, 0.0, 0.0, 0.0)

    utime delta should be much higher than stime delta. This is obviously
    not the case here; the values seems inverted.
    (os.times() -> (utime, stime, cutime, cstime, elapsed_time))

    @birkenfeld
    Copy link
    Member

    Fixed on trunk in r60758. Should this be backported?

    @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
    extension-modules C modules in the Modules dir OS-windows type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants