[ARVADOS] updated: fd0074f2200bc41bc63be770fffbe2446fb0cc03

git at public.curoverse.com git at public.curoverse.com
Wed Apr 1 15:50:11 EDT 2015


Summary of changes:
 sdk/python/arvados/arvfile.py   | 2 +-
 sdk/python/tests/test_stream.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

       via  fd0074f2200bc41bc63be770fffbe2446fb0cc03 (commit)
      from  5781ff2dc48f95b7554259e0210272e7de2d883b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit fd0074f2200bc41bc63be770fffbe2446fb0cc03
Author: Brett Smith <brett at curoverse.com>
Date:   Wed Apr 1 15:50:08 2015 -0400

    5627: Python file-like objects use SEET_SET as the default whence.
    
    This is a brown paper bag commit.  All that time I spent grumbling
    that we had the wrong default was completely incorrect.  We had it
    right earlier, and I blew it.  See
    <https://docs.python.org/2/library/stdtypes.html#file.seek>.
    
    Closes #5627.

diff --git a/sdk/python/arvados/arvfile.py b/sdk/python/arvados/arvfile.py
index 53ae4a8..3129bdf 100644
--- a/sdk/python/arvados/arvfile.py
+++ b/sdk/python/arvados/arvfile.py
@@ -77,7 +77,7 @@ class ArvadosFileReaderBase(_FileLikeObjectBase):
         return re.sub('\.(bz2|gz)$', '', self.name)
 
     @_FileLikeObjectBase._before_close
-    def seek(self, pos, whence=os.SEEK_CUR):
+    def seek(self, pos, whence=os.SEEK_SET):
         if whence == os.SEEK_CUR:
             pos += self._filepos
         elif whence == os.SEEK_END:
diff --git a/sdk/python/tests/test_stream.py b/sdk/python/tests/test_stream.py
index 15257fe..acb9929 100644
--- a/sdk/python/tests/test_stream.py
+++ b/sdk/python/tests/test_stream.py
@@ -48,7 +48,7 @@ class StreamFileReaderTestCase(unittest.TestCase):
         self.assertEqual('123456789', ''.join(sfile.readall()))
 
     def test_one_arg_seek(self):
-        self.test_relative_seek([])
+        self.test_absolute_seek([])
 
     def test_absolute_seek(self, args=[os.SEEK_SET]):
         sfile = self.make_count_reader()

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list