Wenn man dem Internet glaub liegt es an einer zu neuen Version von “requests-ntlm” dieses darf nur die Version 1.1.0 haben. Ist aber in Version 1.2.0 vorhanden.
Da hat sich einiges geändert
committed 09:03PM - 06 Feb 23 UTC
* Migrate to PySPNEGO
The ntlm_auth library is deprecated in favour of pyspne… go. This commit
migrates to this library, patching some methods to ensure dependent code
will continue to work.
* Remove domain parsing tests
PySPNEGO handles the parsing of the domain component of the username
* Add a test for authenticating with an NTLM hash
PySPNEGO allows usage of an NTLM hash in place of a password, so test
that this is functioning properly.
* Update CBT and SessionSecurity code
* Fix up tests
* Update readme
---------
Co-authored-by: Jordan Borean <jborean93@gmail.com>
Im Github von requests-ntlm gibt es auch eine Issue zu dem Fehler
opened 05:44PM - 03 Mar 23 UTC
Hello,
I am receiving this error:
**Stacktrace**
```
...
Traceback (mos… t recent call last):
File "C:\Users\eric-l\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\eric-l\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "...", line 18, in <module>
from requests_ntlm import HttpNtlmAuth
File "C:\Users\eric-l\AppData\Local\Programs\Python\Python39\lib\site-packages\requests_ntlm\__init__.py", line 1, in <module>
from .requests_ntlm import HttpNtlmAuth
File "C:\Users\eric-l\AppData\Local\Programs\Python\Python39\lib\site-packages\requests_ntlm\requests_ntlm.py", line 14, in <module>
class ShimSessionSecurity:
File "C:\Users\eric-l\AppData\Local\Programs\Python\Python39\lib\site-packages\requests_ntlm\requests_ntlm.py", line 17, in ShimSessionSecurity
def __init__(self, context: spnego.ContextProxy) -> None:
AttributeError: module 'spnego' has no attribute 'ContextProxy'
```
The error is there: https://github.com/requests/requests-ntlm/blob/83aab6d61a1408ff63361863902c1d0ecb29b6cc/requests_ntlm/requests_ntlm.py#L17
I checked the spnego module
https://github.com/jborean93/pyspnego/blob/e3c1d101a79e5a055ee390e8f9bd8458c1192da8/src/spnego/_context.py#L211
and it seems like `ContextProxy` is at
* `spnego._context.ContextProxy`
and not at:
* `spnego.ContextProxy`
While looking about this error I also found: https://github.com/maurosoria/dirsearch/issues/1285 which talks about the same issue
Dort ist auch ein Workaround beschrieben.
1 Like