Am 20.01.2011 10:04, schrieb raymond.hettinger:

> +os
> +--
> +
> +Different operating systems use various encodings for filenames and 
> environment
> +variables.  The :mod:`os` module provides two new functions,
> +:func:`~os.fsencode` and :func:`~os.fsdecode`, for encoding and decoding
> +filenames:
> +
> +>>> filename = 'словарь'
> +>>> os.fsencode(filename)
> +b'\xd1\x81\xd0\xbb\xd0\xbe\xd0\xb2\xd0\xb0\xd1\x80\xd1\x8c'
> +>>> open(os.fsencode(filename))

Please do not include Cyrillic characters directly in the source -- it breaks
the LaTeX PDF build.  A non-ascii name from the latin-1 range should be fine.

Georg

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to