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

datetime/xmlrpclib.DateTime comparison #42498

smontanaro opened this issue Oct 19, 2005 · 6 comments

datetime/xmlrpclib.DateTime comparison #42498

smontanaro opened this issue Oct 19, 2005 · 6 comments
stdlib Python modules in the Lib dir


Copy link

BPO 1330538
Nosy @freddrake, @smontanaro, @akuchling
  • xmlrpclib.diff
  • 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 = ''
    closed_at = <Date 2008-02-23.16:23:37.074>
    created_at = <Date 2005-10-19.02:46:18.000>
    labels = ['library']
    title = 'datetime/xmlrpclib.DateTime comparison'
    updated_at = <Date 2008-02-23.16:23:37.073>
    user = '' fields:

    activity = <Date 2008-02-23.16:23:37.073>
    actor = 'akuchling'
    assignee = 'akuchling'
    closed = True
    closed_date = <Date 2008-02-23.16:23:37.074>
    closer = 'akuchling'
    components = ['Library (Lib)']
    creation = <Date 2005-10-19.02:46:18.000>
    creator = 'skip.montanaro'
    dependencies = []
    files = ['6827']
    hgrepos = []
    issue_num = 1330538
    keywords = ['patch']
    message_count = 6.0
    messages = ['48876', '48877', '55564', '62578', '62763', '62765']
    nosy_count = 3.0
    nosy_names = ['fdrake', 'skip.montanaro', 'akuchling']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = ''
    versions = ['Python 2.5']

    Copy link
    Contributor Author

    Recent changes to xmlrpclib provided improved support for
    datetime objects. This patch improves that by adding
    support for comparison of xmlrpclib.DateTime objects with
    datetime.{datetime,date,time} objects.

    On the Mojam web server I run with an xmlrpclib module
    that is close to what Python 2.5 will have, though I
    use Python 2.3.4. The datetime support breaks the
    antispam BadContent support in MoinMoin's security
    policy because datetime objects and xmlrpclib.DateTime
    objects can't be compared. I believe this patch
    should solve that (though I haven't had time to test that
    yet). I've added new test cases to check support for
    comparing datetime.{datetime,date} objects with DateTime
    objects. I still need to add a test case to check support
    for comparing datetime.time objects.

    I believe something like this needs to go in 2.5 (maybe
    this should have been a bug report instead of patch).

    All Python test cases pass.

    @smontanaro smontanaro added the stdlib Python modules in the Lib dir label Oct 19, 2005
    @smontanaro smontanaro added the stdlib Python modules in the Lib dir label Oct 19, 2005
    Copy link
    Contributor Author

    Logged In: YES

    Based on inputs from python-dev I removed conversions of and
    comparisons with and datetime.time objects. I
    also tweaked it to work with Python 2.2 through Python 2.5
    (datetime support is unavailable in Python2.2). New patch is
    attached. I'd simply check this in except I've not done
    anything with rich comparisons before.

    Assigning to Fred since he's familiar with the code.

    Copy link
    Contributor Author

    Fred, can we move this forward?

    Copy link

    Skip, I can look at xmlrpclib issues.

    @akuchling akuchling assigned akuchling and unassigned freddrake Feb 20, 2008
    Copy link

    The patch looks OK.

    The python-dev discussion starts at

    I'm nervous about removing the ability to pass a date or time to
    the constructor, but the consensus was that this conversion was a bad
    idea, so I'll apply the patch as-is, and update the docs.

    Copy link

    Committed to 2.6 trunk in rev. 60991.

    @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
    stdlib Python modules in the Lib dir
    None yet

    No branches or pull requests

    3 participants