Created
July 16, 2018 13:30
-
-
Save Fhernd/a876d1a67f786015ab01efea989bf1f5 to your computer and use it in GitHub Desktop.
Nombre de archivo no decodificable. OrtizOL.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def nombre_archivo_invalido(nombre_archivo): | |
return repr(nombre_archivo)[1:-1] | |
nombre_archivo = 'mal\udce4.txt' | |
try: | |
print(nombre_archivo) | |
print('Pasó la prueba') | |
except UnicodeEncodeError: | |
print(nombre_archivo_invalido(nombre_archivo)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment