why the connection set with “keep live” in urllib.request always set to be“closed, thanks

2020-08-17 Thread xuanwu348
hi everyone


Good day, the code as below, I try to make a long connection by set the 
connection to "keep-alive", but actually it's not as expected. Why?  Thanks


import urllib.request as req
headers = {"authorization": "Bearer {}".format(self.token),
   "Content-Type": "multipart/form-data; 
boundary={}".format(self.boundary),
   "Connection": "keep-alive"}
request = req.Request(event_uri, headers=headers, data=data.encode("utf-8"))





Accept-Encoding: identity

Content-Length: 705

Host: 10.10.1.114:9443

User-Agent: Python-urllib/3.8

Authorization: Bearer a1.BUiPZxxCQdH2c9uegml

Content-Type: multipart/form-data; boundary=--testtest--

Connection: close







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


Final statement from Steering Council on politically-charged commit messages

2020-08-17 Thread Chris Angelico
For context, see this commit:

https://github.com/python/peps/commit/0c6427dcec1e98ca0bd46a876a7219ee4a9347f4

The commit message is highly politically charged and is now a
permanent part of the Python commit history. The Python Steering
Council has this to say:

https://github.com/python/steering-council/issues/34#issuecomment-675028005

"The SC discussed this and ... we do not deplore the message."

So now we know: go ahead and put all the political messages you like
into the commit messages, just don't put anything inappropriate into
the content. White supremacy has been mentioned; who wants to pick the
next hot topic?

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


Re: Final statement from Steering Council on politically-charged commit messages

2020-08-17 Thread Dylan Distasio
That's quite an interesting ruling by the SC.  I'm not surprised to see
them bend the knee to PC, but it is disheartening to see they're fine
opening a can of political worms in a programming language.  I suspect they
will deplore messages outside of their bubble though.

On Mon, Aug 17, 2020 at 2:30 PM Chris Angelico  wrote:

> For context, see this commit:
>
>
> https://github.com/python/peps/commit/0c6427dcec1e98ca0bd46a876a7219ee4a9347f4
>
> The commit message is highly politically charged and is now a
> permanent part of the Python commit history. The Python Steering
> Council has this to say:
>
> https://github.com/python/steering-council/issues/34#issuecomment-675028005
>
> "The SC discussed this and ... we do not deplore the message."
>
> So now we know: go ahead and put all the political messages you like
> into the commit messages, just don't put anything inappropriate into
> the content. White supremacy has been mentioned; who wants to pick the
> next hot topic?
>
> ChrisA
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Final statement from Steering Council on politically-charged commit messages

2020-08-17 Thread Chris Angelico
On Tue, Aug 18, 2020 at 4:34 AM Dylan Distasio  wrote:
>
> That's quite an interesting ruling by the SC.  I'm not surprised to see them 
> bend the knee to PC, but it is disheartening to see they're fine opening a 
> can of political worms in a programming language.  I suspect they will 
> deplore messages outside of their bubble though.
>

Yes. I was hoping for "we should rewrite that commit", and would have
been content with "we won't rewrite it, but we don't want that
repeated". But the SC said that it is absolutely fine to write commit
messages like that.

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


Re: Final statement from Steering Council on politically-charged commit messages

2020-08-17 Thread gia
Math should stop being standardized, as it could alienate people of other
colors to it.

Commit should be rewritten as "Remove book advert from comments".

On Mon, Aug 17, 2020 at 1:39 PM Chris Angelico  wrote:

> On Tue, Aug 18, 2020 at 4:34 AM Dylan Distasio 
> wrote:
> >
> > That's quite an interesting ruling by the SC.  I'm not surprised to see
> them bend the knee to PC, but it is disheartening to see they're fine
> opening a can of political worms in a programming language.  I suspect they
> will deplore messages outside of their bubble though.
> >
>
> Yes. I was hoping for "we should rewrite that commit", and would have
> been content with "we won't rewrite it, but we don't want that
> repeated". But the SC said that it is absolutely fine to write commit
> messages like that.
>
> ChrisA
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: why the connection set with “keep live” in urllib.request always set to be“closed, thanks

2020-08-17 Thread Barry


> On 17 Aug 2020, at 18:23, xuanwu348  wrote:
> 
> hi everyone
> 
> 
> Good day, the code as below, I try to make a long connection by set the 
> connection to "keep-alive", but actually it's not as expected. Why?  Thanks

What this means is. Please web server keep the connect alive if you can.
The web server is allowed to close the connection if it wants too.

Barry

