diff contrib/byteify-strings.py @ 44559:bc9a9016467d stable

byteify-string: resolve symlink before byteifying Otherwise the script turns symlinks into regular files.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 18 Mar 2020 21:27:45 +0100
parents 09234eeae206
children 89a2afe31e82
line wrap: on
line diff
--- a/contrib/byteify-strings.py	Thu Mar 12 15:23:47 2020 +0100
+++ b/contrib/byteify-strings.py	Wed Mar 18 21:27:45 2020 +0100
@@ -328,6 +328,7 @@
         'allow-attr-methods': args.allow_attr_methods,
     }
     for fname in args.files:
+        fname = os.path.realpath(fname)
         if args.inplace:
             with editinplace(fname) as fout:
                 with open(fname, 'rb') as fin: