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

datetime type and timestamp type convert problem in qpid python client

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 0.18
    • Fix Version/s: None
    • Component/s: Python Client
    • Labels:
      None
    • Environment:

      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

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

              Dates

              • Created:
                Updated: