Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: 'error' object is not subscriptable #19

Open
kappa10j opened this issue Apr 5, 2020 · 3 comments
Open

TypeError: 'error' object is not subscriptable #19

kappa10j opened this issue Apr 5, 2020 · 3 comments

Comments

@kappa10j
Copy link

kappa10j commented Apr 5, 2020

When executing the following code:

"with requests.get(addr, auth=HttpNegotiateAuth(), timeout=30) as res:"

an exception is thrown at line 2 which isn't subscriptable so the library throws an exception at line 8. The issue arises when there is an authorization issue with our iis server. Can the library be fixed so I can get a proper response error message? What other info would you need from me?

thanks

try:
--> error, auth = clientauth.authorize(sec_buffer)
request.headers['Authorization'] = '{} {}'.format(scheme, base64.b64encode(auth[0].Buffer).decode('ASCII'))
_logger.debug('Sending Response - error={} authenticated={}'.format(error, clientauth.authenticated))
except pywintypes.error as e:
--> _logger.debug('Error calling {}: {}'.format(e[1], e[2]), exc_info=e)
return response

@vishwas-a-n
Copy link

vishwas-a-n commented Apr 6, 2020

error in accessing/handling pywintypes.error object @ line #123 & #185

except pywintypes.error as e:
    _logger.debug('Error calling {}: {}'.format(e[1], e[2]), exc_info=e)
    return response

Below is the fix

except pywintypes.error as e:
    _logger.debug('Error calling {}: {}'.format(e.args[1], e.args[2]), exc_info=e)
    return response

kindly fix this.

@kappa10j
Copy link
Author

kappa10j commented Apr 6, 2020

thanks for the response. Is this something I should fix locally in the library or would it be updated in the pip package?

@alex-ledovsky
Copy link

Same thing..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants