check-code: check os.path.join(*, '') not working correctly with Python 2.7.9 stable
authorFUJIWARA Katsunori <foozy@lares.dti.ne.jp>
Wed, 22 Apr 2015 23:38:55 +0900
branchstable
changeset 24836 1f9127c9239b
parent 24835 e4f75c93f073
child 24837 edf907bd8144
child 24854 737b313af0c7
check-code: check os.path.join(*, '') not working correctly with Python 2.7.9 Since Python 2.7.9, "os.path.join(path, '')" doesn't append "os.sep" for UNC path (see issue4557 for detail).
contrib/check-code.py
--- a/contrib/check-code.py	Wed Apr 22 23:38:55 2015 +0900
+++ b/contrib/check-code.py	Wed Apr 22 23:38:55 2015 +0900
@@ -301,6 +301,8 @@
      "missing _() in ui message (use () to hide false-positives)"),
     (r'release\(.*wlock, .*lock\)', "wrong lock release order"),
     (r'\b__bool__\b', "__bool__ should be __nonzero__ in Python 2"),
+    (r'os\.path\.join\(.*, *(""|\'\')\)',
+     "use pathutil.normasprefix(path) instead of os.path.join(path, '')"),
   ],
   # warnings
   [