E:\project>Build.py client_build\dbclient.spec
checking Analysis
building Analysis because outAnalysis0.toc non existent
running Analysis outAnalysis0.toc
Analyzing: E:\dev\pyinstaller-1.4\support\_mountzlib.py
Analyzing: E:\dev\pyinstaller-1.4\support\useTK.py
Analyzing: E:\dev\pyinstaller-1.4\support\useUnicode.py
Analyzing: dbclient
Traceback (most recent call last):
File "E:\dev\pyinstaller-1.4\Build.py", line 1160, in <module>
main(args[0], configfilename=opts.configfile)
File "E:\dev\pyinstaller-1.4\Build.py", line 1148, in main
build(specfile)
File "E:\dev\pyinstaller-1.4\Build.py", line 1111, in build
execfile(spec)
File "dbclient.spec", line 3, in <module>
pathex=['E:\\project'])
File "E:\dev\pyinstaller-1.4\Build.py", line 245, in __init__
self.__postinit__()
File "E:\dev\pyinstaller-1.4\Build.py", line 196, in __postinit__
self.assemble()
File "E:\dev\pyinstaller-1.4\Build.py", line 314, in assemble
analyzer.analyze_script(script)
File "E:\dev\pyinstaller-1.4\mf.py", line 558, in analyze_script
stuff = open(fnm, 'r').read()+'\n'
IOError: [Errno 13] Permission denied: 'dbclient'
E:\project>
building Analysis because outAnalysis0.toc non existent
running Analysis outAnalysis0.toc
Analyzing: E:\dev\pyinstaller-1.4\support\_mountzlib.py
Analyzing: E:\dev\pyinstaller-1.4\support\useTK.py
Analyzing: E:\dev\pyinstaller-1.4\support\useUnicode.py
Analyzing: dbclient
Traceback (most recent call last):
main(args[0], configfilename=opts.configfile)
File "E:\dev\pyinstaller-1.4\Build.py", line 1148, in main
build(specfile)
File "E:\dev\pyinstaller-1.4\Build.py", line 1111, in build
execfile(spec)
File "dbclient.spec", line 3, in <module>
pathex=['E:\\project'])
File "E:\dev\pyinstaller-1.4\Build.py", line 245, in __init__
self.__postinit__()
File "E:\dev\pyinstaller-1.4\Build.py", line 196, in __postinit__
self.assemble()
File "E:\dev\pyinstaller-1.4\Build.py", line 314, in assemble
analyzer.analyze_script(script)
File "E:\dev\pyinstaller-1.4\mf.py", line 558, in analyze_script
stuff = open(fnm, 'r').read()+'\n'
IOError: [Errno 13] Permission denied: 'dbclient'
E:\project>
正确命令:
E:\project>Makespec -F -K -d -w -X -o client_build e:\project\dbclient\daybang.pyw
界面文字编码错误
解决办法:所有中文都这样写 u'中文'
数据库中取出数据的编码错误:
都解码成utf-8,如:r [ 0 ].decode( 'utf-8' )
目录处理:
# self.LocalDir = os.path.join(os.path.dirname(__file__), "download") 不可行
self.LocalDir = "./download" 可行
Ftp下载修改:
self .ftp.retrbinary( 'RETR %s' % fileName, file_handler, self .bufsize) # 会出编码错误
self .ftp.retrbinary( 'RETR %s' % fileName.encode( 'utf-8' ), file_handler, self .bufsize) # 正确
原因在于,Pydev编码为utf-8,而打包时系统默认编码为ascii,所以要把utf-8的字符编码成内部字符串。