0

当我使用与 print 相同的代码时,一切都很好,但是将它与 SQLAlchemy 一起使用会给我一个错误:

table = Table(args[1], unixtime_1, datetime_1, args[2].encode('UTF-8'), html_parser.unescape(args[3]).encode('UTF-8'), args[4], v1, v2, v3, v4)
session.add(table)
session.commit() 

这在这里工作正常:

print(args[1], unixtime_1, datetime_1, args[2].encode('UTF-8'), html_parser.unescape(args[3]).encode('UTF-8'), args[4], v1, v2, v3, v4)

有谁知道问题是什么?先感谢您!

更新

这是完整的错误:

While firing <function PoloniexComponent.onJoin.<locals>.onTrollbox at 0x7fc2812d4a60> subscribed under 6862132021787864.: Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/txaio/aio.py", line 385, in done
    res = f.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 292, in result
    raise self._exception
  File "/usr/local/lib/python3.5/dist-packages/txaio/aio.py", line 296, in as_future
    res = fun(*args, **kwargs)
  File "/var/www/FlaskApp/FlaskApp/poloniex_pusher.py", line 113, in onTrollbox
IndexError: tuple index out of range
4

0 回答 0