[PyQt] QInAppStore.registerProduct() causes crash

Dave Gradwell davegradwell at yahoo.co.uk
Tue Jan 31 23:23:04 GMT 2017


My code….

self.appStore = QtPurchasing.QInAppStore(self)
self.appStore.productRegistered.connect(self.on_productRegistered)
self.appStore.productUnknown.connect(self.on_productUnknown)
self.appStore.transactionReady.connect(self.on_transactionReady)
self.appStore.registerProduct(QtPurchasing.QInAppProduct.Consumable, "playall_standard_subscription”)

….crashes on the last line with the NSException as shown below.
Would be most grateful for any advice if I’m not using this correctly..

Thanks, Dave.
(Mac OS X 10.11.4, Python 3.5.3, Qt 5.7.1, SIP 4.19)




2017-01-31 14:54:13.349 python3.5[44191:4974053] An uncaught exception was raised
2017-01-31 14:54:13.349 python3.5[44191:4974053] *** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[1]
2017-01-31 14:54:13.349 python3.5[44191:4974053] (
	0   CoreFoundation                      0x00007fff9f3894f2 __exceptionPreprocess + 178
	1   libobjc.A.dylib                     0x00007fff9310cf7e objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff9f2837de -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 318
	3   CoreFoundation                      0x00007fff9f28366b +[NSDictionary dictionaryWithObjects:forKeys:count:] + 59
	4   StoreKit                            0x00000001058001f0 -[SKServiceProxy serviceConnection] + 613
	5   StoreKit                            0x0000000105800391 -[SKServiceProxy objectProxyWithErrorHandler:] + 33
	6   StoreKit                            0x00000001058038c5 -[SKPaymentQueue _addObserverWithBlock:] + 138
	7   StoreKit                            0x0000000105803943 -[SKPaymentQueue _registerForNotifications] + 88
	8   QtPurchasing                        0x00000001057f1225 _ZNK11QInAppStore17registeredProductERK7QString + 3541
	9   QtPurchasing                        0x00000001057f2882 _ZNK11QInAppStore17registeredProductERK7QString + 9266
	10  QtPurchasing.so                     0x00000001057e4387 _ZL32meth_QInAppStore_registerProductP7_objectS0_ + 151
	11  python3.5                           0x0000000101de90e5 PyCFunction_Call + 165
	12  python3.5                           0x0000000101e67e3f PyEval_EvalFrameEx + 25583
	13  python3.5                           0x0000000101e6c4d2 _PyEval_EvalCodeWithName + 4194
	14  python3.5                           0x0000000101e61a2e PyEval_EvalCodeEx + 78
	15  python3.5                           0x0000000101dc947d function_call + 381
	16  python3.5                           0x0000000101d9ffe5 PyObject_Call + 101
	17  python3.5                           0x0000000101db594d method_call + 141
	18  python3.5                           0x0000000101d9ffe5 PyObject_Call + 101
	19  python3.5                           0x0000000101dffbfe slot_tp_init + 158
	20  python3.5                           0x0000000101dfc179 type_call + 297
	21  python3.5                           0x0000000101d9ffe5 PyObject_Call + 101
	22  python3.5                           0x0000000101e67ba3 PyEval_EvalFrameEx + 24915
	23  python3.5                           0x0000000101e6c4d2 _PyEval_EvalCodeWithName + 4194
	24  python3.5                           0x0000000101e619d1 PyEval_EvalCode + 81
	25  python3.5                           0x0000000101e92221 PyRun_FileExFlags + 209
	26  python3.5                           0x0000000101e9191c PyRun_SimpleFileExFlags + 668
	27  python3.5                           0x0000000101eaa124 Py_Main + 3284
	28  python3.5                           0x0000000101d953bd main + 237
	29  libdyld.dylib                       0x00007fff99bdc5ad start + 1
	30  ???                                 0x0000000000000002 0x0 + 2
)
2017-01-31 14:54:13.349 python3.5[44191:4974053] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[1]'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff9f3894f2 __exceptionPreprocess + 178
	1   libobjc.A.dylib                     0x00007fff9310cf7e objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff9f2837de -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 318
	3   CoreFoundation                      0x00007fff9f28366b +[NSDictionary dictionaryWithObjects:forKeys:count:] + 59
	4   StoreKit                            0x00000001058001f0 -[SKServiceProxy serviceConnection] + 613
	5   StoreKit                            0x0000000105800391 -[SKServiceProxy objectProxyWithErrorHandler:] + 33
	6   StoreKit                            0x00000001058038c5 -[SKPaymentQueue _addObserverWithBlock:] + 138
	7   StoreKit                            0x0000000105803943 -[SKPaymentQueue _registerForNotifications] + 88
	8   QtPurchasing                        0x00000001057f1225 _ZNK11QInAppStore17registeredProductERK7QString + 3541
	9   QtPurchasing                        0x00000001057f2882 _ZNK11QInAppStore17registeredProductERK7QString + 9266
	10  QtPurchasing.so                     0x00000001057e4387 _ZL32meth_QInAppStore_registerProductP7_objectS0_ + 151
	11  python3.5                           0x0000000101de90e5 PyCFunction_Call + 165
	12  python3.5                           0x0000000101e67e3f PyEval_EvalFrameEx + 25583
	13  python3.5                           0x0000000101e6c4d2 _PyEval_EvalCodeWithName + 4194
	14  python3.5                           0x0000000101e61a2e PyEval_EvalCodeEx + 78
	15  python3.5                           0x0000000101dc947d function_call + 381
	16  python3.5                           0x0000000101d9ffe5 PyObject_Call + 101
	17  python3.5                           0x0000000101db594d method_call + 141
	18  python3.5                           0x0000000101d9ffe5 PyObject_Call + 101
	19  python3.5                           0x0000000101dffbfe slot_tp_init + 158
	20  python3.5                           0x0000000101dfc179 type_call + 297
	21  python3.5                           0x0000000101d9ffe5 PyObject_Call + 101
	22  python3.5                           0x0000000101e67ba3 PyEval_EvalFrameEx + 24915
	23  python3.5                           0x0000000101e6c4d2 _PyEval_EvalCodeWithName + 4194
	24  python3.5                           0x0000000101e619d1 PyEval_EvalCode + 81
	25  python3.5                           0x0000000101e92221 PyRun_FileExFlags + 209
	26  python3.5                           0x0000000101e9191c PyRun_SimpleFileExFlags + 668
	27  python3.5                           0x0000000101eaa124 Py_Main + 3284
	28  python3.5                           0x0000000101d953bd main + 237
	29  libdyld.dylib                       0x00007fff99bdc5ad start + 1
	30  ???                                 0x0000000000000002 0x0 + 2
)
libc++abi.dylib: terminating with uncaught exception of type NSException











More information about the PyQt mailing list