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

Closed
smontanaro opened this issue Oct 19, 2005 · 6 comments
Closed

datetime/xmlrpclib.DateTime comparison #42498

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

Comments

@smontanaro
Copy link
Contributor

BPO 1330538
Nosy @freddrake, @smontanaro, @akuchling
Files
  • 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 = 'https://github.com/akuchling'
    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 = 'https://github.com/smontanaro'

    bugs.python.org 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 = 'https://bugs.python.org/issue1330538'
    versions = ['Python 2.5']

    @smontanaro
    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
    @smontanaro
    Copy link
    Contributor Author

    Logged In: YES
    user_id=44345

    Based on inputs from python-dev I removed conversions of and
    comparisons with datetime.date 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.

    @smontanaro
    Copy link
    Contributor Author

    Fred, can we move this forward?

    @akuchling
    Copy link
    Member

    Skip, I can look at xmlrpclib issues.

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

    The patch looks OK.

    The python-dev discussion starts at
    http://mail.python.org/pipermail/python-dev/2005-October/057514.html.

    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.

    @akuchling
    Copy link
    Member

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

    No branches or pull requests

    3 participants