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

Please support CLOCK_TAI in the time module. #84198

Closed
r-owen mannequin opened this issue Mar 19, 2020 · 3 comments
Closed

Please support CLOCK_TAI in the time module. #84198

r-owen mannequin opened this issue Mar 19, 2020 · 3 comments
Labels
3.8 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@r-owen
Copy link
Mannequin

r-owen mannequin commented Mar 19, 2020

BPO 40017
Nosy @vstinner, @benjaminp, @r-owen
PRs
  • bpo-40017: add CLOCK_TAI constant to the time module, if the constant is defined #19096
  • 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 2020-03-24.03:41:46.925>
    created_at = <Date 2020-03-19.19:14:59.079>
    labels = ['3.8', 'type-feature', 'library']
    title = 'Please support CLOCK_TAI in the time module.'
    updated_at = <Date 2020-03-24.03:41:46.924>
    user = 'https://github.com/r-owen'

    bugs.python.org fields:

    activity = <Date 2020-03-24.03:41:46.924>
    actor = 'benjamin.peterson'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-03-24.03:41:46.925>
    closer = 'benjamin.peterson'
    components = ['Library (Lib)']
    creation = <Date 2020-03-19.19:14:59.079>
    creator = 'r3owen'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 40017
    keywords = ['patch']
    message_count = 3.0
    messages = ['364633', '364637', '364915']
    nosy_count = 3.0
    nosy_names = ['vstinner', 'benjamin.peterson', 'r3owen']
    pr_nums = ['19096']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue40017'
    versions = ['Python 3.8']

    @r-owen
    Copy link
    Mannequin Author

    r-owen mannequin commented Mar 19, 2020

    It is becoming common (at least in astronomy) to want to use TAI as a time standard because it is a uniform time with no leap seconds, and differs from UTC (standard computer clock time) by an integer number of seconds that occasionally changes.

    Linux offers a clock for TAI time: CLOCK_TAI. It would be very helpful to have this constant in the time module, e.g. for calling time.clock_gettime

    Caveat: linux CLOCK_TAI will return UTC time if the leap second table has not been set up. Both ntp and ptp can be configured to maintain this table. So this is a caveat worth mentioning in the docs. But I hope it is not sufficient reason to deny the request.

    @r-owen r-owen mannequin added 3.8 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Mar 19, 2020
    @benjaminp
    Copy link
    Contributor

    I think we could certainly take a patch to expose that constant if libc/kernel headers expose it.

    @benjaminp
    Copy link
    Contributor

    New changeset 6000087 by Russell Owen in branch 'master':
    closes bpo-40017: Add CLOCK_TAI constant to the time module. (GH-19096)
    6000087

    @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
    3.8 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant