qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Riedemann (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (QPID-4804) datetime type and timestamp type convert problem in qpid python client
Date Mon, 14 Oct 2013 15:19:43 GMT

     [ https://issues.apache.org/jira/browse/QPID-4804?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Matt Riedemann updated QPID-4804:

    Attachment: bug-4804-datetime-timestamp-conversion-fix.patch

Here is a patch that I'm applying to the 0.18 version of python-qpid to make this work with
OpenStack Nova for Grizzly 2013.1.3.

> datetime type and timestamp type convert problem in qpid python client
> ----------------------------------------------------------------------
>                 Key: QPID-4804
>                 URL: https://issues.apache.org/jira/browse/QPID-4804
>             Project: Qpid
>          Issue Type: Bug
>          Components: Python Client
>    Affects Versions: 0.18
>         Environment: RedHat Linux
>            Reporter: Fan Zhang
>         Attachments: bug-4804-datetime-timestamp-conversion-fix.patch
> When client input a value which is datetime type to qpid server, then server receive
this value from qpid server, this value's type become timestamp(qpid.datatypes.timestamp),
I think the value's type shouldn't change to timestamp.
> I think this code do the conversion in /usr/lib/python2.6/site-packages/qpid/codec010.py
>   def read_datetime(self):
>     return timestamp(self.read_uint64())
>   def write_datetime(self, t):
>     if isinstance(t, datetime.datetime):
>       t = timestamp(t)
>     self.write_uint64(t)
> I think maybe we need change code like this, change "return timestamp(self.read_uint64())"
to "return datetime.datetime.fromtimestamp(timestamp(self.read_uint64()))"

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org

View raw message