Rev 5992: Those are just bytes. in file:///home/vila/src/bzr/bugs/799212-non-ascii-confs/

Vincent Ladeuil v.ladeuil+lp at free.fr
Mon Jun 20 14:03:40 UTC 2011


At file:///home/vila/src/bzr/bugs/799212-non-ascii-confs/

------------------------------------------------------------
revno: 5992
revision-id: v.ladeuil+lp at free.fr-20110620140340-mtij9ioyc58ot3is
parent: v.ladeuil+lp at free.fr-20110620135854-venf3fbpk7ggqbc9
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: 799212-non-ascii-confs
timestamp: Mon 2011-06-20 16:03:40 +0200
message:
  Those are just bytes.
-------------- next part --------------
=== modified file 'bzrlib/config.py'
--- a/bzrlib/config.py	2011-06-20 13:58:54 +0000
+++ b/bzrlib/config.py	2011-06-20 14:03:40 +0000
@@ -2298,14 +2298,10 @@
         """Loads the Store from persistent storage."""
         raise NotImplementedError(self.load)
 
-    def _load_from_string(self, str_or_unicode):
+    def _load_from_string(self, bytes):
         """Create a store from a string in configobj syntax.
 
-        :param str_or_unicode: A string representing the file content. This will
-            be encoded to suit store needs internally.
-
-        This is for tests and should not be used in production unless a
-        convincing use case can be demonstrated :)
+        :param bytes: A string representing the file content.
         """
         raise NotImplementedError(self._load_from_string)
 
@@ -2383,15 +2379,14 @@
         for hook in ConfigHooks['load']:
             hook(self)
 
-    def _load_from_string(self, str_or_unicode):
+    def _load_from_string(self, bytes):
         """Create a config store from a string.
 
-        :param str_or_unicode: A string representing the file content. This will
-            be utf-8 encoded internally.
+        :param bytes: A string representing the file content.
         """
         if self.is_loaded():
             raise AssertionError('Already loaded: %r' % (self._config_obj,))
-        co_input = StringIO(str_or_unicode)
+        co_input = StringIO(bytes)
         try:
             # The config files are always stored utf8-encoded
             self._config_obj = ConfigObj(co_input, encoding='utf-8')



More information about the bazaar-commits mailing list