简体   繁体   English

TypeError:__init __()获得了意外的关键字参数'options'

[英]TypeError: __init__() got an unexpected keyword argument 'options'

I am getting an error from a python script. 我从python脚本中收到错误。 The error is shown below. 错误如下所示。 In the source code furthur down, I have an snippet of the python script from session.py and ssh_session.py from around the lines in quesiton. 在下面的源代码中,我从quesiton的每一行中都有来自session.py和ssh_session.py的python脚本片段。 Based on the error, it seems that the parameter options was given to a class denoted by super, where that class doesn't know the parameter options. 基于该错误,似乎将参数选项提供给了以super表示的类,其中该类不知道参数选项。 The screwy part is that although this is my first time working with this set of scripts, I know that other folks use this set of scripts all the time succesfully. 棘手的部分是,尽管这是我第一次使用这组脚本,但我知道其他人一直都在成功使用这组脚本。 So I started thinking that maybe I have a version problem relative to a python module. 因此,我开始考虑可能是与python模块有关的版本问题。 Can anyone shed light on the nature of an error where __init__ would cry foul on an unexpected keyword argument, when it seems to work for everyone else? 任何人都可以阐明错误的性质吗,当__init__似乎对其他所有人都起作用时,__init__会对意外的关键字参数犯规。 If it is a module issue, how would I actually know when or in which version the argument came into existence, or was removed? 如果是模块问题,我实际上如何知道该参数何时,在哪个版本中存在或被删除?

2017-03-17 16:23:36,303-07 ERROR        -   File "/home/rmaes/.local/lib/python2.7/site-packages/ctf/ssh_session.py", line 92, in __init__
2017-03-17 16:23:36,303-07 ERROR        -   interactOnFailure=interactOnFailure, verbose=verbose, logLevel=logLevel)
2017-03-17 16:23:36,303-07 ERROR        -   File "/home/rmaes/.local/lib/python2.7/site-packages/ctf/session.py", line 376, in __init__
2017-03-17 16:23:36,303-07 ERROR        -   env=self.env)
2017-03-17 16:23:36,303-07 ERROR        -   TypeError: __init__() got an unexpected keyword argument 'options'
2017-03-17 16:23:36,303-07 ERROR        -   End traceback.
2017-03-17 16:23:36,304-07 INFO         - END ANCILLARY "_testRunSuite"
2017-03-17 16:23:36,304-07 INFO         - Exception forces exit because exit-on-error is True.

ssh_session line 92 ssh_session第92行

super (Ssh, self).__init__(timeout=timeout, maxread=maxread,
       searchwindowsize=searchwindowsize, logfile=logfile, cwd=cwd, env=env,
       ignore_sighup=ignore_sighup, echo=echo, options=options,
       encoding=encoding, codec_errors=codec_errors,
       interactOnFailure=interactOnFailure, verbose=verbose, logLevel=logLevel)


def login (self, host, username, password='', terminal_type='ansi',
           original_prompt=r"[#$]", login_timeout=10, port=22,
           auto_prompt_reset=True, ssh_key=None, quiet=True,
           sync_multiplier=1, check_local_ip=True):

session.py Line 375-376 session.py行375-376

 # Instantiate the pxssh sub-class
        super (PxsshSession, self).__init__(timeout=self.timeout,
                                            maxread=self.maxread,
                                            searchwindowsize=self.searchwindowsize,
                                            logfile=self.logfile,
                                            options=self.options,
                                            ignore_sighup=self.ignore_sighup,
                                            cwd=self.cwd,
                                            env=self.env)

So it appears that a change introduce in pexpect 4.0.1 resolves the issue that I am seeing, however, I am still not able to determine what that change was. 因此,似乎pexpect 4.0.1中引入的更改解决了我所看到的问题,但是,我仍然无法确定该更改是什么。 GITHUB has a label created for 4.0.1, but no official release and no release notes. GITHUB的标签是为4.0.1创建的,但没有正式发行,也没有发行说明。 The official release notes for 4.1.0 don't seem to allude to anything having to do with "options" being added or removed as parameter. 4.1.0的官方发行说明似乎没有暗示与“选项”作为参数的添加或删除有关。 But clearly, anything further than pexpect 4.0.1 clears this issue. 但很明显,除pexpect 4.0.1之外的任何内容都可以解决此问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Selenium Firefox:TypeError:__init__() 得到了一个意外的关键字参数“options” - Selenium Firefox : TypeError: __init__() got an unexpected keyword argument 'options' TypeError at '' __init__() 得到一个意外的关键字参数 '' - TypeError at '' __init__() got an unexpected keyword argument '' Python TypeError:__init __()获得了意外的关键字参数'serialized_options' - Python TypeError: __init__() got an unexpected keyword argument 'serialized_options' Tensorboard TypeError:__init__() 得到了一个意外的关键字参数“serialized_options” - Tensorboard TypeError: __init__() got an unexpected keyword argument 'serialized_options' TypeError: __init__() 在使用 EdgeOptions 时得到了一个意外的关键字参数 'options' - TypeError: __init__() got an unexpected keyword argument 'options' while using EdgeOptions Scrapy错误:TypeError:__ init __()得到一个意外的关键字参数'deny' - Scrapy Error: TypeError: __init__() got an unexpected keyword argument 'deny' TypeError:__init __()得到了意外的关键字参数错误 - TypeError: __init__() got an unexpected keyword argument error TypeError:__ init __()在argparse中有一个意外的关键字参数'type' - TypeError: __init__() got an unexpected keyword argument 'type' in argparse 图片/创建时发生TypeError-__init __()得到了意外的关键字参数'save' - TypeError at images/create - __init__() got an unexpected keyword argument 'save' TypeError:__init __()获得了意外的关键字参数'n_components' - TypeError: __init__() got an unexpected keyword argument 'n_components'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM