系统错误:Objects/longobject.c:237:内部函数的参数错误

2024-06-25 07:15:13 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用的是Python 2.6,遇到以下异常:

Traceback (most recent call last):
  File "ProceraExporter_new.py", line 695, in <module>
    sendRecord(dictParseConfig,portList[0])
  File "ProceraExporter_new.py", line 610, in sendRecord
    dictRecord = proceraGen(dictParseConfig)
  File "ProceraExporter_new.py", line 539, in proceraGen
    exp = ProceraExporter(dictParseConfig)
  File "ProceraExporter_new.py", line 216, in __init__
    self.createHeaderToFuncMap()
  File "ProceraExporter_new.py", line 234, in createHeaderToFuncMap
    self.dictHeaderFuncMap['proceraApn'] = self.radiusCalledStationIdGenerator()
  File "ProceraExporter_new.py", line 490, in radiusCalledStationIdGenerator
    radiusCalledStationId = 'Sushfone-'+str(self.getRandomValue(start = 1, end = 5))
  File "ProceraExporter_new.py", line 291, in getRandomValue
    randomVal = adder + multiplier*random.randint(start, end)
  File "/usr/lib64/python2.6/random.py", line 228, in randint
    return self.randrange(a, b+1)
  File "/usr/lib64/python2.6/random.py", line 200, in randrange
    if width >= maxwidth:
SystemError: Objects/longobject.c:237: bad argument to internal function

从跟踪中可以看出,“start”的值被传递为1,“end”的值作为5传递,它们都是整数,但它仍然给出了这个异常。在

你知道为什么会这样吗?在


Tags: inpyselfnewlinerandomstartfile