Uploaded image for project: 'Qpid'
  1. Qpid
  2. QPID-4804

datetime type and timestamp type convert problem in qpid python client

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 0.18
    • None
    • Python Client
    • None
    • RedHat Linux

    Description

      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 file:

        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()))"

      Attachments

        Activity

          People

            Unassigned Unassigned
            seabook1111 Fan Zhang
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: