1. PyPA
  2. Python Packaging Authority Projects
  3. distlib

Commits

Vinay Sajip  committed 23ba306

Canonicalise JSON output.

  • Participants
  • Parent commits c755876
  • Branches default

Comments (0)

Files changed (1)

File distlib/metadata.py

View file
             else:
                 d = self._data
             if fileobj:
-                json.dump(d, fileobj, ensure_ascii=True, indent=2)
+                json.dump(d, fileobj, ensure_ascii=True, indent=2,
+                          sort_keys=True)
             else:
                 with codecs.open(path, 'w', 'utf-8') as f:
-                    json.dump(d, f, ensure_ascii=True, indent=2)
+                    json.dump(d, f, ensure_ascii=True, indent=2,
+                              sort_keys=True)
 
     def add_requirements(self, requirements):
         if self._legacy: