[issue24564] shutil.copytree fails when copying NFS to NFS

2019-05-29 Thread Giampaolo Rodola'


Giampaolo Rodola'  added the comment:


New changeset f1487b323549e2360460383b4304f6592fb38e27 by Giampaolo Rodola 
(Miss Islington (bot)) in branch '3.7':
bpo-24564: shutil.copystat(): ignore EINVAL on os.setxattr() (GH-13369)
https://github.com/python/cpython/commit/f1487b323549e2360460383b4304f6592fb38e27


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37091] subprocess - uncaught PermissionError in send_signal can cause hang

2019-05-29 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +gregory.p.smith

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: How to use ssh-agent in windows in python?

2019-05-29 Thread eryk sun
On 5/29/19, Cameron Simpson  wrote:
>
> So start with this:
>
>   p = subprocess.Popen('ssh-agent -s', stdin = subprocess.PIPE, stdout =
> subprocess.PIPE, stderr = subprocess.PIPE, shell = True, universal_newlines
> = True)

I'm wary of relying on the default encoding here. ssh-agent probably
writes ASCII or ANSI text to the pipe, and Python defaults to decoding
as ANSI ('mbcs'). However, Windows filesystem paths can use any
Unicode characters. (A filename is a string of up to 255 16-bit
wchar_t values, sans reserved characters, regardless of whether it's
valid UTF-16LE, but let's assume it's valid Unicode text for the sake
of everyone's sanity.) This is a problem when a user name can't be
encoded with the system ANSI codepage. In particular, it's a concern
for the user's %temp% directory (i.e.
"C:/Users//AppData/Local/Temp") in the SSH_AUTH_SOCK
environment variable.

That said, at least for the MSYS2 build of ssh-agent.exe that's
included with Git, the user's %temp% directory is mapped to "/tmp" in
its emulated POSIX namespace, so this should be okay. Make sure the
Cygwin build behaves the same. Otherwise check whether there's a way
to force it to use UTF-8. MSYS2 apparently respects the LC_CTYPE
environment variable. Without LC_CTYPE set, it fails to even parse the
command line properly:

>>> bash = r'C:\Program Files\Git\usr\bin\bash.exe'
>>> command = 'echo αβγδε'
>>> subprocess.call([bash, '-c', command])
/usr/bin/bash: echo αβγδε: command not found
127

With it set, it parses the command correctly and writes UTF-8 encoded
text to stdout when it's a pipe or disk file:

>>> environ = os.environ.copy()
>>> environ['LC_CTYPE'] = 'en_US.utf8'
>>> subprocess.check_output([bash, '-c', command],
... env=environ, encoding='utf-8')
'αβγδε\n'
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue36610] os.sendfile can return EINVAL on Solaris

2019-05-29 Thread Giampaolo Rodola'


Giampaolo Rodola'  added the comment:

I currently have no Solaris box to test this against and am currently short on 
time but I'm of the opinion that because of:

   > Sendfile on Solaris can raise EINVAL if offset is equal or bigger than the 
size
   > of the file (Python expects that it will return 0 bytes sent in that case).

...and the fact that beta1 will happen soon it's safer to use sendfile() on 
Linux only. Googling for "solaris + sendfile" also raises suspicions that 
sendfile() may be broken on Solaris. shutil.copyfile() is too central to risk 
breaking it. 

We may also want to look at socket.sendfile() implementation and add tests for 
large files for both functions (socket.sendfile() and shutil.copyfile()). I'm 
adding that to my TODO list.

--
versions:  -Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36983] typing.__all__ has drifted from actual contents

2019-05-29 Thread Guido van Rossum


Guido van Rossum  added the comment:

Thanks! No 3.6 backport is needed after all.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36983] typing.__all__ has drifted from actual contents

2019-05-29 Thread miss-islington


miss-islington  added the comment:


New changeset 3a98bbf7275903a0f84d1374abd0b7f3a85950a4 by Miss Islington (bot) 
(Anthony Sottile) in branch '3.7':
[3.7] bpo-36983: Fix typing.__all__ and add test for exported names (GH-13456) 
(GH-13662)
https://github.com/python/cpython/commit/3a98bbf7275903a0f84d1374abd0b7f3a85950a4


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36610] os.sendfile can return EINVAL on Solaris

2019-05-29 Thread Giampaolo Rodola'


Change by Giampaolo Rodola' :


--
pull_requests: +13563
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/13675

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37095] [Feature Request]: Add zstd support in tarfile

2019-05-29 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +lars.gustaebel, serhiy.storchaka
versions: +Python 3.8, Python 3.9 -Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37095] [Feature Request]: Add zstd support in tarfile

2019-05-29 Thread Evan Greenup


New submission from Evan Greenup :

Zstandard is getting more and more popular. It could be awesome if tarfile 
support this compression format for .tar.zst file.

--
components: Library (Lib)
messages: 343945
nosy: evan0greenup
priority: normal
severity: normal
status: open
title: [Feature Request]: Add zstd support in tarfile
type: enhancement
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24564] shutil.copytree fails when copying NFS to NFS

2019-05-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13562
pull_request: https://github.com/python/cpython/pull/13673

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24564] shutil.copytree fails when copying NFS to NFS

2019-05-29 Thread Giampaolo Rodola'


Giampaolo Rodola'  added the comment:


New changeset a16387ab2d85f19665920bb6ff91a7e57f59dd2a by Giampaolo Rodola 
(Ying Wang) in branch 'master':
bpo-24564: shutil.copystat(): ignore EINVAL on os.setxattr() (GH-13369)
https://github.com/python/cpython/commit/a16387ab2d85f19665920bb6ff91a7e57f59dd2a


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



write function call _io_BufferedWriter_write_impl twice?

2019-05-29 Thread Windson Yang
My script looks like this:

f = open('myfile', 'a+b')
f.write(b'abcde')

And I also add a `printf` statement in the _io_BufferedWriter_write_impl

function.

static PyObject * _io_BufferedWriter_write_impl(buffered *self,
Py_buffer *buffer)
/*[clinic end generated code: output=7f8d1365759bfc6b
input=dd87dd85fc7f8850]*/
{
printf("call write_impl\n");
PyObject *res = NULL;
Py_ssize_t written, avail, remaining;
Py_off_t offset;
   ...

After I compiled then run my script. I found _io_BufferedWriter_write_impl

had
been called twice which I expected only once. The second time it changed
self->pos to an unexpected value too.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue37094] Provide an example for TestCase.skipTest in unittest doc

2019-05-29 Thread 麦栋铖

New submission from 麦栋铖 :

I found that there's an function TestCase.skipTest(reason)[0] supports skipping 
test in testing, but there's no example for this function in chapter Skipping 
tests[1] and expected failures

I create PR[2] for updating the example for TestCase.skipTest in unittest doc.
The example is from Lib/unittest/test, the test for unittest.

I am sorry for that i don't know if the issue tracker support markdown link 
syntax, so i just copy and paste the link below:

[0] https://docs.python.org/3.7/library/unittest.html#unittest.TestCase.skipTest
[1]https://docs.python.org/3.7/library/unittest.html#skipping-tests-and-expected-failures
[2]https://github.com/python/cpython/pull/13645

--
assignee: docs@python
components: Documentation
messages: 343943
nosy: docs@python, 麦栋铖
priority: normal
pull_requests: 13561
severity: normal
status: open
title: Provide an example for TestCase.skipTest in unittest doc
type: enhancement
versions: Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36373] Deprecate explicit loop parameter in all public asyncio APIs

2019-05-29 Thread Emmanuel Arias


Change by Emmanuel Arias :


--
pull_requests: +13560
pull_request: https://github.com/python/cpython/pull/13671

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Threading Keyboard Interrupt issue

2019-05-29 Thread eryk sun
On 5/29/19, Dennis Lee Bieber  wrote:
>
>   In the OP's example code, with just one thread started, the easiest
> solution is to use
>
>   y.start()
>   y.join()
>
> to block the main thread. That will, at least, let the try/except catch the
> interrupt. It does not, however, kill the sub-thread.

join() can't be interrupted by Ctrl+C in Windows. To work around this,
we can join a thread with a short timeout in a loop. If we're managing
queued work items with a thread pool, note that Queue.join doesn't
support a timeout. In this case we need to poll empty() in a loop with
a short time.sleep(). Or we can let the main thread block and use
ctypes to install a console control handler that sets a flag that
tells child threads to exit. Windows calls the control handler in a
new thread.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue36373] Deprecate explicit loop parameter in all public asyncio APIs

2019-05-29 Thread Emmanuel Arias


Change by Emmanuel Arias :


--
keywords: +patch
pull_requests: +13559
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/13670

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: How to use ssh-agent in windows in python?

2019-05-29 Thread Fc Zwtyds

在 2019-05-30 6:41, Cameron Simpson 写道:

On 29May2019 22:37, Fc Zwtyds  wrote:

在 2019-05-27 11:19, Cameron Simpson 写道:
The output of "ssh-agent -s" is Bourne shell variable assignment 
syntax. You need to parse that [...]


 I want to rewrite the shell script to python script so I have had 
changed the "ssh-agent -s" to 'ssh-agent cmd' in python script for the 
consistence on windows.


I'm not sure you need to do that. In fact, I'm fairly sure you don't.


...
...
...
The you could just use os.system() to run the other commands, because 
the environment now has the necessary environment settings.


See how you go.

Cheers,
Cameron Simpson  (formerly c...@zip.com.au)


Thank you very very much and your time.
I need a time to learn what you write to me.
Thank you again.

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


[issue37093] http.client aborts header parsing upon encountering non-ASCII header names

2019-05-29 Thread Tim Burke

New submission from Tim Burke :

First, spin up a fairly trivial http server:

import wsgiref.simple_server

def app(environ, start_response):
start_response('200 OK', [
('Some-Canonical', 'headers'),
('sOme-CRAzY', 'hEaDERs'),
('Utf-8-Values', '\xe2\x9c\x94'),
('s\xc3\xb6me-UT\xc6\x92-8', 'in the header name'),
('some-other', 'random headers'),
])
return [b'Hello, world!\n']

if __name__ == '__main__':
httpd = wsgiref.simple_server.make_server('', 8000, app)
while True:
httpd.handle_request()

Note that this code works equally well on py2 or py3; the interesting bytes on 
the wire are the same on either.

Verify the expected response using an independent tool such as curl:

