[PATCH] D56754: Add Support for Creating and Deleting Unicode Files and Directories in Lit

serge via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 8 02:47:19 PST 2019


serge-sans-paille added a comment.

@jmittert I tried the following (simpler) patch on Linux and it seems to work nice for both Python2 and Python3

  Index: lit/TestRunner.py
  ===================================================================
  --- lit/TestRunner.py	(revision 353501)
  +++ lit/TestRunner.py	(working copy)
  @@ -345,7 +345,7 @@
       exitCode = 0
       for dir in args:
           if not os.path.isabs(dir):
  -            dir = os.path.realpath(os.path.join(cmd_shenv.cwd, dir))
  +            dir = os.path.realpath(to_bytes(os.path.join(cmd_shenv.cwd, dir)))
           if parent:
               lit.util.mkdir_p(dir)
           else:
  @@ -599,7 +599,7 @@
       exitCode = 0
       for path in args:
           if not os.path.isabs(path):
  -            path = os.path.realpath(os.path.join(cmd_shenv.cwd, path))
  +            path = os.path.realpath(to_bytes(os.path.join(cmd_shenv.cwd, path)))
           if force and not os.path.exists(path):
               continue
           try:
  @@ -695,7 +695,7 @@
           else:
               # Make sure relative paths are relative to the cwd.
               redir_filename = os.path.join(cmd_shenv.cwd, name)
  -            fd = open(redir_filename, mode)
  +            fd = open(to_bytes(redir_filename), mode)
           # Workaround a Win32 and/or subprocess bug when appending.
           #
           # FIXME: Actually, this is probably an instance of PR6753.

What do you think of this path?


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56754/new/

https://reviews.llvm.org/D56754





More information about the llvm-commits mailing list