[sisyphus] python?

Ivan Fedorov =?iso-8859-1?q?ns_=CE=C1_altlinux=2Eru?=
Вс Июл 2 08:54:14 MSD 2006


Guest007 пишет:
> Приветствую!
> 
>>>> import sys
>>>> sys.setdefaultencoding('koi8-r')
> 
> Traceback (most recent call last):
>   File "<pyshell#1>", line 1, in -toplevel-
>     sys.setdefaultencoding('koi8-r')
> AttributeError: 'module' object has no attribute 'setdefaultencoding'
> 
> К чему бы это? Эта и ещё несколько функций описаны в доке и присутствуют в 
> теле интерпретатора (вместе с докстрингами). Однако не работает...
> 
> Раньше я таким пользовался -- код рабочий.
> 
> Сизиф свежий.

setdefaultencoding(  	name)
    Set the current default string encoding used by the Unicode
implementation. If name does not match any available encoding,
LookupError is raised. This function is only intended to be used by the
site module implementation and, where needed, by sitecustomize.

Once used by the site module, it is removed from the sys module's
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
namespace. New in version 2.0.
^^^^^^^^^^


>>> dir(sys)
[<SKIP> 'setappdefaultencoding' <SKIP>]
>>> sys.setappdefaultencoding('koi8-r')



----------- следующая часть -----------
Было удалено вложение не в текстовом формате...
Имя     : signature.asc
Тип     : application/pgp-signature
Размер  : 252 байтов
Описание: OpenPGP digital signature
Url     : <http://lists.altlinux.org/pipermail/sisyphus/attachments/20060702/a17547f4/attachment-0003.bin>


Подробная информация о списке рассылки Sisyphus