Re: EnvironmentError

2020-11-20 Thread Ivan "Rambius" Ivanov
Hello,

On Thu, Nov 19, 2020 at 1:56 PM Usman Musa  wrote:
>
> When I try to install a package or upgrade pip,  using pip install I got
> this error massage.
>  WARNING: Retrying (Retry(total=4, connect=None, read=None,
> redirect=None, status=None)) after connection broken by
> 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED]
> certificate verify failed: certificate is not yet valid (_ssl.c:1122)'))':
> /packages/97/f3/c064343ac58d1a54c393a3f66483a29500f644a5918deeb935d28673edd9/virtualenv-20.1.0-py2.py3-none-any.whl
>   WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None,
> status=None)) after connection broken by
> 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED]
> certificate verify failed: certificate is not yet valid (_ssl.c:1122)'))':
> /packages/97/f3/c064343ac58d1a54c393a3f66483a29500f644a5918deeb935d28673edd9/virtualenv-20.1.0-py2.py3-none-any.whl
>   WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None,
> status=None)) after connection broken by
> 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED]
> certificate verify failed: certificate is not yet valid (_ssl.c:1122)'))':
> /packages/97/f3/c064343ac58d1a54c393a3f66483a29500f644a5918deeb935d28673edd9/virtualenv-20.1.0-py2.py3-none-any.whl
>   WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None,
> status=None)) after connection broken by
> 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED]
> certificate verify failed: certificate is not yet valid (_ssl.c:1122)'))':
> /packages/97/f3/c064343ac58d1a54c393a3f66483a29500f644a5918deeb935d28673edd9/virtualenv-20.1.0-py2.py3-none-any.whl
>   WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None,
> status=None)) after connection broken by
> 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED]
> certificate verify failed: certificate is not yet valid (_ssl.c:1122)'))':
> /packages/97/f3/c064343ac58d1a54c393a3f66483a29500f644a5918deeb935d28673edd9/virtualenv-20.1.0-py2.py3-none-any.whl
> ERROR: Could not install packages due to an EnvironmentError:
> HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries
> exceeded with url:
> /packages/97/f3/c064343ac58d1a54c393a3f66483a29500f644a5918deeb935d28673edd9/virtualenv-20.1.0-py2.py3-none-any.whl
> (Caused by SSLError(SSLCertVerificationError(1, '[SSL:
> CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate is not
> yet valid (_ssl.c:1122)')))
> Please help me out
> --
> https://mail.python.org/mailman/listinfo/python-list

The error says that the certificate of files.pythonhosted.org is not
valid, but this is definitely not the case. I think you sit behind
some ssl proxy and it behaves as a man-in-the-middle and replaces the
certificate with its own (I was experiencing that in a previous job).

You have several choices:

1) pass --trusted-host files.pythonhosted.org to disable the certificate check
2) import the ssl certificate of the ssl proxy (if you have such) into
python's certificate store
3) speak with the local system administrators about that. They may be of help.

Regards
rambius

-- 
Tangra Mega Rock: http://www.radiotangra.com
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: EnvironmentError

2020-11-20 Thread Peter Pearson
On Thu, 19 Nov 2020 13:19:07 +0100, Usman Musa  wrote:
> When I try to install a package or upgrade pip,  using pip install I got
> this error massage.
>  WARNING: Retrying (Retry(total=4, connect=None, read=None,
> redirect=None, status=None)) after connection broken by
> 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED]
> certificate verify failed: certificate is not yet valid (_ssl.c:1122)'))':
[snip]
> Please help me out

Just guessing, here.  Might "not yet valid" mean that your computer's
clock is set to 1970?

Is there any indication *whose* certificate is "not yet valid"?  E.g.,
some URL from which pip is trying to load things?

-- 
To email me, substitute nowhere->runbox, invalid->com.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python Client Rest API Invocation - POST with empty body - Invalid character found in method name [{}POST]. HTTP method names must be tokens

2020-11-20 Thread Dieter Maurer
Shelke, Bhushan wrote at 2020-11-19 15:12 +:
>I have a Tomcat+Java based server exposing REST APIs. I am writing a client in 
>python to consume those APIs. Everything is fine until I send empty body in 
>POST request. It is a valid use case for us. If I send empty body I get 400 
>bad request error - Invalid character found in method name [{}POST]. HTTP 
>method names must be tokens.

`[{}POST]` would definitely be a wrong method.

I would use the Python debugger (--> module `pdb`) to
find out where it comes from.
-- 
https://mail.python.org/mailman/listinfo/python-list


RE: Python Client Rest API Invocation - POST with empty body - Invalid character found in method name [{}POST]. HTTP method names must be tokens

2020-11-20 Thread Joseph L. Casale
>  Invalid character found in method name [{}POST]. HTTP method names must be 
> tokens.

/snip

> I could see in from wireshark dumps it looked like - {}POST  
> HTTP/1.1

The error message and your own debugging indicate the error.

Your method *name* is {}POST, you have somehow included two
brackets in the name of the method.

jlc
-- 
https://mail.python.org/mailman/listinfo/python-list