comparison cutils/util/__init__.py @ 166:ed45abb4940f

FIX: in util.normalize_filename(): use the 'u"' prefix in the else part for non-byte strings
author Franz Glasner <fzglas.hg@dom66.de>
date Thu, 09 Jan 2025 14:06:01 +0100
parents a813094ae4f5
children 804a823c63f5
comparison
equal deleted inserted replaced
165:b32b41297893 166:ed45abb4940f
154 filename = filename.replace(b"\\", b"/") 154 filename = filename.replace(b"\\", b"/")
155 if strip_leading_dot_slash: 155 if strip_leading_dot_slash:
156 while filename.startswith(b"./"): 156 while filename.startswith(b"./"):
157 filename = filename[2:] 157 filename = filename[2:]
158 else: 158 else:
159 filename = filename.replace("\\", "/") 159 filename = filename.replace(u"\\", u"/")
160 if strip_leading_dot_slash: 160 if strip_leading_dot_slash:
161 while filename.startswith("./"): 161 while filename.startswith(u"./"):
162 filename = filename[2:] 162 filename = filename[2:]
163 return filename 163 return filename
164 164
165 165
166 def fsencode(what): 166 def fsencode(what):