> 
> 
> import urllib.request as req
> headers = {"authorization": "Bearer {}".format(self.token),
>   "Content-Type": "multipart/form-data; 
> boundary={}".format(self.boundary),
>   "Connection": "keep-alive"}
> request = req.Request(event_uri, headers=headers, data=data.encode("utf-8"))
> 
> 
> 
> 
> 
> Accept-Encoding: identity
> 
> Content-Length: 705
> 
> Host: 10.10.1.114:9443
> 
> User-Agent: Python-urllib/3.8
> 
> Authorization: Bearer a1.BUiPZxxCQdH2c9uegml
> 
> Content-Type: multipart/form-data; boundary=--testtest--
> 
> Connection: close
> 
> 
> 
> 
> 
> 
> 
> Best Regards
> -- 
> https://mail.python.org/mailman/listinfo/python-list
> 

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


Re:Re: why the connection set with “keep live” in urllib.request always set to be“closed, thanks

2020-08-17 Thread xuanwu348



This means I want to structure my request header with "Connection: keep alive" 
for the server which support connect alive,
But I checked the requeset header send by myself, the connection still closed, 
no affect by set


And I also found this in python document:
==
urllib.request.urlopen(url, data=None, [timeout, ]*, cafile=None, capath=None, 
cadefault=False, context=None)

Open the URL url, which can be either a string or a Request object.

data must be an object specifying additional data to be sent to the server, or 
None if no such data is needed. See Request for details.

urllib.request module uses HTTP/1.1 and includes Connection:close header in its 
HTTP requests.

===
Does it mean urllib.request don't support 'keep alive'?


Thanks











在 2020-08-18 04:51:03,"Barry"  写道:
>
>
>> On 17 Aug 2020, at 18:23, xuanwu348  wrote:
>> 
>> hi everyone
>> 
>> 
>> Good day, the code as below, I try to make a long connection by set the 
>> connection to "keep-alive", but actually it's not as expected. Why?  Thanks
>
>What this means is. Please web server keep the connect alive if you can.
>The web server is allowed to close the connection if it wants too.
>
>Barry
>
>> 
>> 
>> import urllib.request as req
>> headers = {"authorization": "Bearer {}".format(self.token),
>>   "Content-Type": "multipart/form-data; 
>> boundary={}".format(self.boundary),
>>   "Connection": "keep-alive"}
>> request = req.Request(event_uri, headers=headers, data=data.encode("utf-8"))
>> 
>> 
>> 
>> 
>> 
>> Accept-Encoding: identity
>> 
>> Content-Length: 705
>> 
>> Host: 10.10.1.114:9443
>> 
>> User-Agent: Python-urllib/3.8
>> 
>> Authorization: Bearer a1.BUiPZxxCQdH2c9uegml
>> 
>> Content-Type: multipart/form-data; boundary=--testtest--
>> 
>> Connection: close
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> Best Regards
>> -- 
>> https://mail.python.org/mailman/listinfo/python-list
>> 
-- 
https://mail.python.org/mailman/listinfo/python-list


Error

2020-08-17 Thread Thiên Nguyễn Thanh
Hi,
I'm just starting to learn python.
I try to install a socketio library.
I got the following error
[image: image.png]
Please answer me with a detailed guide on how to solve the above problem!!
Thanks.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Final statement from Steering Council on politically-charged commit messages

2020-08-17 Thread thronobulax
On Monday, August 17, 2020 at 1:26:33 PM UTC-5, Chris Angelico wrote:
> For context, see this commit:
> 
> https://github.com/python/peps/commit/0c6427dcec1e98ca0bd46a876a7219ee4a9347f4
> 
> The commit message is highly politically charged and is now a
> permanent part of the Python commit history. The Python Steering
> Council has this to say:
> 
> https://github.com/python/steering-council/issues/34#issuecomment-675028005
> 
> "The SC discussed this and ... we do not deplore the message."
> 
> So now we know: go ahead and put all the political messages you like
> into the commit messages, just don't put anything inappropriate into
> the content. White supremacy has been mentioned; who wants to pick the
> next hot topic?
> 
> ChrisA

"All animals are equal, but some animals are more equal than others."

"We welcome a breadth of ideas so long as they agree with our views."

"Truth is a social construct."

"Math is evidence of white oppression."


Hopefully, there are some alt-right programmers that can put this new dalliance 
with politics to the test.  I, for one, want to watch the absurd right and the 
even more absurd left eat each each other.  

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


Re: Error

2020-08-17 Thread Igor Korot
Hi,



On Mon, Aug 17, 2020, 10:52 PM Thiên Nguyễn Thanh <
[email protected]> wrote:

> Hi,
> I'm just starting to learn python.
> I try to install a socketio library.
> I got the following error
> [image: image.png]
> Please answer me with a detailed guide on how to solve the above problem!!
> Thanks.
>

Unfortunately we will not be able to see the error as images are not going
to the list.

Please copy and paste an error

Thank you..



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


Re: Final statement from Steering Council on politically-charged commit messages

2020-08-17 Thread thronobulax
On Monday, August 17, 2020 at 1:26:33 PM UTC-5, Chris Angelico wrote:
> For context, see this commit:
> 
> https://github.com/python/peps/commit/0c6427dcec1e98ca0bd46a876a7219ee4a9347f4
> 
> The commit message is highly politically charged and is now a
> permanent part of the Python commit history. The Python Steering
> Council has this to say:
> 
> https://github.com/python/steering-council/issues/34#issuecomment-675028005
> 
> "The SC discussed this and ... we do not deplore the message."
> 
> So now we know: go ahead and put all the political messages you like
> into the commit messages, just don't put anything inappropriate into
> the content. White supremacy has been mentioned; who wants to pick the
> next hot topic?
> 
> ChrisA

It should be noted that these Darlings Of Conspicuous Caring are still using 
that - gasp! - horrid  "master' branch.  The very idea ...
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Error

2020-08-17 Thread Thiên Nguyễn Thanh
Thank you for your response.
it's in this file.

Vào Th 3, 18 thg 8, 2020 vào lúc 10:59 Igor Korot  đã
viết:

> Hi,
>
>
>
> On Mon, Aug 17, 2020, 10:52 PM Thiên Nguyễn Thanh <
> [email protected]> wrote:
>
>> Hi,
>> I'm just starting to learn python.
>> I try to install a socketio library.
>> I got the following error
>> [image: image.png]
>> Please answer me with a detailed guide on how to solve the above problem!!
>> Thanks.
>>
>
> Unfortunately we will not be able to see the error as images are not going
> to the list.
>
> Please copy and paste an error
>
> Thank you..
>
>
>
> --
>> https://mail.python.org/mailman/listinfo/python-list
>>
>
C:\Users\cuong>python -m pip install socketio
Collecting socketio
  Downloading socketio-0.2.1.tar.gz (6.1 kB)
Collecting setuptools==3.3
  Downloading setuptools-3.3-py2.py3-none-any.whl (545 kB)
 || 545 kB 1.3 MB/s
Collecting netifaces==0.10.6
  Downloading netifaces-0.10.6.tar.gz (25 kB)
Using legacy setup.py install for socketio, since package 'wheel' is not 
installed.
Using legacy setup.py install for netifaces, since package 'wheel' is not 
installed.
Installing collected packages: setuptools, netifaces, socketio
  Attempting uninstall: setuptools
Found existing installation: setuptools 47.1.0
Uninstalling setuptools-47.1.0:
  Successfully uninstalled setuptools-47.1.0
Running setup.py install for netifaces ... error
ERROR: Command errored out with exit status 1:
 command: 
'C:\Users\cuong\AppData\Local\Programs\Python\Python37\python.exe' -u -c 
'import sys, setuptools, tokenize; sys.argv[0] = 
'"'"'C:\\Users\\cuong\\AppData\\Local\\Temp\\pip-install-4vphk1cj\\netifaces\\setup.py'"'"';
 
