Patchwork D5649: config: reject str sections and keys on Python 3

login
register
mail settings
Submitter phabricator
Date Jan. 23, 2019, 5:50 a.m.
Message ID <756b02af48090b4e85e791ace80dd766@localhost.localdomain>
Download mbox | patch
Permalink /patch/37920/
State Not Applicable
Headers show

Comments

phabricator - Jan. 23, 2019, 5:50 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG4ad002b2584d: config: reject str sections and keys on Python 3 (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5649?vs=13345&id=13361

REVISION DETAIL
  https://phab.mercurial-scm.org/D5649

AFFECTED FILES
  mercurial/config.py

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/config.py b/mercurial/config.py
--- a/mercurial/config.py
+++ b/mercurial/config.py
@@ -78,6 +78,10 @@ 
         return list(self._data.get(section, {}).iteritems())
     def set(self, section, item, value, source=""):
         if pycompat.ispy3:
+            assert not isinstance(section, str), (
+                'config section may not be unicode strings on Python 3')
+            assert not isinstance(item, str), (
+                'config item may not be unicode strings on Python 3')
             assert not isinstance(value, str), (
                 'config values may not be unicode strings on Python 3')
         if section not in self: