Rev 2495: Revert back to base64.encodestring() It seems codes.encoder() is actually a wrapper around encodestring() not the other way around. in http://bazaar.launchpad.net/%7Ebzr/bzr/dirstate

John Arbash Meinel john at arbash-meinel.com
Fri Mar 2 03:20:49 GMT 2007


At http://bazaar.launchpad.net/%7Ebzr/bzr/dirstate

------------------------------------------------------------
revno: 2495
revision-id: john at arbash-meinel.com-20070302031949-02axv3fix1qfkuqq
parent: robertc at robertcollins.net-20070302025830-o4lth4e9hqyq8stx
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: dirstate
timestamp: Thu 2007-03-01 21:19:49 -0600
message:
  Revert back to base64.encodestring() It seems codes.encoder() is actually a wrapper around encodestring() not the other way around.
modified:
  bzrlib/dirstate.py             dirstate.py-20060728012006-d6mvoihjb3je9peu-1
-------------- next part --------------
=== modified file 'bzrlib/dirstate.py'
--- a/bzrlib/dirstate.py	2007-03-02 02:11:59 +0000
+++ b/bzrlib/dirstate.py	2007-03-02 03:19:49 +0000
@@ -191,8 +191,8 @@
 """
 
 
+import base64
 import bisect
-import codecs
 import errno
 import os
 from stat import S_IEXEC
@@ -2213,10 +2213,8 @@
     return lo
 
 
-_base64_encoder = codecs.getencoder('base64')
-
-
-def pack_stat(st, _encode=_base64_encoder, _pack=struct.pack):
+
+def pack_stat(st, _encode=base64.encodestring, _pack=struct.pack):
     """Convert stat values into a packed representation."""
     # jam 20060614 it isn't really worth removing more entries if we
     # are going to leave it in packed form.
@@ -2227,4 +2225,4 @@
     # base64.encode always adds a final newline, so strip it off
     return _encode(_pack('>llllll'
         , st.st_size, int(st.st_mtime), int(st.st_ctime)
-        , st.st_dev, st.st_ino, st.st_mode))[0][:-1]
+        , st.st_dev, st.st_ino, st.st_mode))[:-1]



More information about the bazaar-commits mailing list