wxPython 2.8.7.1版本的一个严重BUG和解决方法
2008-05-24 23:38
435 查看
wxPython 2.8.7.1版本有一个严重BUG,运行wxPython脚本会出现如下错误:
F:/ddd.py:1: DeprecationWarning: The wxPython compatibility package is no longer
automatically generated or actively maintained. Please switch to the wx packag
e as soon as possible.
from wxPython.wx import *
Traceback (most recent call last):
File "F:/ddd.py", line 1, in <module>
from wxPython.wx import *
File "C:/Python25/Lib/site-packages/wx-2.8-msw-ansi/wxPython/__init__.py", lin
e 15, in <module>
import _wx
File "C:/Python25/Lib/site-packages/wx-2.8-msw-ansi/wxPython/_wx.py", line 8,
in <module>
from _misc import *
File "C:/Python25/Lib/site-packages/wx-2.8-msw-ansi/wxPython/_misc.py", line 4
56, in <module>
wxDateTime_GetNumberOfDaysinYear = wx._misc.DateTime_GetNumberOfDaysinYear
AttributeError: 'module' object has no attribute 'DateTime_GetNumberOfDaysinYear
'
原因是wxPython 2.8.7.1版本中有一个变量名的拼写错误,修改site-packages/wx-2.8-msw-ansi/wxPython目录下的
_misc.py文件,把其中下面这句:
wxDateTime_GetNumberOfDaysinYear = wx._misc.DateTime_GetNumberOfDaysinYear
修改为:
wxDateTime_GetNumberOfDaysInYear = wx._misc.DateTime_GetNumberOfDaysInYear
注意这里的In错误的写成in了,大写写成了小写。
可以参考下面sourceforge上wxPython项目的解释:
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1845098&group_id=9863
[ 1845098 ] Get attribute error (2.8.7.1)
F:/ddd.py:1: DeprecationWarning: The wxPython compatibility package is no longer
automatically generated or actively maintained. Please switch to the wx packag
e as soon as possible.
from wxPython.wx import *
Traceback (most recent call last):
File "F:/ddd.py", line 1, in <module>
from wxPython.wx import *
File "C:/Python25/Lib/site-packages/wx-2.8-msw-ansi/wxPython/__init__.py", lin
e 15, in <module>
import _wx
File "C:/Python25/Lib/site-packages/wx-2.8-msw-ansi/wxPython/_wx.py", line 8,
in <module>
from _misc import *
File "C:/Python25/Lib/site-packages/wx-2.8-msw-ansi/wxPython/_misc.py", line 4
56, in <module>
wxDateTime_GetNumberOfDaysinYear = wx._misc.DateTime_GetNumberOfDaysinYear
AttributeError: 'module' object has no attribute 'DateTime_GetNumberOfDaysinYear
'
原因是wxPython 2.8.7.1版本中有一个变量名的拼写错误,修改site-packages/wx-2.8-msw-ansi/wxPython目录下的
_misc.py文件,把其中下面这句:
wxDateTime_GetNumberOfDaysinYear = wx._misc.DateTime_GetNumberOfDaysinYear
修改为:
wxDateTime_GetNumberOfDaysInYear = wx._misc.DateTime_GetNumberOfDaysInYear
注意这里的In错误的写成in了,大写写成了小写。
可以参考下面sourceforge上wxPython项目的解释:
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1845098&group_id=9863
[ 1845098 ] Get attribute error (2.8.7.1)
You may monitor this Tracker item after you log in (register an account, if you do not already have one) | ||
Submitted By: jvenable - jvenable | Date Submitted: 2007-12-05 12:19 | |
Changed to Closed status by: robind | Closed as of: 2008-05-12 13:09 | |
Last Updated By: robind - Comment added | Date Last Updated: 2008-05-12 13:09 | |
Number of Comments: 1 | Number of Attachments: 0 | |
Category: (?) wxPython specific | Group: (?) None | |
Assigned To: (?) Robin Dunn | Priority: (?) 5 | |
Status: (?) Closed | Resolution: (?) Fixed | |
Summary: (?) Get attribute error (2.8.7.1) | Private: (?) No | |
wxPython 2.8.7.1 (wxMSW, ansi, wx-assertions-on, SWIG-1.3.29) Running on Python 2.3.5 This line in _misc.py appears to be in error: wxDateTime_GetNumberOfDaysinYear = wx._misc.DateTime_GetNumberOfDaysinYear I believe it should be: wxDateTime_GetNumberOfDaysInYear = wx._misc.DateTime_GetNumberOfDaysInYear Note the capitalized "In" I get an exception: AttributeError: 'module' object has no attribute 'DateTime_GetNumberOfDaysinYear' unless I change it. Thanks, John Venable jrvenable@gmail.com | ||
Followups:
|
相关文章推荐
- IOS7版本中GameCenter的一个bug的解决方法
- ubuntu12.04发热严重,解决的一个方法
- J2ME中一个奇怪的BUG及其解决方法
- Visual C++6.0一个小BUG的解决方法
- 使用 $(function(){}) 时遇到的一个小bug及解决方法
- Visual C++6.0一个小BUG的解决方法
- 高版本内核系统(Ubuntu12.04)下编译低版本内核(2.6.30)bug解决方法
- zabbix 2.0.x版本默认web监控bug解决方法
- 终于解决掉文件系统fwrite一个严重的bug
- AE多用户同时编辑同一个版本数据的解决方法
- ASP.NET AJAX DropShadow 控件的一个BUG和解决方法(a bug of DropShadow and solution to resolve)
- ios开发同一个版本多次提交不想改变版本号的解决方法
- [ASP.NET 2.0]PageParser.GetCompiledPageInstance中的一个Bug及解决方法
- .NET控件ComboBox绑定数据源的一个Bug及解决方法
- ios开发同一个版本多次提交不想改变版本号的解决方法
- zabbix 2.0.x版本默认web监控bug解决方法
- 解决IE9以下ie版本不能识别新元素的方法 添加一个js -- Shiv Solution
- androidstudio 一个项目多个不同功能的版本解决方法(多渠道打包,生成不同包名的包)
- qt5集成libcurl实现tftp和ftp的方法之三:搭建FTP时,当ftpServer端默认登录的目录不是根目录/时,有一个bug会产生的解决办法