equal
deleted
inserted
replaced
193 if sys.platform == 'darwin': |
193 if sys.platform == 'darwin': |
194 import fcntl # only needed on darwin, missing on jython |
194 import fcntl # only needed on darwin, missing on jython |
195 |
195 |
196 def normcase(path): |
196 def normcase(path): |
197 try: |
197 try: |
|
198 path.decode('ascii') # throw exception for non-ASCII character |
|
199 return path.lower() |
|
200 except UnicodeDecodeError: |
|
201 pass |
|
202 try: |
198 u = path.decode('utf-8') |
203 u = path.decode('utf-8') |
199 except UnicodeDecodeError: |
204 except UnicodeDecodeError: |
200 # percent-encode any characters that don't round-trip |
205 # percent-encode any characters that don't round-trip |
201 p2 = path.decode('utf-8', 'ignore').encode('utf-8') |
206 p2 = path.decode('utf-8', 'ignore').encode('utf-8') |
202 s = "" |
207 s = "" |