__file__='"'"'C:\\Users\\cuong\\AppData\\Local\\Temp\\pip-install-4vphk1cj\\netifaces\\setup.py'"'"';f=getattr(tokenize,
 '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', 
'"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install 
--record 
'C:\Users\cuong\AppData\Local\Temp\pip-record-j_2aa79c\install-record.txt' 
--single-version-externally-managed --compile --install-headers 
'C:\Users\cuong\AppData\Local\Programs\Python\Python37\Include\netifaces'
 cwd: C:\Users\cuong\AppData\Local\Temp\pip-install-4vphk1cj\netifaces\
Complete output (11 lines):
Traceback (most recent call last):
  File "", line 1, in 
  File 
"C:\Users\cuong\AppData\Local\Programs\Python\Python37\lib\site-packages\setuptools\__init__.py",
 line 12, in 
from setuptools.extension import Extension
  File 
"C:\Users\cuong\AppData\Local\Programs\Python\Python37\lib\site-packages\setuptools\extension.py",
 line 7, in 
from setuptools.dist import _get_unpatched
  File 
"C:\Users\cuong\AppData\Local\Programs\Python\Python37\lib\site-packages\setuptools\dist.py",
 line 16, in 
import pkg_resources
  File 
"C:\Users\cuong\AppData\Local\Programs\Python\Python37\lib\site-packages\pkg_resources.py",
 line 1479, in 
register_loader_type(importlib_bootstrap.SourceFileLoader, 
DefaultProvider)
AttributeError: module 'importlib._bootstrap' has no attribute 
'SourceFileLoader'

ERROR: Command errored out with exit status 1: 
'C:\Users\cuong\AppData\Local\Programs\Python\Python37\python.exe' -u -c 
'import sys, setuptools, tokenize; sys.argv[0] = 
'"'"'C:\\Users\\cuong\\AppData\\Local\\Temp\\pip-install-4vphk1cj\\netifaces\\setup.py'"'"';
 
__file__='"'"'C:\\Users\\cuong\\AppData\\Local\\Temp\\pip-install-4vphk1cj\\netifaces\\setup.py'"'"';f=getattr(tokenize,
 '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', 
'"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install 
--record 
'C:\Users\cuong\AppData\Local\Temp\pip-record-j_2aa79c\install-record.txt' 
--single-version-externally-managed --compile --install-headers 
'C:\Users\cuong\AppData\Local\Programs\Python\Python37\Include\netifaces' Check 
the logs for full command output.-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Error

2020-08-17 Thread Igor Korot
Hi,

On Mon, Aug 17, 2020 at 11:05 PM Thiên Nguyễn Thanh
 wrote:
>
> Thank you for your response.
> it's in this file.

Please don't send any attachments to the list.

There are very knowledgeable people here who will be able to help.

Unfortunately they have vision problems.

So, what is the problem with "copy-and-paste" the error message?
Are you that lazy? ;-)

Thank you.

>
> Vào Th 3, 18 thg 8, 2020 vào lúc 10:59 Igor Korot  đã 
> viết:
>>
>> Hi,
>>
>>
>>
>> On Mon, Aug 17, 2020, 10:52 PM Thiên Nguyễn Thanh 
>>  wrote:
>>>
>>> Hi,
>>> I'm just starting to learn python.
>>> I try to install a socketio library.
>>> I got the following error
>>> [image: image.png]
>>> Please answer me with a detailed guide on how to solve the above problem!!
>>> Thanks.
>>
>>
>> Unfortunately we will not be able to see the error as images are not going 
>> to the list.
>>
>> Please copy and paste an error
>>
>> Thank you..
>>
>>
>>
>>> --
>>> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Error

2020-08-17 Thread Igor Korot
On Tue, Aug 18, 2020 at 12:00 AM Igor Korot  wrote:
>
> Hi,
>
> On Mon, Aug 17, 2020 at 11:05 PM Thiên Nguyễn Thanh
>  wrote:
> >
> > Thank you for your response.
> > it's in this file.
>
> Please don't send any attachments to the list.
>
> There are very knowledgeable people here who will be able to help.
>
> Unfortunately they have vision problems.
>
> So, what is the problem with "copy-and-paste" the error message?
> Are you that lazy? ;-)

Besides for security reasons most people will not open attachments
from unknown source, even if they are on *nix/Mac...

So could you please, do that?

Thank you.


>
> Thank you.
>
> >
> > Vào Th 3, 18 thg 8, 2020 vào lúc 10:59 Igor Korot  đã 
> > viết:
> >>
> >> Hi,
> >>
> >>
> >>
> >> On Mon, Aug 17, 2020, 10:52 PM Thiên Nguyễn Thanh 
> >>  wrote:
> >>>
> >>> Hi,
> >>> I'm just starting to learn python.
> >>> I try to install a socketio library.
> >>> I got the following error
> >>> [image: image.png]
> >>> Please answer me with a detailed guide on how to solve the above problem!!
> >>> Thanks.
> >>
> >>
> >> Unfortunately we will not be able to see the error as images are not going 
> >> to the list.
> >>
> >> Please copy and paste an error
> >>
> >> Thank you..
> >>
> >>
> >>
> >>> --
> >>> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Final statement from Steering Council on politically-charged commit messages

2020-08-17 Thread justin walters
I for one don't want to see politics involved in PL development. However,
inclusivity isn't a political issue, it's a human rights issue.

Do I agree with the PR, not exactly. However, I do think we as a community
should be accommodating to people
Whose use of the English language differs from the standard as long as the
meaning is clear.

This thread reads like a bunch of old fuddy duddies complaining about
immigrants not speaking perfect English at a fast food restaurant.

Feel free to ban me from the list if this doesn't meet your standards.



On Mon, Aug 17, 2020, 9:03 PM  wrote:

> On Monday, August 17, 2020 at 1:26:33 PM UTC-5, Chris Angelico wrote:
> > For context, see this commit:
> >
> >
> https://github.com/python/peps/commit/0c6427dcec1e98ca0bd46a876a7219ee4a9347f4
> >
> > The commit message is highly politically charged and is now a
> > permanent part of the Python commit history. The Python Steering
> > Council has this to say:
> >
> >
> https://github.com/python/steering-council/issues/34#issuecomment-675028005
> >
> > "The SC discussed this and ... we do not deplore the message."
> >
> > So now we know: go ahead and put all the political messages you like
> > into the commit messages, just don't put anything inappropriate into
> > the content. White supremacy has been mentioned; who wants to pick the
> > next hot topic?
> >
> > ChrisA
>
> It should be noted that these Darlings Of Conspicuous Caring are still
> using that - gasp! - horrid  "master' branch.  The very idea ...
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list