Opened 8 years ago

Last modified 8 years ago

#27725 closed Bug

requests.post fail inside of django shell but not python shell — at Initial Version

Reported by: paulfab Owned by: nobody
Component: Uncategorized Version: 1.10
Severity: Normal Keywords: request fails
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When I execute :
requests.post("https://slack.com/api/chat.postMessage", data= {"channel": "maison"})
it fails in the django shell (python manage.py shell) with the error :
InvalidCodepoint: Codepoint U+002A at position 1 of u'*' not allowed

but it doesnt fail in the python shell
So this tells me it is probable something Django related

Thanks

complete trace of the error is :
Traceback (most recent call last):

File "<console>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/requests/api.py", line 107, in post

return request('post', url, data=data, json=json, kwargs)

File "/usr/lib/python2.7/dist-packages/requests/api.py", line 53, in request

return session.request(method=method, url=url, kwargs)

File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 468, in request

resp = self.send(prep, send_kwargs)

File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 576, in send

r = adapter.send(request, kwargs)

File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 376, in send

timeout=timeout

File "/usr/local/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 594, in urlopen

chunked=chunked)

File "/usr/local/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 350, in _make_request

self._validate_conn(conn)

File "/usr/local/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 833, in _validate_conn

conn.connect()

File "/usr/local/lib/python2.7/dist-packages/urllib3/connection.py", line 324, in connect

cert = self.sock.getpeercert()

File "/usr/local/lib/python2.7/dist-packages/urllib3/contrib/pyopenssl.py", line 312, in getpeercert

'subjectAltName': get_subj_alt_name(x509)

File "/usr/local/lib/python2.7/dist-packages/urllib3/contrib/pyopenssl.py", line 185, in get_subj_alt_name

for name in ext.get_values_for_type(x509.DNSName)

File "/usr/local/lib/python2.7/dist-packages/urllib3/contrib/pyopenssl.py", line 141, in _dnsname_to_stdlib

name = idna.encode(name)

File "/usr/lib/python2.7/dist-packages/idna/core.py", line 354, in encode

result.append(alabel(label))

File "/usr/lib/python2.7/dist-packages/idna/core.py", line 275, in alabel

check_label(label)

File "/usr/lib/python2.7/dist-packages/idna/core.py", line 252, in check_label

raise InvalidCodepoint('Codepoint {0} at position {1} of {2} not allowed'.format(_unot(cp_value), pos+1, repr(label)))

InvalidCodepoint: Codepoint U+002A at position 1 of u'*' not allowed

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top