ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: "Ivan A. Melnikov" <ivan.a.melnikov@gmail.com>
To: ALT Linux Team development discussions <devel@lists.altlinux.org>
Subject: Re: [devel] python & utf8
Date: Fri, 29 Nov 2013 12:35:57 +0400
Message-ID: <529851ED.6070906@gmail.com> (raw)
In-Reply-To: <529849DE.9070703@kemsu.ru>

On 29.11.2013 12:01, REAL wrote:
> Привет!
> 
> Что может помочь в такой ситуации?
> 
> Traceback (most recent call last):
>   File "/usr/bin/2to3", line 5, in <module>
>     sys.exit(main("lib2to3.fixes"))
>   File "/usr/lib64/python2.7/lib2to3/main.py", line 260, in main
>     options.processes)
>   File "/usr/lib64/python2.7/lib2to3/refactor.py", line 706, in refactor
>     items, write, doctests_only)
>   File "/usr/lib64/python2.7/lib2to3/refactor.py", line 301, in refactor
>     self.refactor_file(dir_or_file, write, doctests_only)
>   File "/usr/lib64/python2.7/lib2to3/refactor.py", line 747, in
> refactor_file
>     *args, **kwargs)
>   File "/usr/lib64/python2.7/lib2to3/refactor.py", line 341, in
> refactor_file
>     input, encoding = self._read_python_source(filename)
>   File "/usr/lib64/python2.7/lib2to3/refactor.py", line 337, in
> _read_python_source
>     return _from_system_newlines(f.read()), encoding
>   File "/usr/lib64/python2.7/codecs.py", line 671, in read
>     return self.reader.read(size)
>   File "/usr/lib64/python2.7/codecs.py", line 477, in read
>     newchars, decodedbytes = self.decode(data, self.errors)
> UnicodeDecodeError: 'utf8' codec can't decode byte 0xc8 in position 99:
> invalid continuation byte
> 

Скорее всего это означает, что файл, который 2to3 пытается открыть как
UTF8, UTF8 не является. Нужно посмотреть, что это за файл, и либо
исправить его приведя к валидному UTF8, либо как-то объяснить 2to3 что
это файл в другой кодировке (например, latin-1). Подробнее по этому
стектрейсу сказать трудно.

-- 
WBR,
Ivan A. Melnikov


      reply	other threads:[~2013-11-29  8:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-29  8:01 REAL
2013-11-29  8:35 ` Ivan A. Melnikov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=529851ED.6070906@gmail.com \
    --to=ivan.a.melnikov@gmail.com \
    --cc=devel@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git