Re: SSL Certificate Verify Failed (_ssl.c:600) using Windows Server 2019

2020-04-30 Thread separated via Python-list
I have tried '-pip install certifi' but it didnt work

I can provide the rdp login to you who want to help, just wont waste my cash 
for 1 month rdp.

Sent with ProtonMail Secure Email.

‐‐‐ Original Message ‐‐‐
On Thursday, April 30, 2020 4:11 AM, separated via Python-list 
 wrote:

> hello python-list and the subsribers,
>
> I just bought a rdp from someone and try to install python in order to 
> running youtube-dl but when I just run a simple youtube-dl command like 
> 'youtube-dl [youtube video url]' it got me this message :
>
> ERROR: Unable to download webpage:  CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)> (caused by 
> URLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify 
> failed (_ssl.c:600)'),))
>
> Im operating system is windows server 2019, I have tried running youtube-dl 
> from windows server 2016 but it works fine without any settings necessary.
>
> I hope I can get the answer here because my billing keeps running out of time.
>
> best regards,
> separated
>
> --
>
> https://mail.python.org/mailman/listinfo/python-list


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


Re: SSL Certificate Verify Failed (_ssl.c:600) using Windows Server 2019

2020-04-30 Thread Dieter Maurer
separated wrote at 2020-4-29 21:11 +:
>I just bought a rdp from someone and try to install python in order to running 
>youtube-dl but when I just run a simple youtube-dl command like 'youtube-dl 
>[youtube video url]' it got me this message :
>
>ERROR: Unable to download webpage: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)> (caused by 
>URLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify 
>failed (_ssl.c:600)'),))

Either the ssl certificate provided by the server is invalid
or Python lacks the necessary CA (= "Certificate Authority") root
certificates for its verification.

I would use a browser to access the url and see what it says
about the used certificate.

Python typically uses the same certificates also used by
browsers. I do not know Windows and cannot tell you where those
certificates are located and how to add additional root certificates.
-- 
https://mail.python.org/mailman/listinfo/python-list


python Netcdf and ncdump

2020-04-30 Thread J Conrado



Hi,


I read my netcdf data and I did:


print(f)
print("f.variables[SST] ",f.variables["SST"])


and I had:


f.variables[SST]  
int16 SST(y, x)
    _FillValue: -1
    long_name: ABI L2+ Sea Surface (Skin) Temperature
    standard_name: sea_surface_skin_temperature
    _Unsigned: true
    valid_range: [ 0 -6]
    scale_factor: 0.00244163
    add_offset: 180.0
    units: K



I used the ncdum for the same data I had :


variables:
    short SST(y, x) ;
        SST:_FillValue = -1s ;
        SST:long_name = "ABI L2+ Sea Surface (Skin) Temperature" ;
        SST:standard_name = "sea_surface_skin_temperature" ;
        SST:_Unsigned = "true" ;
        SST:valid_range = 0s, -6s ;
        SST:scale_factor = 0.00244163f ;
        SST:add_offset = 180.f ;
        SST:units = "K" ;


Please,

Please can someone explain to me why I have this difference: in Python 
int16 SST(y, x) and with ncdump -h short SST(y, x)


Thank you, Conrado

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


Re: How to test?

2020-04-30 Thread Manfred Lotz
On Mon, 27 Apr 2020 18:21:39 +1200
DL Neil  wrote:

...

> 
> Given your replies, 'now' might be a good time to take a look at
> Pytest, and see how you could use it to help build better code - by
> building tested units/functions which are assembled into ever-larger
> tested-units... (there is a range of choice/other testing aids if
> Pytest doesn't take your fancy)

I have to admit I chose unittest. Simply because it is in the standard
lbrary. As so many people seem to prefer pytest I should take a look at
it.

-- 
Manfred

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


Re: python Netcdf and ncdump

2020-04-30 Thread Rhodri James

On 30/04/2020 18:55, J Conrado wrote:

Please,

Please can someone explain to me why I have this difference: in Python 
int16 SST(y, x) and with ncdump -h short SST(y, x)


Presumably on your computer a (signed) short integer is a (signed) 
sixteen bit integer.  That's rather unhelpful of ncdump.


--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list


What user-defined request error levels are recommended?

2020-04-30 Thread Dan Campbell
Hi, what range of error codes are recommended, if we wanted to return a 
user-defined code?

Obviously, we don't want to use a code in the 200+ range, or the 400+ range, 
e.g.

I want to throw, or just return, a code that represents that the size of a web 
page (len(response.content)) is less than the expected size.


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


Re: What user-defined request error levels are recommended?

2020-04-30 Thread Ed Leafe via Python-list
On Apr 30, 2020, at 15:14, Dan Campbell  wrote:
> 
> Hi, what range of error codes are recommended, if we wanted to return a 
> user-defined code?
> 
> Obviously, we don't want to use a code in the 200+ range, or the 400+ range, 
> e.g.
> 
> I want to throw, or just return, a code that represents that the size of a 
> web page (len(response.content)) is less than the expected size.

You can create your own internal codes as long as they don’t clash with the 
standard code. If the custom code is for a success, a 2xx code would be 
appropriate. If it is a user error, you could use a 4xx code.

However, I would prefer to use the standard codes, and add a custom header with 
more information on the issue.


-- Ed Leafe






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


Re: What user-defined request error levels are recommended?

2020-04-30 Thread Dan Campbell
On Thursday, April 30, 2020 at 4:42:41 PM UTC-4, Ed Leafe wrote:
> On Apr 30, 2020, at 15:14, dc wrote:
> > 
> > Hi, what range of error codes are recommended, if we wanted to return a 
> > user-defined code?
> > 
> > Obviously, we don't want to use a code in the 200+ range, or the 400+ 
> > range, e.g.
> > 
> > I want to throw, or just return, a code that represents that the size of a 
> > web page (len(response.content)) is less than the expected size.
> 
> You can create your own internal codes as long as they don’t clash with the 
> standard code. If the custom code is for a success, a 2xx code would be 
> appropriate. If it is a user error, you could use a 4xx code.
> 
> However, I would prefer to use the standard codes, and add a custom header 
> with more information on the issue.
> 
> 
> -- Ed Leafe

Ok, I'll try to find the the 400s list.  My concern is that a future library 
will use the 400+ code that I choose.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: What user-defined request error levels are recommended?

2020-04-30 Thread Hexamorph
Am 30.04.2020 um 22:56 schrieb Dan Campbell:
> On Thursday, April 30, 2020 at 4:42:41 PM UTC-4, Ed Leafe wrote:
>> On Apr 30, 2020, at 15:14, dc wrote:
>>>
>>> Hi, what range of error codes are recommended, if we wanted to return a 
>>> user-defined code?
>>>
>>> Obviously, we don't want to use a code in the 200+ range, or the 400+ 
>>> range, e.g.
>>>
>>> I want to throw, or just return, a code that represents that the size of a 
>>> web page (len(response.content)) is less than the expected size.
>>
>> You can create your own internal codes as long as they don’t clash with the 
>> standard code. If the custom code is for a success, a 2xx code would be 
>> appropriate. If it is a user error, you could use a 4xx code.
>>
>> However, I would prefer to use the standard codes, and add a custom header 
>> with more information on the issue.
>>
>>
>> -- Ed Leafe
>
> Ok, I'll try to find the the 400s list.  My concern is that a future library 
> will use the 400+ code that I choose.
>

According to the German Wikipedia, some software vendors use 9xx for
proprietary error codes, which have never been mentioned in the RFC.
They are probably save for non-standard use.


https://de.wikipedia.org/wiki/HTTP-Statuscode#9xx_%E2%80%93_Propriet%C3%A4re_Fehler
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: What user-defined request error levels are recommended?

2020-04-30 Thread Dan Sommers
On Thu, 30 Apr 2020 13:14:42 -0700 (PDT)
Dan Campbell  wrote:

> Hi, what range of error codes are recommended, if we wanted to return
> a user-defined code?

> Obviously, we don't want to use a code in the 200+ range, or the 400+
> range, e.g.

> I want to throw, or just return, a code that represents that the size
> of a web page (len(response.content)) is less than the expected size.

It sounds like you're building an HTTP server; if not, then please give
more details.

My question is:  how "strong" is that expectation?  If there's some
calculation that says that the response should be X octets, and then the
logic comes up with Y octets instead, isn't that a logic bug?  Shouldn't
that be a 5XX response?

Did the client request X octets, but the server knows better and returns
a correct response that's Y octets long?  Then use a 2XX code.  Did the
client request X octets, but the server has more information and
disagrees?  Then use a 401 (Bad Request) code.

Most of these codes allow the server to pass additional information back
to the client, either in standard headers, X- headers, or the body of
the response.

What's the actual use case?

(Also, this isn't really a Python question; it's either a plain HTTP
question, or perhaps one specific to your web server.)

-- 
“Atoms are not things.” – Werner Heisenberg
Dan Sommers, http://www.tombstonezero.net/dan
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: SSL Certificate Verify Failed (_ssl.c:600) using Windows Server 2019

2020-04-30 Thread separated via Python-list
thank you for your suggestion, maurer. surprisingly it works.

I tried to download chrome instead my previous browser is firefox, just 
download it and try to do a simple youtube-dl command and it works.

but I still dont know why when I running a command 'youtube-dl -U' then got a 
message 'ERROR: can't find the current version. Please try again later' maybe 
it needs a sudo password.

Sent with ProtonMail Secure Email.

‐‐‐ Original Message ‐‐‐
On Friday, May 1, 2020 1:00 AM, Dieter Maurer  wrote:

> separated wrote at 2020-4-29 21:11 +:
>
> > I just bought a rdp from someone and try to install python in order to 
> > running youtube-dl but when I just run a simple youtube-dl command like 
> > 'youtube-dl [youtube video url]' it got me this message :
> > ERROR: Unable to download webpage:  > CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)> (caused 
> > by URLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate 
> > verify failed (_ssl.c:600)'),))
>
> Either the ssl certificate provided by the server is invalid
> or Python lacks the necessary CA (= "Certificate Authority") root
> certificates for its verification.
>
> I would use a browser to access the url and see what it says
> about the used certificate.
>
> Python typically uses the same certificates also used by
> browsers. I do not know Windows and cannot tell you where those
> certificates are located and how to add additional root certificates.


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


Re: SSL Certificate Verify Failed (_ssl.c:600) using Windows Server 2019

2020-04-30 Thread Dieter Maurer
separated wrote at 2020-5-1 02:51 +:
> ...
>but I still dont know why when I running a command 'youtube-dl -U' then got a 
>message 'ERROR: can't find the current version. Please try again later' maybe 
>it needs a sudo password.

This looks like a log message (the "ERROR" likely comes from this).
I would search the source code (recursively) for "find the current version"
to locate the piece of code responsible for the message and
then look around to find out why it is generated.
-- 
https://mail.python.org/mailman/listinfo/python-list