$ curl -v http://localhost:8000
*   Trying ::1...
* TCP_NODELAY set
* connect to ::1 port 8000 failed: Connection refused
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 8000 (#0)
> GET / HTTP/1.1
> Host: localhost:8000
> User-Agent: curl/7.64.0
> Accept: */*
> 
* HTTP 1.0, assume close after body
< HTTP/1.0 200 OK
< Date: Wed, 29 May 2019 23:02:37 GMT
< Server: WSGIServer/0.2 CPython/3.7.3
< Some-Canonical: headers
< sOme-CRAzY: hEaDERs
< Utf-8-Values: ✔
< söme-UTƒ-8: in the header name
< some-other: random headers
< Content-Length: 14
< 
Hello, world!
* Closing connection 0

Check that py2 includes all the same headers:

$ python2 -c 'import pprint, urllib; resp = 
urllib.urlopen("http://localhost:8000;); 
pprint.pprint((dict(resp.info().items()), resp.read()))'
({'content-length': '14',
  'date': 'Wed, 29 May 2019 23:03:02 GMT',
  'server': 'WSGIServer/0.2 CPython/3.7.3',
  'some-canonical': 'headers',
  'some-crazy': 'hEaDERs',
  'some-other': 'random headers',
  's\xc3\xb6me-ut\xc6\x92-8': 'in the header name',
  'utf-8-values': '\xe2\x9c\x94'},
 'Hello, world!\n')

But py3 *does not*:

$ python3 -c 'import pprint, urllib.request; resp = 
urllib.request.urlopen("http://localhost:8000;); 
pprint.pprint((dict(resp.info().items()), resp.read()))'
({'Date': 'Wed, 29 May 2019 23:04:09 GMT',
  'Server': 'WSGIServer/0.2 CPython/3.7.3',
  'Some-Canonical': 'headers',
  'Utf-8-Values': 'â\x9c\x94',
  'sOme-CRAzY': 'hEaDERs'},
 b'Hello, world!\n')

Instead, it is missing the first header that has a non-ASCII name as well as 
all subsequent headers (even if they are all-ASCII). Interestingly, the 
response body is intact.

This is eventually traced back to email.feedparser's expectation that all 
headers conform to rfc822 and its assumption that anything that *doesn't* 
conform must be part of the body: 
https://github.com/python/cpython/blob/v3.7.3/Lib/email/feedparser.py#L228-L236

However, http.client has *already* determined the boundary between headers and 
body in parse_headers, and sent everything that it thinks is headers to the 
parser: 
https://github.com/python/cpython/blob/v3.7.3/Lib/http/client.py#L193-L214

--
messages: 343942
nosy: tburke
priority: normal
severity: normal
status: open
title: http.client aborts header parsing upon encountering non-ASCII header 
names
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37092] LoggerAdapter doesn't have fatal() like Logger

2019-05-29 Thread Dave Johansen


New submission from Dave Johansen :

Using LoggerAdapter is a convenient way to add extra info to all logs, but it 
doesn't have the fatal() method like Logger, so it isn't a drop in replacement 
like it should be.

--
components: Library (Lib)
messages: 343941
nosy: Dave Johansen
priority: normal
severity: normal
status: open
title: LoggerAdapter doesn't have fatal() like Logger
type: behavior
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37088] Add a way to schedule a function to be called from the main thread

2019-05-29 Thread Yury Selivanov


Yury Selivanov  added the comment:

Eric, regarding signals no longer using pending calls -- interesting, I'll take 
a look. Thanks for pointing this out.

Sent from my iPhone

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37091] subprocess - uncaught PermissionError in send_signal can cause hang

2019-05-29 Thread hw


New submission from hw <13hu...@gmail.com>:

Python 3.7.3
Ubuntu 18.10 Cosmic

https://github.com/python/cpython/pull/13669

Encountered a condition where uncaught PermissionError caused a hang
running a subprocess command with sudo -u

Traceback (most recent call last):
  File "/usr/lib/python3.7/subprocess.py", line 474, in run
stdout, stderr = process.communicate(input, timeout=timeout)
  File "/usr/lib/python3.7/subprocess.py", line 939, in communicate
stdout, stderr = self._communicate(input, endtime, timeout)
  File "/usr/lib/python3.7/subprocess.py", line 1707, in _communicate
self.wait(timeout=self._remaining_time(endtime))
  File "/usr/lib/python3.7/subprocess.py", line 990, in wait
return self._wait(timeout=timeout)
  File "/usr/lib/python3.7/subprocess.py", line 1616, in _wait
raise TimeoutExpired(self.args, timeout)
subprocess.TimeoutExpired: Command '['sudo', '-u', 'chrome', 
'/snap/bin/chromium', '--headless', '--disable-gpu', '--hide-scrollbars', 
'--ignore-certificate-errors', '--enable-sandbox', '--incognito', 
'--mute-audio', '--disable-databases', 
'--enable-strict-powerful-feature-restrictions', '--no-pings', 
'--no-referrers', '--timeout=3', '--window-size=1280,1000', 
'--screenshot=[REDACTED]_screenshot.png', 'https://[REDACTED]']' timed out 
after 59.9998986274004 seconds

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.7/subprocess.py", line 476, in run
process.kill()
  File "/usr/lib/python3.7/subprocess.py", line 1756, in kill
self.send_signal(signal.SIGKILL)
  File "/usr/lib/python3.7/subprocess.py", line 1746, in send_signal
os.kill(self.pid, sig)
PermissionError: [Errno 1] Operation not permitted

--
components: Library (Lib)
messages: 343939
nosy: Hw
priority: normal
pull_requests: 13558
severity: normal
status: open
title: subprocess - uncaught PermissionError in send_signal can cause hang
type: behavior
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: How to use ssh-agent in windows in python?

2019-05-29 Thread Cameron Simpson

On 29May2019 22:37, Fc Zwtyds  wrote:

在 2019-05-27 11:19, Cameron Simpson 写道:
The output of "ssh-agent -s" is Bourne shell variable assignment 
syntax. You need to parse that [...]


 I want to rewrite the shell script to python script so I have had 
changed the "ssh-agent -s" to 'ssh-agent cmd' in python script for the 
consistence on windows.


I'm not sure you need to do that. In fact, I'm fairly sure you don't.

When you run "ssh-agent cmd" the agent starts as before, but instead of 
reporting its communication socket and process id it dispatches command 
and runs for the duration of that command, then exits.


Before ssh-agent dispatches "cmd" (here I mean a generic command, though 
that command might well be "cmd.exe"), it first puts the necessary 
environment variables into the command's environment.


There are two such values: the communication socket and the ssh-agent 
process id. The socket is so that the other ssh commands can talk to it, 
and the process id is so that it can be terminated when no longer 
wanted. For the "ssh-agent cmd" form there's no need to use the process 
id, since ssh-agent itself will exit after "cmd" finishes.


Let's look at what "ssh-agent -s" produces. This is on a UNIX system (my 
Mac):


 [~]fleet*> ssh-agent -s
 SSH_AUTH_SOCK=/Users/cameron/tmp/ssh-vuvXU6vrCAxz/agent.50746; export 
SSH_AUTH_SOCK;
 SSH_AGENT_PID=50754; export SSH_AGENT_PID;
 echo Agent pid 50754;

You can see the socket path and the process id there. The paths will be 
a bit different on Windows.


So if I do a process listing (this is a UNIX "ps" command, you will need 
to do the equivalent Windows thing) and search for that process id we 
see:


 [~]fleet*1> ps ax | grep 62928
 62928   ??  Ss 0:00.00 ssh-agent -s
 66204 s027  S+ 0:00.00 grep 62928

So there's the ssh-agent process and also the "grep" command itself 
because the process id is present on its command line.


Note that at this point my shell (cmd.exe equivalent in Windows) does 
not know about the new ssh-agent. This is because I haven't put those 
environment values into the shell environment: the output above is just 
written to the display. So when I go:


 [~]fleet*> ssh-add -l

it shows me 4 ssh keys. This is because I already have an agent which 
has some keys loaded. If my shell were talking to the new agent the list 
would be empty. Let's do that.


 [~]fleet*> SSH_AUTH_SOCK=/Users/cameron/tmp/ssh-vuvXU6vrCAxz/agent.50746
 [~]fleet*> SSH_AGENT_PID=50754
 [~]fleet*> export SSH_AUTH_SOCK SSH_AGENT_PID
 [~]fleet*> ssh-add -l
 The agent has no identities.

So now this shell is using the new agent. You see there's no magic here: 
other commands do not know about the agent until we tell then about it 
using these environment variables.


What I was suggesting is that you perform this process from Python, 
which I believe was your original plan.


So let's adapt the the comand you presented below, and also dig into why 
what you've tried hasn't worked. So, your subprocess call:


 import subprocess
 p = subprocess.Popen('cmd', stdin = subprocess.PIPE, stdout = subprocess.PIPE, 
stderr = subprocess.PIPE, shell = True, universal_newlines = True)
 outinfo, errinfo = p.communicate('ssh-agent cmd\n')
 print('outinfo is \n %s' % stdoutinfo)
 print('errinfo is \n %s' % stderrinfo)

This does the follow things:

1: Start a subprocess running "cmd". You get back a Popen object "p" for 
use with that process.


2: Run p.communicate("ssh-agent cmd\n"). This sends that to the input of 
the "cmd" subprocess and collects the output.


An important thing to know here is the .communicate is a complete 
interaction with the subprocess. The subprocess' _entire_ input is the 
string you've supplied, and the entire output of the subprocess until it 
completes is collected.


So, what's going on is this:

1: start "cmd"
2: send "ssh-agent cmd\n" to it.
3: collect output and wait for it to exit.

From "cmd"'s point of view:

1: Receive "ssh-agent cmd\n", causing it to run the "ssh-=agent cmd" 
command and then wait for it to exit.


2: ssh-agent starts and then runs another "cmd" and waits for _that_ to 
exit.


3: The second "cmd" processes its input, then exits. Note that becuase 
the input to the entire subprocess was "ssh-agent cmd\n", and the first 
"cmd" consumed that, there is no no more input data. So the second cmd 
exits immediately because there is no input.


4: The ssh-agent exist because the second "cmd" exited.

5: The first "cmd" sees the "ssh-agent cmd" command exit and looks for
another command to run from its input.

6: As before, there are no more input data. So the first "cmd" also 
exits.


And at that point .communicate sees the end of the output and returns 
it.


Because the subprocess is complete, your commented out "p.write" call 
fails. You can't do things that way with .communicate.


There are complicated (and error prone) ways to do more incremental 
input, not using .communicate. Let us not go there for now.



[issue37089] `import Lib.os` works on windows (but shouldn't)

2019-05-29 Thread Anthony Sottile


Anthony Sottile  added the comment:

If I'm reading this correctly this is the relevant line for python3:

https://github.com/python/cpython/blob/29cb21ddb92413931e473eb799a02e2d8cdf4a45/PC/getpathp.c#L1068

it was added in 4d0d471a8031de90a2b1ce99c4ac4780e60b3bc9

python2 seems to do the same as well and I'm having a harder time tracing that 
code -- my guess is it comes from here: 
https://github.com/python/cpython/blob/103b8d9f9179089019ddb363ec0098b63816001b/PC/getpathp.c#L550

(so in that case, only present because `python.exe` is at the root of the 
prefix) -- but it's still showing up in the `virtualenv` case due to site 
manipulation (coming from `virtualenv`'s `site.py` I believe? trying to mimic 
that behaviour)

Hmmm not much information there but I have to get back to what I was doing 
before -- I'll see if I can't find more info on this later!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37088] Add a way to schedule a function to be called from the main thread

2019-05-29 Thread STINNER Victor


STINNER Victor  added the comment:

I dislike pending calls. It is a weird beast which complicates ceval.c. I
would prefer to remove it. It is no longer needed to handle signals!

At least, it sounds like a bad idea to me to expose it in Python in a
public API.

If you really need it, hide it better ;-)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36974] Implement PEP 590

2019-05-29 Thread Petr Viktorin


Petr Viktorin  added the comment:

All stable buildbots are back to green.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37088] Add a way to schedule a function to be called from the main thread

2019-05-29 Thread Eric Snow


Eric Snow  added the comment:

If this is about signals, it isn't enough just to run on the main thread.  It 
also has to be the main interpreter.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36974] Implement PEP 590

2019-05-29 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Great! Thank you very much for the quick fix for the problem.

For AMD64 Ubuntu Shared 3.x, the last build was successful:

https://buildbot.python.org/all/#/builders/141/builds/1870/steps/5/logs/stdio

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37088] Add a way to schedule a function to be called from the main thread

2019-05-29 Thread Eric Snow


Eric Snow  added the comment:

> Well, it's absolutely the same mechanism that signal handlers use.

Antoine changed signals a while back so they no longer use the pending calls 
machinery.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36974] Implement PEP 590

2019-05-29 Thread Petr Viktorin


Petr Viktorin  added the comment:

No, just https://github.com/python/cpython/pull/13665 is addressing the  
failures. And it seems that it's successful -- only the slowest of the failed 
ones (AMD64 Ubuntu Shared 3.x) is still red.

bpo-37090 extends the test so it can catch more bugs in the future (but there's 
no rush to get it in...)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37088] Add a way to schedule a function to be called from the main thread

2019-05-29 Thread Yury Selivanov


Yury Selivanov  added the comment:

> As to exposing Py_AddPendingCall() as sys.addpendingcall, that might be 
> opening a can of worms.  Injecting code into the eval loop at some arbitrary 
> ("soon") future time requires care and the code isn't well exercised 
> historically (much like subinterpreters).

Well, it's absolutely the same mechanism that signal handlers use.  It looks 
like this can of works has been open for a pretty long time now :)

The whole point of adding this API is to make it possible for asyncio to work 
with the "signals" module not from the main thread.  I expect 99.9% of other 
use cases to be either about signals or other super low-level stuff that needs 
the main thread (off the top of my head I can't name any :))

> It also adds burden on other Python implementations.

Python signal processing *requires* users callbacks to be executed in the main 
thread (whereas Unix can deliver the signal to any thread, potentially). 
Therefore I think that any alternative Python implementation should have a 
mechanism to schedule code execution in the main thread.

> My point is, let's think this through before adding sys.addpendingcall(). :)  
> Is there another way this could be done that doesn't open a can of worms?

Maybe. One of such ways is to enable signal.signal calls from non-main threads. 
 But I'm not sure this is possible for all platforms we support. Maybe Victor 
or Andrew can shed more light on this.

> Also, at the very least it should probably be a "private" function (i.e 
> sys._addpendingcall).

Maybe.  The problem is that asyncio must work the same on PyPy, which means 
that the sys API it uses should be available on PyPy too.  In which case, they 
will kind of have to add it, which means that there's no point in making it 
semi-private.  OTOH, I wouldn't mind sys._addpendingcall(), as long as PyPy 
implements it.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37007] Implement socket.if_{nametoindex, indextoname} for Windows

2019-05-29 Thread Steve Dower


Change by Steve Dower :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36974] Implement PEP 590

2019-05-29 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

@Petr is https://bugs.python.org/issue37090 and 
https://github.com/python/cpython/pull/13668 also addressing the buildbot 
failures?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37089] `import Lib.os` works on windows (but shouldn't)

2019-05-29 Thread Steve Dower


Steve Dower  added the comment:

Honestly, no idea. Because it always has been :)

If you can find when it was added, we may be able to answer that.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36974] Implement PEP 590

2019-05-29 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

BUILDBOT FAILURE REPORT
===

Builder name: AMD64 Ubuntu Shared 3.x
Builder url: https://buildbot.python.org/all/#/builders/141/
Build url: https://buildbot.python.org/all/#/builders/141/builds/1866

Failed tests


- test_pycfunction (test.test_gdb.PyBtTests)


Test leaking resources
--



Build summary
-

== Tests result: FAILURE then FAILURE ==

405 tests OK.

10 slowest tests:
- test_multiprocessing_spawn: 6 min 27 sec
- test_tools: 5 min 34 sec
- test_concurrent_futures: 5 min 13 sec
- test_tokenize: 4 min 43 sec
- test_lib2to3: 3 min 58 sec
- test_gdb: 3 min 16 sec
- test_multiprocessing_forkserver: 2 min 25 sec
- test_asyncio: 2 min 5 sec
- test_multiprocessing_fork: 1 min 40 sec
- test_capi: 1 min 36 sec

1 test failed:
test_gdb

17 tests skipped:
test_devpoll test_idle test_ioctl test_kqueue test_msilib
test_ossaudiodev test_startfile test_tcl test_tix test_tk
test_ttk_guionly test_ttk_textonly test_turtle test_winconsoleio
test_winreg test_winsound test_zipfile64

1 re-run test:
test_gdb

Total duration: 42 min 45 sec


Tracebacks
--

```traceback
Traceback (most recent call last):
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_gdb.py", 
line 890, in test_pycfunction
self.assertIn('#2 , args=(1,)) at 
./Modules/timemodule.c:446\n446\t{\n#6 Frame 0x77f11a50, for file , 
line 3, in foo ()\n#12 Frame 0x557be620, for file , line 5, in bar 
()\n#18 Frame 0x557be3f0, for file , line 6, in  ()\n'


Traceback (most recent call last):
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_gdb.py", 
line 890, in test_pycfunction
self.assertIn('#2 , args=(1,)) at 
./Modules/timemodule.c:446\n446\t{\n#6 Frame 0x77f11a50, for file , 
line 3, in foo ()\n#12 Frame 0x557be590, for file , line 5, in bar 
()\n#18 Frame 0x557be360, for file , line 6, in  ()\n'

```

Current builder status
--

The builder is failing currently

Commits
---

- 0c2f9305640f7655ba0cd5f478948b2763b376b3

- aacc77fbd77640a8f03638216fa09372cc21673d


Other builds with similar failures
--

-  https://buildbot.python.org/all/#/builders/21/builds/3076
-  https://buildbot.python.org/all/#/builders/21/builds/3077
-  https://buildbot.python.org/all/#/builders/21/builds/3078
-  https://buildbot.python.org/all/#/builders/21/builds/3079
-  https://buildbot.python.org/all/#/builders/21/builds/3080
-  https://buildbot.python.org/all/#/builders/13/builds/3087
-  https://buildbot.python.org/all/#/builders/13/builds/3088
-  https://buildbot.python.org/all/#/builders/13/builds/3089
-  https://buildbot.python.org/all/#/builders/13/builds/3090
-  https://buildbot.python.org/all/#/builders/85/builds/2883
-  https://buildbot.python.org/all/#/builders/85/builds/2884
-  https://buildbot.python.org/all/#/builders/85/builds/2885
-  https://buildbot.python.org/all/#/builders/85/builds/2886
-  https://buildbot.python.org/all/#/builders/141/builds/1869
-  https://buildbot.python.org/all/#/builders/176/builds/590
-  https://buildbot.python.org/all/#/builders/176/builds/591
-  https://buildbot.python.org/all/#/builders/176/builds/592
-  https://buildbot.python.org/all/#/builders/176/builds/593
-  https://buildbot.python.org/all/#/builders/176/builds/594
-  https://buildbot.python.org/all/#/builders/16/builds/3055
-  https://buildbot.python.org/all/#/builders/16/builds/3056
-  https://buildbot.python.org/all/#/builders/16/builds/3057
-  https://buildbot.python.org/all/#/builders/16/builds/3058
-  https://buildbot.python.org/all/#/builders/16/builds/3059

Common commits for all builds:

- aacc77fbd77640a8f03638216fa09372cc21673d

--
nosy: +pablogsal

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37090] test_gdb's test_pycfunction should test all calling conventions

2019-05-29 Thread Petr Viktorin


Change by Petr Viktorin :


--
keywords: +patch
pull_requests: +13557
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/13668

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37090] test_gdb's test_pycfunction should test all calling conventions

2019-05-29 Thread Petr Viktorin


New submission from Petr Viktorin :

test_gdb.StackNavigationTests.test_pycfunction checks that the GDB integration 
can pick up calls to C-API functions. Currently it includes the comment:

> Tested function must not be defined with METH_NOARGS or METH_O,
> otherwise call_function() doesn't call PyCFunction_Call()

This is (now?) false; furthermore it looks like all builtin_function_or_method 
are discoverable.

As the code paths for various METH_* conventions are diverging due to 
optimizations, we should check they continue to be covered.

--
assignee: petr.viktorin
messages: 343927
nosy: petr.viktorin
priority: normal
severity: normal
status: open
title: test_gdb's test_pycfunction should test all calling conventions
versions: Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14656] Add a macro for unreachable code

2019-05-29 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37089] `import Lib.os` works on windows (but shouldn't)

2019-05-29 Thread Anthony Sottile


Anthony Sottile  added the comment:

sys.prefix isn't on sys.path on other platforms -- why is it on windows?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37007] Implement socket.if_{nametoindex, indextoname} for Windows

2019-05-29 Thread Steve Dower


Steve Dower  added the comment:


New changeset 8f96c9f8ed2a4795e34b333411451e24f28f74d2 by Steve Dower (Zackery 
Spytz) in branch 'master':
bpo-37007: Implement socket.if_nametoindex(), if_indextoname() and 
if_nameindex() on Windows (GH-13522)
https://github.com/python/cpython/commit/8f96c9f8ed2a4795e34b333411451e24f28f74d2


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37089] `import Lib.os` works on windows (but shouldn't)

2019-05-29 Thread Steve Dower


Steve Dower  added the comment:

I don't think we can change the assumption that sys.prefix is in sys.path at 
this point, though technically it's not required (certainly not in 3.7).

Maybe we could create a new marker file that means "never treat this directory 
as a namespace package"?

--
versions: +Python 3.9 -Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37089] `import Lib.os` works on windows (but shouldn't)

2019-05-29 Thread Anthony Sottile


New submission from Anthony Sottile :

Additionally, virtualenvs have the root of their directory on `sys.path` -- 
this is unlike posix behaviour

For example:

$ python
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD6
4)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import Lib.os
>>> Lib.os.__file__
'C:\\Python37\\Lib\\os.py'
>>> Lib.os.listdir('C:\\')
['$Recycle.Bin', 'BGinfo', 'Documents and Settings', 'pagefile.sys', 'PerfLogs',
 'Program Files', 'Program Files (x86)', 'ProgramData', 'Python27', 'Python37',
'Recovery', 'swapfile.sys', 'System Volume Information', 'Users', 'Windows']

--
components: Library (Lib), Windows
messages: 343923
nosy: Anthony Sottile, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: `import Lib.os` works on windows (but shouldn't)
versions: Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36974] Implement PEP 590

2019-05-29 Thread Petr Viktorin


Petr Viktorin  added the comment:


New changeset fecb75c1bb46c818e6579ba422cfa5d0d9d104d1 by Petr Viktorin in 
branch 'master':
bpo-36974: Fix GDB integration (GH-13665)
https://github.com/python/cpython/commit/fecb75c1bb46c818e6579ba422cfa5d0d9d104d1


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26836] Add memfd_create to os module

2019-05-29 Thread miss-islington


miss-islington  added the comment:


New changeset e70bfa95e6f0c98b9906f306f24d71f8b7689f87 by Miss Islington (bot) 
(Zackery Spytz) in branch 'master':
bpo-26836: Add ifdefs for all MFD_HUGE* constants (GH-13666)
https://github.com/python/cpython/commit/e70bfa95e6f0c98b9906f306f24d71f8b7689f87


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37088] Add a way to schedule a function to be called from the main thread

2019-05-29 Thread Eric Snow


Eric Snow  added the comment:

Note that I'm working on making pending calls per-interpreter (see issue #33608 
and https://github.com/python/cpython/pull/12360 (since reverted)).

As to exposing Py_AddPendingCall() as sys.addpendingcall, that might be opening 
a can of worms.  Injecting code into the eval loop at some arbitrary ("soon") 
future time requires care and the code isn't well exercised historically (much 
like subinterpreters).  By making it easier to use the pending calls API (e.g. 
from Python code) we may be introducing an attractive nuisance.  It also adds 
burden on other Python implementations.

My point is, let's think this through before adding sys.addpendingcall(). :)  
Is there another way this could be done that doesn't open a can of worms?

Also, at the very least it should probably be a "private" function (i.e 
sys._addpendingcall).

--
nosy: +eric.snow

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26836] Add memfd_create to os module

2019-05-29 Thread Zackery Spytz


Change by Zackery Spytz :


--
pull_requests: +13556
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/13666

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32388] Remove cross-version binary compatibility

2019-05-29 Thread Antoine Pitrou


Antoine Pitrou  added the comment:


New changeset ada319bb6d0ebcc68d3e0ef2b4279ea061877ac8 by Antoine Pitrou in 
branch 'master':
bpo-32388: Remove cross-version binary compatibility requirement in tp_flags 
(GH-4944)
https://github.com/python/cpython/commit/ada319bb6d0ebcc68d3e0ef2b4279ea061877ac8


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32388] Remove cross-version binary compatibility

2019-05-29 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

PR is merged now!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26836] Add memfd_create to os module

2019-05-29 Thread Christian Heimes


Christian Heimes  added the comment:

https://buildbot.python.org/all/#builders/99/builds/2738 is failing because 
some HUGE TLB constants are not defined on Gentoo.

--
stage: patch review -> needs patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26836] Add memfd_create to os module

2019-05-29 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 43fdbd2729cb7cdbb5afb5d16352f6604859e564 by Christian Heimes 
(Zackery Spytz) in branch 'master':
bpo-26836: Add os.memfd_create() (#13567)
https://github.com/python/cpython/commit/43fdbd2729cb7cdbb5afb5d16352f6604859e564


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22117] Rewrite pytime.h to work on nanoseconds

2019-05-29 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

Petr claims to have a fix, https://github.com/python/cpython/pull/13665

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22117] Rewrite pytime.h to work on nanoseconds

2019-05-29 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

Can somebody here explain the meaning of the comment in test_gdb.py

# Tested function must not be defined with METH_NOARGS or METH_O,
# otherwise call_function() doesn't call PyCFunction_Call()

This test is breaking with PEP 590, see 
https://github.com/python/cpython/pull/13185

--
nosy: +jdemeyer

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37007] Implement socket.if_{nametoindex, indextoname} for Windows

2019-05-29 Thread Zackery Spytz


Zackery Spytz  added the comment:

Thanks, Steve. I've addressed your comments on the PR.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36974] Implement PEP 590

2019-05-29 Thread Petr Viktorin


Change by Petr Viktorin :


--
pull_requests: +13555
pull_request: https://github.com/python/cpython/pull/13665

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36983] typing.__all__ has drifted from actual contents

2019-05-29 Thread Anthony Sottile


Change by Anthony Sottile :


--
pull_requests: +13554
pull_request: https://github.com/python/cpython/pull/13663

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36983] typing.__all__ has drifted from actual contents

2019-05-29 Thread Anthony Sottile


Change by Anthony Sottile :


--
pull_requests: +13553
pull_request: https://github.com/python/cpython/pull/13662

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37015] Fix asyncio mock warnings

2019-05-29 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
keywords: +patch
pull_requests: +13552
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/13661

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36624] cleanup the stdlib and tests with regard to sys.platform usage

2019-05-29 Thread Michael Felt


Michael Felt  added the comment:

On 29/05/2019 16:36, Ned Deily wrote:
> Ned Deily  added the comment:
>
> FWIW, my opinion on making this kind of wholesale change has not changed: see 
> the discussion in PR 7800. 

I had actually read through that before I started on this. Your closing
comments are here:
https://github.com/python/cpython/pull/7800#issuecomment-400182213

As someone who does not work 100% of the time with python - it is
extremely confusing and frustrating because there is no clear way of
doing something. From afar it appears as if platform.system() and
sys.platform evolved at different moments. I saw them as equivalent, and
only learned much later than one is build and the other is run-time.
And, there are very specific strings - that no longer match the current
situation.

Why, I ask myself, is it sometimes "darwin" (or is it "Darwin" - oh yes,
different test). And, I also ask myself - why did sys.platform "win"?
People did not like a function call (e.g., more resource intensive?) -
or was sys.platform "first" and platform.system() just never caught on?

I (think I) understand your concerns. While I would consider going
through the code to bring them in-line - that may be, for many reasons -
going too far.

I had hoped to: a) improve consistency and set a good example; as well
as b) be more than 'two constants' and in so-doing, provide a basis for
a grounded discussion.

As we stand now I still have a concern/question - is there any
willingness to work towards a solution - that can be (a basis of) a
clear definition of what "should" be. In a word - I consider the current
situation 'confusing'.

What is presented here does not have to be the solution. I hope everyone
will remember that this concern continues to popup. Saying no over and
over again does not solve anything - will not make it go away. Saying
no, repeatedly, may silence people.

All I can offer is my willingness to help.

Thank you for your time spent reading!

>  I think the changes made there were not an improvement for all the reasons 
> stated, primarily because this now requires people reading the code base to 
> learn *two* different ways of doing the same thing since these changes only 
> affect the tests and not the platform-conditional code in the standard 
> library modules themselves (which are not and should not be changed). Also, 
> this means that backports of fixes from 3.8 will be complicated.  Note there 
> ware already some "translation" errors detected and fixed in the PR re-spin; 
> how many others remain?
>
> --
> nosy: +ned.deily
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36983] typing.__all__ has drifted from actual contents

2019-05-29 Thread Anthony Sottile


Anthony Sottile  added the comment:

yep, happy to do that -- I know I'll need to do 3.7, but should I also do 3.6? 
3.5?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22385] Define a binary output formatting mini-language for *.hex()

2019-05-29 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset 0c2f9305640f7655ba0cd5f478948b2763b376b3 by Gregory P. Smith in 
branch 'master':
bpo-22385: Support output separators in hex methods. (#13578)
https://github.com/python/cpython/commit/0c2f9305640f7655ba0cd5f478948b2763b376b3


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37086] time.sleep error message misleading

2019-05-29 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

While not exactly the same, issue35707 is also about time.sleep and floats.

--
nosy: +cheryl.sabella

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36974] Implement PEP 590

2019-05-29 Thread Petr Viktorin


New submission from Petr Viktorin :


New changeset aacc77fbd77640a8f03638216fa09372cc21673d by Petr Viktorin (Jeroen 
Demeyer) in branch 'master':
bpo-36974: implement PEP 590 (GH-13185)
https://github.com/python/cpython/commit/aacc77fbd77640a8f03638216fa09372cc21673d


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36794] asyncio.Lock documentation in Py3.8 lacks parts presented in documentation in Py3.6

2019-05-29 Thread miss-islington


miss-islington  added the comment:


New changeset 4e1e887203ef069bf293ecabd945f7567d6a4879 by Miss Islington (bot) 
in branch '3.7':
bpo-36794: Document that Lock.acquire is fair. (GH-13082)
https://github.com/python/cpython/commit/4e1e887203ef069bf293ecabd945f7567d6a4879


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36983] typing.__all__ has drifted from actual contents

2019-05-29 Thread Guido van Rossum


Guido van Rossum  added the comment:

It looks like the backports need to be done manually. Hopefully you'll feel up 
to that, otherwise we can close without doing the backports.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36983] typing.__all__ has drifted from actual contents

2019-05-29 Thread miss-islington


miss-islington  added the comment:


New changeset d30da5dd9a8a965cf24a22bbaff8a5b1341c2944 by Miss Islington (bot) 
(Anthony Sottile) in branch 'master':
bpo-36983: Fix typing.__all__ and add test for exported names (GH-13456)
https://github.com/python/cpython/commit/d30da5dd9a8a965cf24a22bbaff8a5b1341c2944


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Threading Keyboard Interrupt issue

2019-05-29 Thread eryk sun
On 5/29/19, David Raymond  wrote:
>
> Keyboard interrupts are only received by the main thread, which in this case
> completes real quick.
>
> So what happens for me is that the main thread runs to completion instantly
> and leaves nothing alive to receive the keyboard interrupt, which means the
> loop thread will run forever until killed externally. (Task manager,
> ctrl-break, etc)

The main thread is still running in order to join non-daemon threads.
In Windows, the internal wait used to join a thread can't be
interrupted by Ctrl+C, unlike POSIX platforms.
The Windows build could be modified to support Ctrl+C in this case,
but I'm only certain about the current build that uses emulated
condition variables.

When I run the OP's script in Linux, acquiring the internal
thread-state lock (which normally waits until the lock is reset when
the thread exits) gets interrupted by the SIGINT signal, and
KeyboardInterrupt is raised:

Exception ignored in: 
Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 1294, in _shutdown
t.join()
  File "/usr/lib/python3.6/threading.py", line 1056, in join
self._wait_for_tstate_lock()
  File "/usr/lib/python3.6/threading.py", line 1072, in
_wait_for_tstate_lock
elif lock.acquire(block, timeout):
KeyboardInterrupt
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue37086] time.sleep error message misleading

2019-05-29 Thread Eric V. Smith


Eric V. Smith  added the comment:

I think it's reasonable to change the TypeError to say integer or float. That's 
what _PyTime_FromObject is looking for.

--
nosy: +eric.smith

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36889] Merge StreamWriter and StreamReader into just asyncio.Stream

2019-05-29 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Wow!
Thanks for the report.
Internally it is pretty close to freebsd problem.
The test is unstable, not asyncio code itself.
The test uses future objects to synchronize client and server socket processing 
but looks like there are race conditions still.

Please let me work on it.
If the problem is very annoying I can temporarily disable these problematic 
tests while working on their improvements

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36889] Merge StreamWriter and StreamReader into just asyncio.Stream

2019-05-29 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

test_stream_shutdown_hung_task_prevents_cancellation was added as part of this 
issue. Seems to be a random error : 
https://ci.appveyor.com/project/python/cpython/builds/24901585

==
ERROR: test_stream_shutdown_hung_task_prevents_cancellation 
(test.test_asyncio.test_streams.StreamTests)
--
Traceback (most recent call last):
  File "C:\projects\cpython\lib\asyncio\windows_events.py", line 453, in 
finish_recv
return ov.getresult()
OSError: [WinError 64] The specified network name is no longer available
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "C:\projects\cpython\lib\test\test_asyncio\test_streams.py", line 1605, 
in test_stream_shutdown_hung_task_prevents_cancellation
self.loop.run_until_complete(test())
  File "C:\projects\cpython\lib\asyncio\base_events.py", line 608, in 
run_until_complete
return future.result()
  File "C:\projects\cpython\lib\test\test_asyncio\test_streams.py", line 1601, 
in test
await task
  File "C:\projects\cpython\lib\test\test_asyncio\test_streams.py", line 1586, 
in client
self.assertEqual(b'', await stream.readline())
  File "C:\projects\cpython\lib\asyncio\streams.py", line 1545, in readline
line = await self.readuntil(sep)
  File "C:\projects\cpython\lib\asyncio\streams.py", line 1638, in readuntil
await self._wait_for_data('readuntil')
  File "C:\projects\cpython\lib\asyncio\streams.py", line 1521, in 
_wait_for_data
await self._waiter
  File "C:\projects\cpython\lib\asyncio\proactor_events.py", line 279, in 
_loop_reading
data = fut.result()
  File "C:\projects\cpython\lib\asyncio\windows_events.py", line 808, in _poll
value = callback(transferred, key, ov)
  File "C:\projects\cpython\lib\asyncio\windows_events.py", line 457, in 
finish_recv
raise ConnectionResetError(*exc.args)
ConnectionResetError: [WinError 64] The specified network name is no longer 
available
--

--
nosy: +xtreak

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36794] asyncio.Lock documentation in Py3.8 lacks parts presented in documentation in Py3.6

2019-05-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13551
pull_request: https://github.com/python/cpython/pull/13659

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36794] asyncio.Lock documentation in Py3.8 lacks parts presented in documentation in Py3.6

2019-05-29 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22454] Adding the opposite function of shlex.split()

2019-05-29 Thread Berker Peksag


Change by Berker Peksag :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36794] asyncio.Lock documentation in Py3.8 lacks parts presented in documentation in Py3.6

2019-05-29 Thread miss-islington

miss-islington  added the comment:


New changeset 34f4f5efea730504216ee19f237734e0bb0104ee by Miss Islington (bot) 
(Hrvoje Nikšić) in branch 'master':
bpo-36794: Document that Lock.acquire is fair. (GH-13082)
https://github.com/python/cpython/commit/34f4f5efea730504216ee19f237734e0bb0104ee


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37007] Implement socket.if_{nametoindex, indextoname} for Windows

2019-05-29 Thread Steve Dower


Steve Dower  added the comment:

Great, thanks Zackery! (And thanks for the ping - I don't notice GitHub 
notifications.)

Had a few comments about error handling, but it looks great.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33071] Document that PyPI no longer requires 'register'

2019-05-29 Thread miss-islington


miss-islington  added the comment:


New changeset 103b8d9f9179089019ddb363ec0098b63816001b by Miss Islington (bot) 
(Hai Shi) in branch '2.7':
[2.7] bpo-33071: remove outdated PyPI docs (GH-13087) (GH-13584)
https://github.com/python/cpython/commit/103b8d9f9179089019ddb363ec0098b63816001b


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33725] Python crashes on macOS after fork with no exec

2019-05-29 Thread Barry A. Warsaw


Barry A. Warsaw  added the comment:

On May 28, 2019, at 17:38, Ned Deily  wrote:
> 
> Ned Deily  added the comment:
> 
>> To be clear, what is unsafe on macOS (as of 10.13, but even more so on 
>> 10.14) is calling into the Objective-C runtime between fork and exec.
> 
> No, it has *always* been unsafe. What's new as of 10.13/14 is that macOS 
> tries much harder at runtime to detect such cases and more predictably cause 
> an error rather than letter than let the process run on and possibly fail 
> nondeterministically.

Right, thanks for the additional nuance.  I think what changed is that in 
10.13, Apple added a warning output when this condition occurred, and in 10.14 
they actually abort the subprocess.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37007] Implement socket.if_{nametoindex, indextoname} for Windows

2019-05-29 Thread Eryk Sun


Change by Eryk Sun :


--
nosy:  -eryksun

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37088] Add a way to schedule a function to be called from the main thread

2019-05-29 Thread Yury Selivanov


New submission from Yury Selivanov :

When asyncio event loop is created in a non-main thread, it needs to initialize 
a so called ChildWatcher for it (a helper object to intercept subprocesses 
exits).  Doing that requires to run code in the main thread.

I propose to add a 'sys.addpendingcall' function that will simply expose the 
already existing Py_AddPendingCall to the pure Python land.

--
components: Interpreter Core, asyncio
messages: 343897
nosy: asvetlov, vstinner, yselivanov
priority: normal
severity: normal
status: open
title: Add a way to schedule a function to be called from the main thread
versions: Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37088] Add a way to schedule a function to be called from the main thread

2019-05-29 Thread Yury Selivanov


Change by Yury Selivanov :


--
keywords: +patch
pull_requests: +13550
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/13656

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37087] Adding native id support for openbsd

2019-05-29 Thread David Carlier


New submission from David Carlier :

Following up on bpo-36084

--
messages: 343896
nosy: David Carlier
priority: normal
pull_requests: 13549
severity: normal
status: open
title: Adding native id support for openbsd
versions: Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36084] Threading: add builtin TID attribute to Thread objects

2019-05-29 Thread David Carlier


Change by David Carlier :


--
pull_requests: +13548
pull_request: https://github.com/python/cpython/pull/13654

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33725] Python crashes on macOS after fork with no exec

2019-05-29 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

On May 28, 2019, at 17:21, STINNER Victor  wrote:
> 
> 
> STINNER Victor  added the comment:
> 
>> To be clear, what is unsafe on macOS (as of 10.13, but even more so on 
>> 10.14) is calling into the Objective-C runtime between fork and exec.  The 
>> problem for Python is that it’s way too easy to do that implicitly, thus 
>> causing the macOS to abort the subprocess in surprising ways.
> 
> Do only a few Python module use the Objective-C runtime? Or is it basically 
> "everything"?
> 
> If it's just a few, would it be possible to emit a warning or even an 
> exception if called in a child process after fork?

I think it’s hard to know, but I found it through a path that lead from 
requests to _scproxy.c.  Here’s everything I know about the subject:

https://wefearchange.org/2018/11/forkmacos.rst.html

So yes, it’s theoretically possible to do *some* between fork and exec and not 
crash, and it’s of course perfectly safe to call exec pretty much right after 
fork.  It’s just hard to know for sure, and there are surprising ways to get 
into the Objective-C runtime.

I think we won’t be able to work around all of Apple’s choices here.  
Documentation is the best way to handle it in <=3.7, and changing the default 
makes sense to me for 3.8.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



RE: Threading Keyboard Interrupt issue

2019-05-29 Thread David Raymond
That's a little weird, and my running it works slightly differently. Please 
paste exactly what you're running (no time import and true being lowercase for 
example means we couldn't copy and paste it and have it immediately run)

In your script, the main thread hits y.start() which completes successfully as 
soon as the new thread gets going, so it exits the try/except block as a 
success. Then since there's no more code, the main thread completes.

The loop thread you started inherits the daemon-ness of the thread that called 
it, so by default it's started as a regular thread, and not a daemon thread. As 
a regular thread it will keep going even when the main thread completes.

Keyboard interrupts are only received by the main thread, which in this case 
completes real quick.

So what happens for me is that the main thread runs to completion instantly and 
leaves nothing alive to receive the keyboard interrupt, which means the loop 
thread will run forever until killed externally. (Task manager, ctrl-break, etc)

In this case, even if the main thread _was_ still alive to catch the keyboard 
interrupt, that exception does not get automatically passed to all threads, 
only the main one. So the main thread would have to catch the exception, then 
use one of the available signaling mechanisms to let the other threads know, 
and each of those other threads would have to consciously check for your signal 
of choice to see if the main thread wanted them to shut down.

Or, the other threads would have to be declared as demonic before they were 
started, in which case they would be killed automatically once all non-daemonic 
threads had ended.


-Original Message-
From: Python-list 
[mailto:python-list-bounces+david.raymond=tomtom@python.org] On Behalf Of 
nihar Modi
Sent: Wednesday, May 29, 2019 4:39 AM
To: python-list@python.org
Subject: Threading Keyboard Interrupt issue

I have written a simple code that involves threading, but it does not go to
except clause after Keyboard interrupt. Can you suggest a way out. I have
pasted the code below. It does not print 'hi' after keyboard interrupt and
just stops.

import threading

def loop():
 while true:
  print('hello')
  time.sleep(5)

if __name__ == '__main__':
 try:
  y = threading.Thread(target = loop, args = ())
  y.start()
 except KeyboardInterrupt:
  print('hi')

The program does not print hi and terminates immediately after ctrl+c
-- 
https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue37086] time.sleep error message misleading

2019-05-29 Thread Michele Angrisano


Michele Angrisano  added the comment:

The doc (3.7) says that the argument "may be a floating point number to 
indicate a more precise sleep time."
I think that TypeError message is right because you can choose how much 
precision you need but it's optional.
What do you think about that?

--
nosy: +mangrisano

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Trouble Downloading Python and Numpy

2019-05-29 Thread Shakti Kumar
On Wed, 29 May 2019 at 9:38 PM Shakti Kumar 
wrote:

>
>
> On Wed, 29 May 2019 at 9:29 PM Contreras, Brian J 
> wrote:
>
>> Good Morning,
>>
>> I am a research student at the Georgia Institute of Technology. I have
>> made multiple attempts to download different versions of Python with Numpy
>> on my Microsoft Surface Book with no success.
>>
>
> Since you need numpy and as a grad student too, I'll strongly suggest you
> to look for "installing anaconda on Windows". It's GUI based installation
> would be a good start especially for people who are struggling with python
> installations on windows.
>

Forgot to mention this,
Anaconda comes prepackaged with numpy, pandas, scripy and other data
analysis libs. So you won't need to pip/conda install them separately


>
>> (Clipped for brevity)
>
>
>> --
>> https://mail.python.org/mailman/listinfo/python-list
>>
> --
> Sent from Shakti’s iPhone
>
-- 
Sent from Shakti’s iPhone
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Trouble Downloading Python and Numpy

2019-05-29 Thread Shakti Kumar
On Wed, 29 May 2019 at 9:29 PM Contreras, Brian J 
wrote:

> Good Morning,
>
> I am a research student at the Georgia Institute of Technology. I have
> made multiple attempts to download different versions of Python with Numpy
> on my Microsoft Surface Book with no success.
>

Since you need numpy and as a grad student too, I'll strongly suggest you
to look for "installing anaconda on Windows". It's GUI based installation
would be a good start especially for people who are struggling with python
installations on windows.


> (Clipped for brevity)
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
Sent from Shakti’s iPhone
-- 
https://mail.python.org/mailman/listinfo/python-list


Trouble Downloading Python and Numpy

2019-05-29 Thread Contreras, Brian J
Good Morning,

I am a research student at the Georgia Institute of Technology. I have made 
multiple attempts to download different versions of Python with Numpy on my 
Microsoft Surface Book with no success.

I ensured that I have space for the program and the latest windows 10 update, I 
still am unable to open any python files or write code within the program. I 
was told by a colleague that I may need a python path environmental variable, 
but I have not found asite that provides this.

If I could get some support with the download I would greatly appreciate it.

Warm Regards,

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


Re: Threading Keyboard Interrupt issue

2019-05-29 Thread Chris Angelico
On Thu, May 30, 2019 at 1:45 AM nihar Modi  wrote:
>
> I have written a simple code that involves threading, but it does not go to
> except clause after Keyboard interrupt. Can you suggest a way out. I have
> pasted the code below. It does not print 'hi' after keyboard interrupt and
> just stops.

Threads allow multiple things to run at once. The entire *point* of
spinning off a new thread is that the main code keeps going even while
the thread runs. They are independent.

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


[issue14656] Add a macro for unreachable code

2019-05-29 Thread Zackery Spytz


Zackery Spytz  added the comment:

The Py_UNREACHABLE() macro was implemented in bpo-31338, so this issue can be 
closed.

--
nosy: +ZackerySpytz

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Threading Keyboard Interrupt issue

2019-05-29 Thread nihar Modi
I have written a simple code that involves threading, but it does not go to
except clause after Keyboard interrupt. Can you suggest a way out. I have
pasted the code below. It does not print 'hi' after keyboard interrupt and
just stops.

import threading

def loop():
 while true:
  print('hello')
  time.sleep(5)

if __name__ == '__main__':
 try:
  y = threading.Thread(target = loop, args = ())
  y.start()
 except KeyboardInterrupt:
  print('hi')

The program does not print hi and terminates immediately after ctrl+c
-- 
https://mail.python.org/mailman/listinfo/python-list


Re:

2019-05-29 Thread Bo YU
On Wed, May 29, 2019 at 1:19 PM Sri Tharun  wrote:

> Why I am unable to install packages
>
If you really want to get help from the list,please give us more info.

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


[issue37007] Implement socket.if_{nametoindex, indextoname} for Windows

2019-05-29 Thread Zackery Spytz


Zackery Spytz  added the comment:

Well, it turns out that implementing if_nameindex() on Windows using 
GetIfTable2Ex() was also quite simple. I've updated the PR.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36842] Implement PEP 578

2019-05-29 Thread Steve Dower


Change by Steve Dower :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36842] Implement PEP 578

2019-05-29 Thread Steve Dower


Steve Dower  added the comment:


New changeset 9ddc416e9f6635376312c3615193f19480ac772a by Steve Dower in branch 
'master':
bpo-36842: Fix reference leak in tests by running out-of-proc (GH-13556)
https://github.com/python/cpython/commit/9ddc416e9f6635376312c3615193f19480ac772a


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36373] Deprecate explicit loop parameter in all public asyncio APIs

2019-05-29 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
title: asyncio.gather: no docs for deprecated loop parameter -> Deprecate 
explicit loop parameter in all public asyncio APIs

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31829] Portability issues with pickle

2019-05-29 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

Bumping this discussion in case the should be merged for 3.8b1.  Thanks!

--
nosy: +cheryl.sabella

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36373] asyncio.gather: no docs for deprecated loop parameter

2019-05-29 Thread Emmanuel Arias


Emmanuel Arias  added the comment:

Hi
> There is no need to jumbo PR, you can split the work into PR-per-module if it 
> is more comfortable to you.
Yes, I think that is better split I will try it.
> I'm ok with reviewing any approach.
Thanks!

--
title: Deprecate explicit loop parameter in all public asyncio APIs -> 
asyncio.gather: no docs for deprecated loop parameter

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36373] Deprecate explicit loop parameter in all public asyncio APIs

2019-05-29 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
title: asyncio.gather: no docs for deprecated loop parameter -> Deprecate 
explicit loop parameter in all public asyncio APIs

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36373] Deprecate explicit loop parameter in all public asyncio APIs

2019-05-29 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
versions: +Python 3.8 -Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36373] asyncio.gather: no docs for deprecated loop parameter

2019-05-29 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Thank you.

The change is pretty straightforward.

There is no need to jumbo PR, you can split the work into PR-per-module if it 
is more comfortable to you.

I'm ok with reviewing any approach.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36373] asyncio.gather: no docs for deprecated loop parameter

2019-05-29 Thread Emmanuel Arias


Emmanuel Arias  added the comment:

hello, I will work on it, if there are no objection. :-)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   >