DarkCat09 / python-aternos

[UNMAINTAINED] Unofficial Aternos API written in Python
https://pypi.org/project/python-aternos/
Apache License 2.0
92 stars 12 forks source link

During handling of the above exception, another exception occurred #12

Closed Kopheek closed 2 years ago

Kopheek commented 2 years ago

При выполнении кода (When executing the code):

user = 'HotKot7002'
pasw = 'mypass'

aternos = Client(user, password=pasw)

Возникает ошибка (An error occurs):

Traceback (most recent call last):
  File "C:\Users\Acer\AppData\Local\Programs\Python\Python39\lib\site-packages\js2py\evaljs.py", line 193, in execute
    compiled = cache[hashkey]
KeyError: b'\xa6c\xac\x13vF\x93~\xd3\x8f\xf2!\xc1\x86l5'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Acer\AppData\Local\Programs\Python\Python39\lib\site-packages\pyjsparser\parser.py", line 3008, in parse
    program = self.parseProgram()
  File "C:\Users\Acer\AppData\Local\Programs\Python\Python39\lib\site-packages\pyjsparser\parser.py", line 2974, in parseProgram
    body = self.parseScriptBody()
  File "C:\Users\Acer\AppData\Local\Programs\Python\Python39\lib\site-packages\pyjsparser\parser.py", line 2963, in parseScriptBody       
    statement = self.parseStatementListItem()
  File "C:\Users\Acer\AppData\Local\Programs\Python\Python39\lib\site-packages\pyjsparser\parser.py", line 2110, in parseStatementListItem
    return self.parseStatement()
  File "C:\Users\Acer\AppData\Local\Programs\Python\Python39\lib\site-packages\pyjsparser\parser.py", line 2705, in parseStatement        
    expr = self.parseExpression()
  File "C:\Users\Acer\AppData\Local\Programs\Python\Python39\lib\site-packages\pyjsparser\parser.py", line 2076, in parseExpression       
    expr = self.isolateCoverGrammar(self.parseAssignmentExpression)
  File "C:\Users\Acer\AppData\Local\Programs\Python\Python39\lib\site-packages\pyjsparser\parser.py", line 1161, in isolateCoverGrammar   
    result = parser()
  File "C:\Users\Acer\AppData\Local\Programs\Python\Python39\lib\site-packages\pyjsparser\parser.py", line 2066, in parseAssignmentExpression
    right = self.isolateCoverGrammar(self.parseAssignmentExpression)
  File "C:\Users\Acer\AppData\Local\Programs\Python\Python39\lib\site-packages\pyjsparser\parser.py", line 1161, in isolateCoverGrammar
    result = parser()
  File "C:\Users\Acer\AppData\Local\Programs\Python\Python39\lib\site-packages\pyjsparser\parser.py", line 2038, in parseAssignmentExpression
    expr = self.parseConditionalExpression()
  File "C:\Users\Acer\AppData\Local\Programs\Python\Python39\lib\site-packages\pyjsparser\parser.py", line 1936, in parseConditionalExpression
    consequent = self.isolateCoverGrammar(
  File "C:\Users\Acer\AppData\Local\Programs\Python\Python39\lib\site-packages\pyjsparser\parser.py", line 1161, in isolateCoverGrammar
    result = parser()
  File "C:\Users\Acer\AppData\Local\Programs\Python\Python39\lib\site-packages\pyjsparser\parser.py", line 2038, in parseAssignmentExpression
    expr = self.parseConditionalExpression()
  File "C:\Users\Acer\AppData\Local\Programs\Python\Python39\lib\site-packages\pyjsparser\parser.py", line 1931, in parseConditionalExpression
    expr = self.inheritCoverGrammar(self.parseBinaryExpression)
  File "C:\Users\Acer\AppData\Local\Programs\Python\Python39\lib\site-packages\pyjsparser\parser.py", line 1176, in inheritCoverGrammar
    result = parser()
  File "C:\Users\Acer\AppData\Local\Programs\Python\Python39\lib\site-packages\pyjsparser\parser.py", line 1876, in parseBinaryExpression
    left = self.inheritCoverGrammar(self.parseUnaryExpression)
  File "C:\Users\Acer\AppData\Local\Programs\Python\Python39\lib\site-packages\pyjsparser\parser.py", line 1176, in inheritCoverGrammar
    result = parser()
  File "C:\Users\Acer\AppData\Local\Programs\Python\Python39\lib\site-packages\pyjsparser\parser.py", line 1852, in parseUnaryExpression
    expr = self.parsePostfixExpression()
  File "C:\Users\Acer\AppData\Local\Programs\Python\Python39\lib\site-packages\pyjsparser\parser.py", line 1793, in parsePostfixExpression
    expr = self.inheritCoverGrammar(
  File "C:\Users\Acer\AppData\Local\Programs\Python\Python39\lib\site-packages\pyjsparser\parser.py", line 1176, in inheritCoverGrammar
    result = parser()
  File "C:\Users\Acer\AppData\Local\Programs\Python\Python39\lib\site-packages\pyjsparser\parser.py", line 1729, in parseLeftHandSideExpressionAllowCall
    args = self.parseArguments()
  File "C:\Users\Acer\AppData\Local\Programs\Python\Python39\lib\site-packages\pyjsparser\parser.py", line 1664, in parseArguments
    self.isolateCoverGrammar(self.parseAssignmentExpression))
  File "C:\Users\Acer\AppData\Local\Programs\Python\Python39\lib\site-packages\pyjsparser\parser.py", line 1161, in isolateCoverGrammar
    result = parser()
  File "C:\Users\Acer\AppData\Local\Programs\Python\Python39\lib\site-packages\pyjsparser\parser.py", line 2042, in parseAssignmentExpression
    raise Ecma51NotSupported('ArrowFunctionExpression')
pyjsparser.std_nodes.Ecma51NotSupported: ArrowFunctionExpression is not supported by ECMA 5.1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\code\server074_aternos\atrnos_test.py", line 4, in <module>
    aternos = Client(user, password=pasw)
  File "C:\Users\Acer\AppData\Local\Programs\Python\Python39\lib\site-packages\python_aternos\__init__.py", line 20, in __init__
    self.__init__(
  File "C:\Users\Acer\AppData\Local\Programs\Python\Python39\lib\site-packages\python_aternos\__init__.py", line 29, in __init__
    self.token = self.atconn.parse_token()
  File "C:\Users\Acer\AppData\Local\Programs\Python\Python39\lib\site-packages\python_aternos\atconnect.py", line 39, in parse_token
    ctx = atjsparse.exec(token_func)
  File "C:\Users\Acer\AppData\Local\Programs\Python\Python39\lib\site-packages\python_aternos\atjsparse.py", line 36, in exec
    ctx.execute(to_ecma5_function(f))
  File "C:\Users\Acer\AppData\Local\Programs\Python\Python39\lib\site-packages\js2py\evaljs.py", line 195, in execute
    code = translate_js(
  File "C:\Users\Acer\AppData\Local\Programs\Python\Python39\lib\site-packages\js2py\translators\translator.py", line 70, in translate_js
    parsed = parse_fn(js)
  File "C:\Users\Acer\AppData\Local\Programs\Python\Python39\lib\site-packages\js2py\translators\translator.py", line 62, in pyjsparser_parse_fn
    return parser.parse(code)
  File "C:\Users\Acer\AppData\Local\Programs\Python\Python39\lib\site-packages\pyjsparser\parser.py", line 3010, in parse
    raise self.createError(self.lineNumber, self.lastIndex, unicode(e))
js2py.internals.simplex.JsException: SyntaxError: Line 1: ArrowFunctionExpression is not supported by ECMA 5.1.

Опять же не знаю c которой стороны проблема. Но надеюсь, что она будет решена (Again, I do not know which side of the problem. But I hope that it will be solved)

DarkCat09 commented 2 years ago

Написано ж:

ArrowFunctionExpression is not supported by ECMA 5.1.

Пробуйте ещё раз, т.к. это уже было реализовано в v0.5, должно работать.
Просто иногда атернос отправляет очень страшные функции, которые тот вариант парсера разобрать не мог.
Если это будет наблюдаться в v0.6, я писать свой интерпретатор не буду, просто вместо js2py поставлю PyChakra.


Arrow expresions are already supported in v0.5, so try again.
Aternos just often sends a very strange function which parser from 0.5 can't execute.
If the error will be in 0.6 to, I'll use PyChakra instead of js2py, because I don't want to write my own JavaScript interpreter.