5 Star 15 Fork 1

limodou / parm

 / 详情

报字符集错误

待办的
创建于  
2015-02-12 12:46

字符集选择utf8、gbk、gb2312等都报错,错误提示如下:
Traceback (most recent call last):
File "D:\Python27\Scripts\parm-script.py", line 9, in
load_entry_point('parm==1.6', 'console_scripts', 'parm')()
File "D:\Python27\lib\site-packages\parm_init_.py", line 370, in main
call('parm', version, modules)
File "D:\Python27\lib\site-packages\parm\commands.py", line 121, in call
execute_command_line(args or sys.argv, get_commands(modules), prog_name, ver
sion)
File "D:\Python27\lib\site-packages\parm\commands.py", line 353, in execute_co
mmand_line
m.execute()
File "D:\Python27\lib\site-packages\parm\commands.py", line 337, in execute
cmd.run_from_argv(self.prog_name, subcommand, global_options, args[1:])
File "D:\Python27\lib\site-packages\parm\commands.py", line 183, in run_from_a
rgv
self.execute(args, options, global_options)
File "D:\Python27\lib\site-packages\parm\commands.py", line 187, in execute
self.handle(options, global_options, *args)
File "D:\Python27\lib\site-packages\parm_init_.py", line 94, in handle
text = template.template_file(conf_file, d).replace('\r\n', '\n')
File "D:\Python27\lib\site-packages\parm\template.py", line 733, in template_f
ile
return t()
File "D:\Python27\lib\site-packages\parm\template.py", line 687, in call
return self.run(code, filename or 'template')
File "D:\Python27\lib\site-packages\parm\template.py", line 722, in run
exec
(code, e)
File "D:\Python27\lib\site-packages\parm_compat.py", line 122, in exec

exec("""exec code in globs, locs""")
File "", line 1, in
File "d:\python27\lib\site-packages\parm\templates\env\conf.py.txt", line 12,
in
#encoding of md file
File "D:\Python27\lib\site-packages\parm\template.py", line 374, in write
s = self._str(text)
File "D:\Python27\lib\site-packages\parm\template.py", line 371, in _str
return u(text)
File "D:\Python27\lib\site-packages\parm_compat.py", line 104, in u
return unicode(str(s), encoding)
File "D:\Python27\lib\encodings\utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xb0 in position 0: invalid s
tart byte

评论 (1)

有没有一个简单的测试包,我试着运行一下。另外建议使用utf8编码,不要用gbk之类的编码。

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(2)
Python
1
https://gitee.com/limodou/parm.git
git@gitee.com:limodou/parm.git
limodou
parm
parm

搜索帮助