#🔒 Problem with ClientContext().with_user_credentials
47 messages · Page 1 of 1 (latest)
@raw tide
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
Can you make sure to send the error message as text instead of screenshots please?
But it looks like response is None
what does that mean ? :c
hard to tell. Can you share the code and the full error message?
Use a pastebin pls
yes 2sec
this is the error generated
Can you copy and paste properly?
code is this : ```py
Authentication
ctx = ClientContext(url).with_user_credentials(username, password)
web = ctx.web.get().execute_query()
It looks worse than the screenshots
yeah ... when I open it in text editor, this is what it gave :c
wait
File c:\Users\ridgh\AppData\Local\Programs\Python\Python312\Lib\site-packages\urllib3\connectionpool.py:467, in HTTPConnectionPool._make_request(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length)
466 try:
--> 467 self._validate_conn(conn)
468 except (SocketTimeout, BaseSSLError) as e:
File c:\Users\ridgh\AppData\Local\Programs\Python\Python312\Lib\site-packages\urllib3\connectionpool.py:1099, in HTTPSConnectionPool._validate_conn(self, conn)
1098 if conn.is_closed:
-> 1099 conn.connect()
1101 # TODO revise this, see https://github.com/urllib3/urllib3/issues/2791
File c:\Users\ridgh\AppData\Local\Programs\Python\Python312\Lib\site-packages\urllib3\connection.py:653, in HTTPSConnection.connect(self)
651 server_hostname_rm_dot = server_hostname.rstrip(".")
--> 653 sock_and_verified = _ssl_wrap_socket_and_match_hostname(
654 sock=sock,
655 cert_reqs=self.cert_reqs,
656 ssl_version=self.ssl_version,
657 ssl_minimum_version=self.ssl_minimum_version,
658 ssl_maximum_version=self.ssl_maximum_version,
659 ca_certs=self.ca_certs,
660 ca_cert_dir=self.ca_cert_dir,
661 ca_cert_data=self.ca_cert_data,
662 cert_file=self.cert_file,
663 key_file=self.key_file,
...
--> 114 logger.error(e.response.text)
115 self.error = "Error: {}".format(e)
116 raise ValueError(e.response.text)
AttributeError: 'NoneType' object has no attribute 'text'
have a look
nope but this is the lines generating the error
The error message doesn't refer to anything to those 2 lines.
But reading this, it just seems like a SSL Connection error. But I can't be sure. Seems like a 2 part error message
hmm is there a way to solve that ?
I need more info. The whole code and the whole error message
hmm
I can't really give the whole code because it contains credential information
but from what I know, the error is in the lines given
where does ClientContext come from?
ah sharepoint
Try and disable SSL https://github.com/vgrem/Office365-REST-Python-Client/issues/372#issuecomment-877349951
idk
There's a couple of Github issues of similar nature
The latest one doesn't seem to be answered
🤷♂️
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.