wxpy ResponseError:python o err.py_code: -1001;python o err.py_msg:

Fatal Python error: PyThreadState_Get: no current thread
7 messages
Open this post in threaded view
Fatal Python error: PyThreadState_Get: no current thread
Hello list,
from some time I receive a seg fault message exiting my app, and like now
I'm trying to debug it, so I install a python-dbg, wx-dbg and all the
other stuff for use it with gdb.
After some tries, gdb reply the message &Fatal Python error:
PyThreadState_Get: no current thread&
My app use a lot of threads into its work.
Python 2.5 and wx-the-last
Can be mine or a wx problem?
The backtrace are:
Fatal Python error: PyThreadState_Get: no current thread
Program received signal SIGABRT, Aborted.
[Switching to Thread 0xb7da58c0 (LWP 32702)]
0xb7f67424 in __kernel_vsyscall ()
(gdb) backtrace
#0 &0xb7f67424 in __kernel_vsyscall ()
#1 &0xb7dd1640 in raise () from /lib/i686/cmov/libc.so.6
#2 &0xb7dd3018 in abort () from /lib/i686/cmov/libc.so.6
#3 &0x08114d93 in Py_FatalError (msg=0x8175d18 &PyThreadState_Get: no
current thread&) at ../Python/pythonrun.c:1561
#4 &0x08110ecd in PyThreadState_Get () at ../Python/pystate.c:296
#5 &0x080fe23b in PyErr_Fetch (p_type=0xbfb80328, p_value=0xbfb80324,
p_traceback=0xbfb80320) at ../Python/errors.c:217
#6 &0x080beb4e in slot_tp_del (self=0x9bcb3b4) at
../Objects/typeobject.c:5004
#7 &0x080b046f in subtype_dealloc (self=0x9bcb3b4) at
../Objects/typeobject.c:664
#8 &0x08096a70 in _Py_Dealloc (op=0x9bcb3b4) at ../Objects/object.c:1938
#9 &0xb782317a in ~wxPyEvtSelfRef (this=0x9e23454) at src/helpers.cpp:1948
#10 0xb78263b3 in ~wxPyEvent (this=0x9e23430) at src/helpers.cpp:1987
#11 0xb6f73bc8 in wxObjectListNode::DeleteData (this=0x9c09b58) at
../src/common/list.cpp:585
#12 0xb6f73d40 in wxListBase::DoDeleteNode (this=0x9d46fe8,
node=0x9c09b58) at ../src/common/list.cpp:372
#13 0xb6f74201 in ~wxListBase (this=0x9d46fe8) at ../src/common/list.cpp:212
#14 0xb6f755ed in ~wxList (this=0x9d46fe8) at ../include/wx/list.h:1185
#15 0xb6fddb59 in ~wxEvtHandler (this=0x98439d8) at
../src/common/event.cpp:1080
#16 0xb6f20367 in ~wxAppConsole (this=0x98439d8) at
../src/common/appbase.cpp:143
#17 0xb72826b8 in ~wxAppBase (this=0x98439d8) at
../src/common/appcmn.cpp:133
#18 0xb71bfdef in ~wxApp (this=0x98439d8) at ../src/gtk/app.cpp:346
#19 0xb7825ff3 in ~wxPyApp (this=0x98439d8) at src/helpers.cpp:137
#20 0xb788a9a5 in _wrap_delete_PyApp (args=0x992e8c8) at
src/gtk/_core_wrap.cpp:31211
#21 0xb7831a23 in PySwigObject_dealloc (v=0x992e8c8) at
src/gtk/_core_wrap.cpp:1443
#22 0x08096a70 in _Py_Dealloc (op=0x992e8c8) at ../Objects/object.c:1938
#23 0x0808dfdc in dict_dealloc (mp=0x9bc9534) at ../Objects/dictobject.c:851
#24 0x08096a70 in _Py_Dealloc (op=0x9bc9534) at ../Objects/object.c:1938
#25 0x080b0629 in subtype_dealloc (self=0x9bcb114) at
../Objects/typeobject.c:697
#26 0x08096a70 in _Py_Dealloc (op=0x9bcb114) at ../Objects/object.c:1938
#27 0x0808cf6c in insertdict (mp=0xb7d5d5d4, key=0xb7d61648,
hash=-, value=0x8189888) at ../Objects/dictobject.c:416
#28 0x0808d77c in PyDict_SetItem (op=0xb7d5d5d4, key=0xb7d61648,
value=0x8189888) at ../Objects/dictobject.c:641
#29 0x080924ec in _PyModule_Clear (m=0xb7d65814) at
../Objects/moduleobject.c:136
#30 0x in PyImport_Cleanup () at ../Python/import.c:474
#31 0x08111ee7 in Py_Finalize () at ../Python/pythonrun.c:399
#32 0x08059d4b in Py_Main (argc=1, argv=0xbfb80964) at ../Modules/main.c:554
#33 0x08058d16 in main (argc=Cannot access memory at address 0x7fbe
) at ../Modules/python.c:23
_______________________________________________
wxpython-users mailing list
Open this post in threaded view
Re: Fatal Python error: PyThreadState_Get: no current thread
Michele Petrazzo - Unipex wrote:
& Hello list,
& from some time I receive a seg fault message exiting my app, and like now
& I'm trying to debug it, so I install a python-dbg, wx-dbg and all the
& other stuff for use it with gdb.
& After some tries, gdb reply the message &Fatal Python error:
& PyThreadState_Get: no current thread&
& My app use a lot of threads into its work.
& Python 2.5 and wx-the-last
& Can be mine or a wx problem?
It's probably yours as wxPython works with threads as long as you don't
make any direct calls to wx in your threads. You have to use one of the
threadsafe wx methods to communicate with your GUI. If you don't, then
your application will crash or exhibit weird behavior. I can't tell from
this traceback if that is what you did or not.
See the wiki for using threads and wxPython: &
Also try Google. I looked up &Fatal Python error: PyThreadState_Get: no
current thread& and there's quite a few hits, but since you didn't
include any code, I have no idea which link is relevant. You'll have to
check it out yourself.
& The backtrace are:
& Fatal Python error: PyThreadState_Get: no current thread
& Program received signal SIGABRT, Aborted.
& [Switching to Thread 0xb7da58c0 (LWP 32702)]
& 0xb7f67424 in __kernel_vsyscall ()
& (gdb) backtrace
& #0 &0xb7f67424 in __kernel_vsyscall ()
& #1 &0xb7dd1640 in raise () from /lib/i686/cmov/libc.so.6
& #2 &0xb7dd3018 in abort () from /lib/i686/cmov/libc.so.6
& #3 &0x08114d93 in Py_FatalError (msg=0x8175d18 &PyThreadState_Get: no
& current thread&) at ../Python/pythonrun.c:1561
& #4 &0x08110ecd in PyThreadState_Get () at ../Python/pystate.c:296
& #5 &0x080fe23b in PyErr_Fetch (p_type=0xbfb80328, p_value=0xbfb80324,
& p_traceback=0xbfb80320) at ../Python/errors.c:217
& #6 &0x080beb4e in slot_tp_del (self=0x9bcb3b4) at
& ../Objects/typeobject.c:5004
& #7 &0x080b046f in subtype_dealloc (self=0x9bcb3b4) at
& ../Objects/typeobject.c:664
& #8 &0x08096a70 in _Py_Dealloc (op=0x9bcb3b4) at ../Objects/object.c:1938
& #9 &0xb782317a in ~wxPyEvtSelfRef (this=0x9e23454) at
& src/helpers.cpp:1948
& #10 0xb78263b3 in ~wxPyEvent (this=0x9e23430) at src/helpers.cpp:1987
& #11 0xb6f73bc8 in wxObjectListNode::DeleteData (this=0x9c09b58) at
& ../src/common/list.cpp:585
& #12 0xb6f73d40 in wxListBase::DoDeleteNode (this=0x9d46fe8,
& node=0x9c09b58) at ../src/common/list.cpp:372
& #13 0xb6f74201 in ~wxListBase (this=0x9d46fe8) at
& ../src/common/list.cpp:212
& #14 0xb6f755ed in ~wxList (this=0x9d46fe8) at ../include/wx/list.h:1185
& #15 0xb6fddb59 in ~wxEvtHandler (this=0x98439d8) at
& ../src/common/event.cpp:1080
& #16 0xb6f20367 in ~wxAppConsole (this=0x98439d8) at
& ../src/common/appbase.cpp:143
& #17 0xb72826b8 in ~wxAppBase (this=0x98439d8) at
& ../src/common/appcmn.cpp:133
& #18 0xb71bfdef in ~wxApp (this=0x98439d8) at ../src/gtk/app.cpp:346
& #19 0xb7825ff3 in ~wxPyApp (this=0x98439d8) at src/helpers.cpp:137
& #20 0xb788a9a5 in _wrap_delete_PyApp (args=0x992e8c8) at
& src/gtk/_core_wrap.cpp:31211
& #21 0xb7831a23 in PySwigObject_dealloc (v=0x992e8c8) at
& src/gtk/_core_wrap.cpp:1443
& #22 0x08096a70 in _Py_Dealloc (op=0x992e8c8) at ../Objects/object.c:1938
& #23 0x0808dfdc in dict_dealloc (mp=0x9bc9534) at
& ../Objects/dictobject.c:851
& #24 0x08096a70 in _Py_Dealloc (op=0x9bc9534) at ../Objects/object.c:1938
& #25 0x080b0629 in subtype_dealloc (self=0x9bcb114) at
& ../Objects/typeobject.c:697
& #26 0x08096a70 in _Py_Dealloc (op=0x9bcb114) at ../Objects/object.c:1938
& #27 0x0808cf6c in insertdict (mp=0xb7d5d5d4, key=0xb7d61648,
& hash=-, value=0x8189888) at ../Objects/dictobject.c:416
& #28 0x0808d77c in PyDict_SetItem (op=0xb7d5d5d4, key=0xb7d61648,
& value=0x8189888) at ../Objects/dictobject.c:641
& #29 0x080924ec in _PyModule_Clear (m=0xb7d65814) at
& ../Objects/moduleobject.c:136
& #30 0x in PyImport_Cleanup () at ../Python/import.c:474
& #31 0x08111ee7 in Py_Finalize () at ../Python/pythonrun.c:399
& #32 0x08059d4b in Py_Main (argc=1, argv=0xbfb80964) at
& ../Modules/main.c:554
& #33 0x08058d16 in main (argc=Cannot access memory at address 0x7fbe
& ) at ../Modules/python.c:23
-------------------
Mike Driscoll
Blog: & _______________________________________________
wxpython-users mailing list
Open this post in threaded view
Re: Fatal Python error: PyThreadState_Get: no current thread
Mike Driscoll wrote:
&& After some tries, gdb reply the message &Fatal Python error:
&& PyThreadState_Get: no current thread&
&& My app use a lot of threads into its work.
&& Python 2.5 and wx-the-last
&& Can be mine or a wx problem?
& It's probably yours as wxPython works with threads as long as you
& don't make any direct calls to wx in your threads. You have to use
& one of the threadsafe wx methods to communicate with your GUI.
Like now I use, as far as I know, those methods for communicate with wx gui
& If you don't, then your application will crash or exhibit weird
& behavior. I can't tell from this traceback if that is what you did or
So you are saying that can be that the problem?
Do you know if there is something other debug option / code for see
where the segfault are generated?
& Also try Google. I looked up &Fatal Python error: PyThreadState_Get:
& &no current thread& and there's quite a few hits,
Already done that type of search and read but I haven't found good
points that say me where the problem is.
One of that was:
&where a comment say to swap to
the main thread otherwise a segfault is receive.
& but since you didn't include any code, I have no idea which link is
& relevant. You'll have to check it out yourself.
The problem it's that I have a complex project that I can't publish and
I'm looking only for a tip for better debug the problem.
_______________________________________________
wxpython-users mailing list
Open this post in threaded view
Re: Fatal Python error: PyThreadState_Get: no current thread
Michele Petrazzo - Unipex wrote:
& Mike Driscoll wrote:
&&& After some tries, gdb reply the message &Fatal Python error:
&&& PyThreadState_Get: no current thread&
&&& My app use a lot of threads into its work.
&&& Python 2.5 and wx-the-last
&&& Can be mine or a wx problem?
& Hi Mike,
&& It's probably yours as wxPython works with threads as long as you
&& don't make any direct calls to wx in your threads. You have to use
&& one of the threadsafe wx methods to communicate with your GUI.
& Like now I use, as far as I know, those methods for communicate with
&& If you don't, then your application will crash or exhibit weird
&& behavior. I can't tell from this traceback if that is what you did or
& So you are saying that can be that the problem?
& Do you know if there is something other debug option / code for see
& where the segfault are generated?
&& Also try Google. I looked up &Fatal Python error: PyThreadState_Get:
&& &no current thread& and there's quite a few hits,
& Already done that type of search and read but I haven't found good
& points that say me where the problem is.
& One of that was:
& &where a comment say to swap to
& the main thread otherwise a segfault is receive.
&& but since you didn't include any code, I have no idea which link is
&& relevant. You'll have to check it out yourself.
& The problem it's that I have a complex project that I can't publish and
& I'm looking only for a tip for better debug the problem.
Hopefully someone with more experience in debugging segfaults will jump
in here, but I think one of the ways I've seen mentioned on here is to
use the Python debugger. Here's a link to the docs:
And here are a few other links for other python debuggers (or just more
You might try adding in breakpoints to your code until you find the spot
where it crashes...although if your program segfaults just in normal
use, that won't work. You could also cross-post to comp.lang.python on
google groups and see if anyone there has a clue.
-------------------
Mike Driscoll
Blog: & _______________________________________________
wxpython-users mailing list
Open this post in threaded view
Re: Fatal Python error: PyThreadState_Get: no current thread
In reply to
by Michele Petrazzo - Unipex
Michele Petrazzo - Unipex wrote:
& Hello list,
& from some time I receive a seg fault message exiting my app, and like now
& I'm trying to debug it, so I install a python-dbg, wx-dbg and all the
& other stuff for use it with gdb.
& After some tries, gdb reply the message &Fatal Python error:
& PyThreadState_Get: no current thread&
& My app use a lot of threads into its work.
& Python 2.5 and wx-the-last
& Can be mine or a wx problem?
How are you terminating the app? &Naturally as the last top-level window
is closed or are you forcing it somehow? &I'll assume in the rest of
this message that it is a natural shutdown.
&From the backtrace it appears to me that there are still pending events
for some window when it is being destroyed and one of those events is a
custom event derived from wx.PyEvent or wx.PyCommandEvent. &When one of
those is destroyed it tries to acquire the Python GIL in order to safely
be able to DECREF the Python part of the object. &But since Python is in
the process of shutting down it is not able to do that and Python aborts
with the threadstate error.
I will add a conditional to help avoid this problem, but you can
probably do some things in your app a little cleaner to work around it
too. &Normally top-level windows will not be destroyed (and therefore
the app closed and MainLoop exited when the last frame is gone) if there
are still pending events. &So I assume that the event in question in
this case is coming from your worker threads *after* the gui thread has
already processed the pending events and decided that it is time to exit
and cleanup. &So if you can shutdown your threads before that happens,
or at least prevent them from sending more events, then you should avoid
the problem.
Robin Dunn
Software Craftsman
& Java give you jitters? &Relax with wxPython!
_______________________________________________
wxpython-users mailing list
Open this post in threaded view
Re: Fatal Python error: PyThreadState_Get: no current thread
In reply to
by Michele Petrazzo - Unipex
Michele Petrazzo - Unipex wrote:
& The problem it's that I have a complex project that I can't publish and
& I'm looking only for a tip for better debug the problem.
In situations like this the best thing is usually to progressively
disable parts of the application until the problem goes away, and then
to selectively enable parts again until you are able to narrow down the
exact cause of the problem. &Then once you understand the cause you can
either devise a fix, or a workaround, or reimplement the problem in a
small sample app that you can send to us for advice.
Robin Dunn
Software Craftsman
& Java give you jitters? &Relax with wxPython!
_______________________________________________
wxpython-users mailing list
Open this post in threaded view
Re: Fatal Python error: PyThreadState_Get: no current thread
In reply to
by Robin Dunn
Robin Dunn wrote:
& Michele Petrazzo - Unipex wrote:
&& Hello list, from some time I receive a seg fault message exiting my
&& &app, and like now I'm trying to debug it, so I install a
&& python-dbg, wx-dbg and all the other stuff for use it with gdb.
&& After some tries, gdb reply the message &Fatal Python error:
&& PyThreadState_Get: no current thread&
&& My app use a lot of threads into its work.
&& Python 2.5 and wx-the-last
&& Can be mine or a wx problem?
& How are you terminating the app? &Naturally as the last top-level
& window is closed or are you forcing it somehow? &I'll assume in the
& rest of this message that it is a natural shutdown.
First of all, thanks for both replies.
Into my code, I &simulate& a wx.FutureCall with a thread that propagate
the call through a wx.PostEvent.
I found that I say to the app to exit (wx.Exit) and
_after_ I call a PostEvent
Clean that and it's working!
_______________________________________________
wxpython-users mailing listASP.NET定制错误处理页面_百度文库
您的浏览器Javascript被禁用,需开启后体验完整功能,
享专业文档下载特权
&赠共享文档下载特权
&10W篇文档免费专享
&每天抽奖多种福利
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
ASP.NET定制错误处理页面
&&ASP.NET定制错误处理页面
阅读已结束,下载本文需要
想免费下载本文?
定制HR最喜欢的简历
你可能喜欢调用微信支付接口提示 get_brand_wcpay_request:fail
<a data-traceid="question_detail_above_text_l&&
生成订单的返回结果如下:
&return_code&&![CDATA[SUCCESS]]&&/return_code&
&return_msg&&![CDATA[OK]]&&/return_msg&
&appid&&![CDATA[wx63cf900]]&&/appid&
&mch_id&&![CDATA[]]&&/mch_id&
&device_info&&![CDATA[WEB]]&&/device_info&
&nonce_str&&![CDATA[820RztKTT5EiL0HU]]&&/nonce_str&
&sign&&![CDATA[BF82F41CDE8A4]]&&/sign&
&result_code&&![CDATA[SUCCESS]]&&/result_code&
&prepay_id&&![CDATA[wx2]]&&/prepay_id&
&trade_type&&![CDATA[JSAPI]]&&/trade_type&
网页上调用的js代码为
var appId = "${weiXinOrderRequset.get("appId")}";
var timeStamp = "${weiXinOrderRequset.get("timeStamp")}";
var nonceStr = "${weiXinOrderRequset.get("nonceStr")}";
var package = "${weiXinOrderRequset.get("package")}";
var signType = "${weiXinOrderRequset.get("signType")}";
var paySign = "${weiXinOrderRequset.get("paySign")}";
function onBridgeReady() {
WeixinJSBridge.invoke(
'getBrandWCPayRequest', {
"appId": appId,
//公众号名称,由商户传入
"timeStamp": timeStamp,
//时间戳,自1970年以来的秒数
"nonceStr": nonceStr, //随机串
"package":
"signType": signType,
//微信签名方式:
"paySign": paySign
//微信签名
function (res) {
alert(res);
alert(res.err_msg);
if (res.err_msg == "get_brand_wcpay_request:ok") {
alert("支付成功");
// 使用以上方式判断前端返回,微信团队郑重提示:res.err_msg将在用户支付成功后返回
ok,但并不保证它绝对可靠。
function pay() {
if (typeof WeixinJSBridge == "undefined") {
if (document.addEventListener) {
document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
} else if (document.attachEvent) {
document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
alert("初始化失败");
onBridgeReady();
alert("初始化成功");
但是每次调用后,得到的结果都为:get_brand_wcpay_request:fail,在商户平台没有看到生成成功在账单。已经困扰一上午了,请各位大神帮助!
很高兴看到你这个问题,这个问题也困扰过我一两天时间。你这种调用支付的方法应该已经过期的了。微信平台上的公共支付没更新。但是在jsapi中有最新的做法,贴上我的代码供参考。
&%@ page contentType="text/charset=UTF-8" %&
&%@ include file="/common/header.jsp" %&
&title&微信支付&/title&
&link rel="stylesheet" type="text/css" href="css/activity.css"&
&script type="text/javascript" charset="UTF-8" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"&&/script&
&script type="text/javascript"&
function pay(){
var appId = $('#appId').val();
var timeStamp = $('#timeStamp').val();
var nonceStr = $('#nonceStr').val();
var pk = $('#package').val();
var signType = $('#signType').val();
var paySign = $('#paySign').val();
var timeStamp2 = $('#timeStamp2').val();
var nonceStr2 = $('#nonceStr2').val();
var signature = $('#signature').val();
var activityId = $('#activityId').val();
wx.config({
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: appId, // 必填,公众号的唯一标识
timestamp:timeStamp2 , // 必填,生成签名的时间戳
nonceStr: nonceStr2, // 必填,生成签名的随机串
signature: signature,// 必填,签名,见附录1
jsApiList: ['chooseWXPay'] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
wx.ready(function(){
// config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,config是一个客户端的异步操作,所以如果需要在页面加载时就调用相关接口,则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在ready函数中。
wx.chooseWXPay({
timestamp: timeStamp, // 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符
nonceStr: nonceStr, // 支付签名随机串,不长于 32 位
package: pk, // 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=***)
signType: signType, // 签名方式,默认为'SHA1',使用新版支付需传入'MD5'
paySign: paySign, // 支付签名
complete: function (res) {
// 支付成功后的回调函数
location.href=basePath+'/activityorder/activity-order!list.action?activityId='+activityId;
&body onload="pay()"&
&input id="activityId" type="hidden" value="${activityId}" /&
&input id="appId" type="hidden" value="${payparam.appId}" /&
&input id="timeStamp" type="hidden" value="${payparam.timeStamp}" /&
&input id="nonceStr" type="hidden" value="${payparam.nonceStr}" /&
&input id="package" type="hidden" value="${payparam.package1}" /&
&input id="signType" type="hidden" value="${payparam.signType}" /&
&input id="paySign" type="hidden" value="${payparam.paySign}" /&
&input id="timeStamp2" type="hidden" value="${apijsmap.timestamp}" /&
&input id="nonceStr2" type="hidden" value="${apijsmap.noncestr}" /&
&input id="signature" type="hidden" value="${apijsmap.signature}" /&
--- 共有 1 条评论 ---
额...楼主那个是最新的...楼上这个才是老的接口啊
在微信支付 的配置里需要支付配置域名,否则也会报错&
付费解决,500
--- 共有 1 条评论 ---
指点一下吧!小弟谢过了!
在原来的验证的基础上需要多一个授权验证。具体看js-jdk的api文档
http://mp.weixin.qq.com/wiki/7/aaa137b55fb2e48dd613f.html
--- 共有 9 条评论 ---
: 看我博客http://my.oschina.net/u/566297/blog/512675
虽然写得不是很清楚
: 简单说就是不要用微信浏览器内置函数了,改用引入http://res.wx.qq.com/open/js/jweixin-1.0.0.js然后调用其方法。具体看apijs,说来话长
请问你是怎么解决的?
: 是用v3调试的吗
: 上面的链接,用新的接口重新写了一遍
遇到一样的问题,能否帮下忙。企鹅
付款的微信号有没有加到测试白名单中啊?
微信jssdk里面所有timestamp全部是小写,跟直接使用WeixinJSBridge.call调用使用timeStamp不同,jssdk中会自动将小写的timestamp转成timeStamp,直接使用timeStamp会造成undefined,我特么也是搞了半天才弄懂,官方文档的作者语文不好,特么的坑
正巧遇到这个问题,目前还没有解决。。。
--- 共有 2 条评论 ---
: 解决了,我的是因为修改了配置文件错误导致的。
大神帮帮我:
怎么解决的楼主啊啊。。。。

我要回帖

更多关于 pyerr format 的文章

 

随机推荐