Closed tantale closed 8 years ago
Salut @tantale ! =)
This looks like an issue for cookiecutter, and not for cookiecutter-pypackage -- which this issue list is meant for.
Since cookiecutter has had a new release recently, would you be kind and try again with the latest release and submit an issue there if the problem persists? :)
Merci d'avance!
Hi,
The installation process fail on cleanup because of accentuated characters in error messages (French messages).
The stack trace:
How to reproduce:
pip install cookiecutter
.Everything should go fine except the cleanup…
If you retry
pip install cookiecutter
, it says:Diagnostic:
This is a classic error because MS-DOS in French use the codepage cp850. So
WindowsError
contains a byte string message with non-ASCII characters (like the "é" in "Le répertoire n’est pas vide"– "The directory is not empty").How to fix that:
Unfortunatly,
sys.getdefaultencoding()
doesn't work, it gives:ascii
which is the wrong answer. You should usesys.stdin.encoding
(if it is defined):That way, you can convert the byte string in unicode string using the
cp850
encoding, then convert accentuated characters in their non-accentuated equivalent.Here the convert function:
Hope it helps. – Laurent.