You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by ph...@apache.org on 2010/08/24 07:02:37 UTC

svn commit: r988388 - in /avro/trunk: CHANGES.txt lang/py/src/avro/ipc.py lang/py/test/test_ipc.py

Author: philz
Date: Tue Aug 24 05:02:37 2010
New Revision: 988388

URL: http://svn.apache.org/viewvc?rev=988388&view=rev
Log:
AVRO-622. python avro.ipc doesn't work with python2.4

Added:
    avro/trunk/lang/py/test/test_ipc.py
Modified:
    avro/trunk/CHANGES.txt
    avro/trunk/lang/py/src/avro/ipc.py

Modified: avro/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/avro/trunk/CHANGES.txt?rev=988388&r1=988387&r2=988388&view=diff
==============================================================================
--- avro/trunk/CHANGES.txt (original)
+++ avro/trunk/CHANGES.txt Tue Aug 24 05:02:37 2010
@@ -138,6 +138,8 @@ Avro 1.4.0 (unreleased)
 
   BUG FIXES
 
+    AVRO-622. python avro.ipc doesn't work with python2.4 (philz)
+
     AVRO-620. Python implementation doesn't stringify sub-schemas 
     correctly. (philz)
 

Modified: avro/trunk/lang/py/src/avro/ipc.py
URL: http://svn.apache.org/viewvc/avro/trunk/lang/py/src/avro/ipc.py?rev=988388&r1=988387&r2=988388&view=diff
==============================================================================
--- avro/trunk/lang/py/src/avro/ipc.py (original)
+++ avro/trunk/lang/py/src/avro/ipc.py Tue Aug 24 05:02:37 2010
@@ -21,7 +21,6 @@ try:
   from cStringIO import StringIO
 except ImportError:
   from StringIO import StringIO
-import struct
 from avro import io
 from avro import protocol
 from avro import schema
@@ -54,7 +53,7 @@ SYSTEM_ERROR_SCHEMA = schema.parse('["st
 REMOTE_HASHES = {}
 REMOTE_PROTOCOLS = {}
 
-BIG_ENDIAN_INT_STRUCT = struct.Struct('!I')
+BIG_ENDIAN_INT_STRUCT = io.struct_class('!I')
 BUFFER_HEADER_LENGTH = 4
 BUFFER_SIZE = 8192
 

Added: avro/trunk/lang/py/test/test_ipc.py
URL: http://svn.apache.org/viewvc/avro/trunk/lang/py/test/test_ipc.py?rev=988388&view=auto
==============================================================================
--- avro/trunk/lang/py/test/test_ipc.py (added)
+++ avro/trunk/lang/py/test/test_ipc.py Tue Aug 24 05:02:37 2010
@@ -0,0 +1,31 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""
+There are currently no IPC tests within python, in part because there are no
+servers yet available.
+"""
+import unittest
+
+# This test does import this code, to make sure it at least passes
+# compilation.
+import avro.ipc
+
+class TestIPC(unittest.TestCase):
+  def test_placeholder(self):
+    pass
+
+if __name__ == '__main__':
+  unittest.main()