[issue31904] Python should support VxWorks RTOS

2019-05-23 Thread Hongchang Liu


Change by Hongchang Liu :


--
pull_requests: +13449

___
Python tracker 

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



[issue37029] PyObject_Free is O(N^2) where N = # of arenas

2019-05-23 Thread Inada Naoki


New submission from Inada Naoki :

Reported here:
* 
https://stackoverflow.com/questions/56228799/python-hangs-indefinitely-trying-to-delete-deeply-recursive-object
* https://mail.python.org/pipermail/python-dev/2019-May/157635.html

--
components: Interpreter Core
messages: 343344
nosy: inada.naoki, tim.peters
priority: normal
severity: normal
status: open
title: PyObject_Free is O(N^2) where N = # of arenas
type: performance
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



[issue36982] Add support for extended color functions in ncurses 6.1

2019-05-23 Thread Jeffrey Kintscher


Change by Jeffrey Kintscher :


--
type:  -> enhancement

___
Python tracker 

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



[issue36982] Add support for extended color functions in ncurses 6.1

2019-05-23 Thread Jeffrey Kintscher


Change by Jeffrey Kintscher :


--
keywords: +patch
pull_requests: +13448
stage:  -> patch review

___
Python tracker 

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



[issue37023] test_gdb failed on AMD64 Debian PGO 3.x

2019-05-23 Thread Steve Dower


Steve Dower  added the comment:

I confirmed earlier that removing the new code from builtins_id fixes this 
issue, which I suspect means that PGO is deciding to make different 
optimizations and produce different output.

Other functions in the same stack also do not show their arguments, so I think 
the best thing to do here is fix the test to not care about arguments being in 
the display. The result of gcc's PGO on debug symbols should not affect how we 
make Python work.

I'll update the regex in the test tomorrow.

--
assignee:  -> steve.dower

___
Python tracker 

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



[issue36982] Add support for extended color functions in ncurses 6.1

2019-05-23 Thread Chih-Hsuan Yen


Change by Chih-Hsuan Yen :


--
nosy: +yan12125

___
Python tracker 

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



[issue35753] Importing call from unittest.mock directly causes ValueError

2019-05-23 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue36630] failure of test_colors_funcs in test_curses with ncurses 6.1

2019-05-23 Thread Jeffrey Kintscher


Jeffrey Kintscher  added the comment:

I created issue #36982 to track the extended color changes since they broader 
than this issue.

--

___
Python tracker 

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



[issue36411] Python 3 f.tell() gets out of sync with file pointer in binary append+read mode

2019-05-23 Thread Windson Yang


Windson Yang  added the comment:

I think we should mention it at the document, like in the tell() function.

--

___
Python tracker 

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



[issue36411] Python 3 f.tell() gets out of sync with file pointer in binary append+read mode

2019-05-23 Thread Windson Yang


Windson Yang  added the comment:

I'm not sure it's a bug. When you write binary data to file (use BufferedIOBase 
by default). It actually writes the data to a buffer. That is why tell() gets 
out of sync. You can follow the instrument belolw. For instance, call flush() 
after writing to get the `correct answer.`

> When writing to this object, data is normally placed into an internal buffer. 
> The buffer will be written out to the underlying RawIOBase object under 
> various conditions, including:

> when the buffer gets too small for all pending data;
> when flush() is called;
> when a seek() is requested (for BufferedRandom objects);
> when the BufferedWriter object is closed or destroyed.

1. https://docs.python.org/3/library/io.html#io.BufferedWriter

--

___
Python tracker 

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



[issue35753] Importing call from unittest.mock directly causes ValueError

2019-05-23 Thread ppperry


ppperry  added the comment:

Indeed, you are right that this should be reopened.

--

___
Python tracker 

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



[issue36982] Add support for extended color functions in ncurses 6.1

2019-05-23 Thread Jeffrey Kintscher


Jeffrey Kintscher  added the comment:

Corrected typos in msg343336 for clarity:

At first glance, has_extended_colors() seems like a better name because it is 
similar to has_colors(), but the two functions have very different semantics 
that could confuse developers. has_extended_color_support() indicates available 
functionality in the underlying ncurses library that is set when the 
interpreter is compiled and linked, while has_colors() indicates available 
functionality of the current terminal at run-time. The name 
has_extended_colors() would imply that it indicates run-time terminal 
functionality and not static library functionality.

--

___
Python tracker 

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



[issue37019] Create symlinks relative to cwd

2019-05-23 Thread Shannon


Shannon  added the comment:

I can see how this change would be backward incompatible, however the current 
behaviour seems inconsistent with the way pathlib functions otherwise. Within 
two lines of code, the same path object can be pointing to two completely 
different locations simply because it's being used as the src argument to 
create a symlimk. That's counter to my understanding of the whole point of 
pathlib.

With regard to relative_to, I've found this issue, which doesn't seem to have 
been touched since 2016. https://bugs.python.org/issue20012
I'm new here, what's the best way to bump an issue?

--

___
Python tracker 

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



[issue36982] Add support for extended color functions in ncurses 6.1

2019-05-23 Thread Jeffrey Kintscher


Jeffrey Kintscher  added the comment:

A new function called curses.has_extended_color_support() will indicate whether 
the linked ncurses library provides extended color support. It returns true if 
curses.h defines NCURSES_EXT_COLORS and NCURSES_EXT_FUNCS, indicating that the 
extended color functions are available. This seems more useful to developers 
than using an indirect method like trying to set a color-pair greater than 
0x7fff and checking for an exception to indicate lack of support.

At first glance, has_extended_color() seems like a better name because it is 
similar to has_colors(), but the two functions have very different semantics 
that could confuse developers. has_extended_color_support() indicates available 
functionality in the underlying ncurses library that is set when the 
interpreter is compiled and linked, while has_curses() indicates available 
functionality of the current terminal at run-time.

--
versions:  -Python 3.9

___
Python tracker 

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



[issue37028] Implement asyncio repl

2019-05-23 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue35753] Importing call from unittest.mock directly causes ValueError

2019-05-23 Thread Thomas Hisch


Thomas Hisch  added the comment:

I think this tickt needs to be reopened, because

> The actual bug appears to be "doctest can't run on a module that contains 
> un-unwrappable objects"

@ppperry Or do you already know where this issue is tracked?

--
nosy: +Thomas Hisch

___
Python tracker 

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



[issue37028] Implement asyncio repl

2019-05-23 Thread Matthias Bussonnier


Change by Matthias Bussonnier :


--
nosy: +mbussonn

___
Python tracker 

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



[issue37021] Can _random.getrandbits() be converted to METH_FASTCALL?

2019-05-23 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
keywords: +patch
pull_requests: +13447
stage:  -> patch review

___
Python tracker 

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



[issue37028] Implement asyncio repl

2019-05-23 Thread Yury Selivanov


Change by Yury Selivanov :


--
keywords: +patch
pull_requests: +13446
stage:  -> patch review

___
Python tracker 

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



[issue37028] Implement asyncio repl

2019-05-23 Thread Yury Selivanov


New submission from Yury Selivanov :

Having an asyncio enabled repr where a top-level "await" possible would be a 
huge productivity boost.  Using asyncio.run() in a REPL is hard, and besides it 
spawns a new event loop on every call.

The big idea: we want users to be able to do this:

$ python -m asyncio

>>> await asyncio.sleep(10, return='hello')
# after 10 seconds
hello

--
components: asyncio
messages: 343334
nosy: asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Implement asyncio repl
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



[issue36876] Global C variables are a problem.

2019-05-23 Thread Eric Snow


Change by Eric Snow :


--
pull_requests: +13445

___
Python tracker 

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



[issue34963] String representation for types created with typing.NewType(…) are opaque and unappealing

2019-05-23 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

Serhiy,

It looks like Ivan approved your PR and was ready to merge it, but left it up 
to you for the final decision about incorporating changes from the competing 
PR.  This is just a friendly ping in case you want to get it in for 3.8.  
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



[issue37027] Return a safe proxy over a socket from get_extra_info('socket')

2019-05-23 Thread Yury Selivanov


Change by Yury Selivanov :


--
keywords: +patch
pull_requests: +13444
stage:  -> patch review

___
Python tracker 

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



[issue37027] Return a safe proxy over a socket from get_extra_info('socket')

2019-05-23 Thread Yury Selivanov


Change by Yury Selivanov :


--
components: +asyncio
nosy: +asvetlov
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



[issue34541] pathlib.Path.iterdir doesn't throw an exception until you start iterating

2019-05-23 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
nosy: +pitrou
type: behavior -> enhancement
versions: +Python 3.8 -Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue37027] Return a safe proxy over a socket from get_extra_info('socket')

2019-05-23 Thread Yury Selivanov


New submission from Yury Selivanov :

Currently asyncio exposes the underlying transport socket directly, providing a 
way to modify (in a potentially disruptive way) the underlying transport 
connection.

--
messages: 343332
nosy: yselivanov
priority: normal
severity: normal
status: open
title: Return a safe proxy over a socket from get_extra_info('socket')

___
Python tracker 

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



[issue35990] ipaddress.IPv4Interface won't accept 2-tuple (address, mask)

2019-05-23 Thread Jack


Jack  added the comment:

confirmed in 3.7.3

--
nosy: +Jacktose

___
Python tracker 

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



[issue37026] socketserver: BaseServer.handle_request() infinite loop

2019-05-23 Thread jmberg


New submission from jmberg :

Hi,

Alright - you may very well consider this to be a stupid idea and everything, 
but I figured I'd report it anyway, just so it's there even if you decide to 
ignore it.

For context, I'm running python in a ARCH=um Linux system that has completely 
virtual time, using basically this patch:
https://patchwork.ozlabs.org/patch/1095055/

Now, as I replied there myself, you would in fact think that this can lead to 
infinite loops, but not really in a select/poll loop in the socket server, 
hence this report.

We have the following code:

[...]

if timeout is not None:
deadline = time() + timeout

# Wait until a request arrives or the timeout expires - the loop is
# necessary to accommodate early wakeups due to EINTR.
with _ServerSelector() as selector:
selector.register(self, selectors.EVENT_READ)

while True:
ready = selector.select(timeout)
if ready:
return self._handle_request_noblock()
else:
if timeout is not None:
timeout = deadline - time()
if timeout < 0:
return self.handle_timeout()

Assume that a timeout is given, so deadline is set to time() + timeout.

Now, if selector.select(timeout) returns [] because nothing was ready for 
reading, you'd expect us to treat this as a timeout, right?

However, in my case of virtual time with infinite processing power, it doesn't.

Let's say that timeout is 1 (second) and that the call to time() returned 1 
(clearly not realistic, but doesn't matter). Now, in a virtual time 
implementation with infinite processing power, select(timeout) will sleep for 
*exactly* 1 second, and return nothing is ready. Then, in the else: branch, we 
set "timeout = deadline - time()" - but now time will return 10001 (remember we 
slept for exactly 1 second), and timeout will be 0. We will thus not handle a 
timeout, instead, we'll go into select() again with a timeout of 0. Due to the 
"infinite processing power" aspect of this system, this will happen over and 
over again.

The trivial fix here is to handle it as a timeout "if timeout <= 0" rather than 
just "if timeout < 0".

Obviously, I can also fix my virtual time system, for example, I can give it 
less processing power by actually interrupting the process after some real time 
(which I implemented in https://patchwork.ozlabs.org/patch/1095814/).

An alternative is to make every "what time is it now" request actually take 
some virtual time, thus the time() calls cannot return the same value over and 
over again. This also fixes the issue I saw.

But it stands to reason that if it should happen that the new timeout is 
actually 0, we should really treat it as a timeout here in this code and make 
it <=0 rather than just <0.

--
components: Library (Lib)
messages: 343330
nosy: jmberg
priority: normal
severity: normal
status: open
title: socketserver: BaseServer.handle_request() infinite loop
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



[issue36511] Add Windows ARM32 buildbot

2019-05-23 Thread Paul Monson


Change by Paul Monson :


--
pull_requests: +13443

___
Python tracker 

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



[issue32528] Change base class for futures.CancelledError

2019-05-23 Thread Yury Selivanov


Change by Yury Selivanov :


--
keywords: +patch
pull_requests: +13442
stage:  -> patch review

___
Python tracker 

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



[issue37025] Misleading error message "Python failed to load the default activation context"

2019-05-23 Thread Ralf Habacker


New submission from Ralf Habacker :

When I started Kicad under Windows I got the following error message in 
dbgview: "Python could not load the default activation context".

This message is issued by the Python runtime environment when checking the 
return value of the Windows API function AddRefActCtx() if the return value is 
zero (see 
https://github.com/python/cpython/blob/a3488e5902f5c26e5cc289aec2518e7b5058e5d1/PC/dl_nt.c#L107).

According to 
https://docs.microsoft.com/de-de/windows/desktop/api/winbase/nf-winbase-AddRefActCtx,
 this function does not return a value, which makes the check result dependent 
on temporary internal register/stack values and does not indicate a real 
problem.

This check should be completely removed so as not to waste the precious time of 
developers and users searching for the reason for this misleading message.

The corresponding definitions 
https://github.com/python/cpython/blob/2.7/PC/dl_nt.c#L36 (and line 37) should 
also be adjusted.

The issue is also present in version 2.7.

--
components: Windows
messages: 343329
nosy: paul.moore, rhabacker, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Misleading error message "Python failed to load the default activation 
context"
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



[issue35328] Set a environment variable for venv prompt

2019-05-23 Thread Brett Cannon


Brett Cannon  added the comment:

You can open a new PR with co-author or basing off of their fork if it's still 
around.

--

___
Python tracker 

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



[issue35328] Set a environment variable for venv prompt

2019-05-23 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

@brettcannon, yeah I saw that, but there hasn't been any progress since 
November. I'm still interested in this though. What would the correct workflow 
be? Pushing commits to the same PR or opening a new one with a co-author?

--

___
Python tracker 

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



[issue36964] `python3 -m venv NAME`: virtualenv is not portable

2019-05-23 Thread Brett Cannon


Brett Cannon  added the comment:

Virtual environments are not designed to be portable. For instance, if you have 
entry points installed then moving them to another machine would break their 
shebang lines. And even if you do it on your local machine there's no guarantee 
something else wasn't structured to be directory-specific.

So thanks for opening the issue, but I'm closing as not a bug.

--
nosy: +brett.cannon
resolution:  -> not a bug
stage:  -> 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



[issue35328] Set a environment variable for venv prompt

2019-05-23 Thread Brett Cannon


Brett Cannon  added the comment:

@lys.nikolaou it looks like there was an initial PR, but it only updated things 
for Bash and not for all the other shells that we support for virtual 
environments.

--
nosy: +brett.cannon

___
Python tracker 

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



[issue36975] csv: undocumented UnicodeDecodeError on malformed file

2019-05-23 Thread Brett Cannon


Brett Cannon  added the comment:

This isn't a bug because the CSV format isn't malformed (which would be 
appropriate for csv.Error), but the file itself isn't appropriate encoded (or 
the proper encoding wasn't specified (hence UnicodeDecodeError). So the 
exception is appropriate.

And we do not document indirect exceptions that get raised by code, only those 
that are explicitly raised. So everything is as it's expected.

--
nosy: +brett.cannon
resolution:  -> not a bug
stage:  -> 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



[issue23395] _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, SIG_IGN

2019-05-23 Thread Antoine Pitrou

Antoine Pitrou  added the comment:


New changeset 608876b6b1eb59538e6c29671a733033fb8b5be7 by Antoine Pitrou (Matěj 
Cepl) in branch 'master':
bpo-23395: Fix PyErr_SetInterrupt if the SIGINT signal is ignored or not 
handled (GH-7778)
https://github.com/python/cpython/commit/608876b6b1eb59538e6c29671a733033fb8b5be7


--
nosy: +pitrou

___
Python tracker 

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



[issue36511] Add Windows ARM32 buildbot

2019-05-23 Thread David Bolen


David Bolen  added the comment:

Yeah, I think you're right.

It looks like without an explicit code, it won't propagate the result as the 
exit code of cmd itself for those cases where cmd does exit (which would 
include the buildbots).

--

___
Python tracker 

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



[issue36511] Add Windows ARM32 buildbot

2019-05-23 Thread Paul Monson


Paul Monson  added the comment:

I did a quick test and it looks like exit /b %ERRORLEVEL% will propagate the 
exit code.

--

___
Python tracker 

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



[issue37024] SQLite flag in configure due to homebrew not linking sqlite

2019-05-23 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +berker.peksag

___
Python tracker 

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



[issue20443] __code__. co_filename should always be an absolute path

2019-05-23 Thread Batuhan


Change by Batuhan :


--
keywords: +patch
pull_requests: +13441
stage: needs patch -> patch review

___
Python tracker 

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



[issue36511] Add Windows ARM32 buildbot

2019-05-23 Thread David Bolen


David Bolen  added the comment:

I've been investigating issues with test failures on my Windows buildbots 
seemingly not showing up in the master's web interface (but just showing 
warnings), and it appears likely due to this change.

For example, test_urllib (a test problem from issue 36948) was failing but only 
appeared as a warning (the first such case on my Win10 builder for example is 
https://buildbot.python.org/all/#/builders/3/builds/2661).

This change appears to force the exit code of test.bat to be successful (0) 
regardless of the results of the test run, thus obscuring any test failures 
from a parent process such as the buildbot.  As an aside, it also looks like 
any failures along the new arm32ssh branch would be obscured, assuming that the 
ssh operation would otherwise have propagated the remote exit code.

I think just leaving off the exit code (so just "exit /b") should propagate the 
rt.bat result properly.  Or, a goto to a label at the end of the file and 
letting it exit naturally would mimic the prior behavior.

--
nosy: +db3l

___
Python tracker 

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



[issue37023] test_gdb failed on AMD64 Debian PGO 3.x

2019-05-23 Thread Steve Dower


Steve Dower  added the comment:

Well, the good news is I can repro it on a PGO build in WSL. So now I just need 
to go learn all about gcc's PGO build, debug info, and how gdb renders it!

--

___
Python tracker 

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



[issue37023] test_gdb failed on AMD64 Debian PGO 3.x

2019-05-23 Thread Steve Dower


Steve Dower  added the comment:

Ah no, it's expecting `builtin_id (self=..., v=...)` but getting `builtin_id 
()` instead.

--

___
Python tracker 

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



[issue37024] SQLite flag in configure due to homebrew not linking sqlite

2019-05-23 Thread Lysandros Nikolaou


New submission from Lysandros Nikolaou :

Since recently, Homebrew refuses to link sqlite. Upon researching the whole 
thing, I found out that this is now considered a feature of Homebrew and not a 
bug. Thus homebrew users on macOS do not get the SQLite module installed by 
default, because it is not found and have to overwrite CPPFLAGS. Would it make 
sense to include a --with-sqlite flag, like we do for openssl?

--
components: Build
messages: 343317
nosy: lys.nikolaou
priority: normal
severity: normal
status: open
title: SQLite flag in configure due to homebrew not linking sqlite
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



[issue37023] test_gdb failed on AMD64 Debian PGO 3.x

2019-05-23 Thread Steve Dower


Steve Dower  added the comment:

Is it just expecting builtin_id() to have been inlined? That seems risky.

--
nosy: +steve.dower

___
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-23 Thread STINNER Victor


STINNER Victor  added the comment:

I created bpo-37023 to track the test_gdb failure: "test_gdb failed on AMD64 
Debian PGO 3.x".

--
nosy: +vstinner

___
Python tracker 

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



[issue37023] test_gdb failed on AMD64 Debian PGO 3.x

2019-05-23 Thread STINNER Victor


New submission from STINNER Victor :

It's likely a regression caused by bpo-36842.

https://buildbot.python.org/all/#/builders/47/builds/2854

Example of failure:

==
FAIL: test_NULL_ob_type (test.test_gdb.PrettyPrintTests)
Ensure that a PyObject* with NULL ob_type is handled gracefully
--
Traceback (most recent call last):
  File 
"/var/lib/buildbot/slaves/enable-optimizations-bot/3.x.gps-debian-profile-opt.nondebug/build/Lib/test/test_gdb.py",
 line 533, in test_NULL_ob_type
self.assertSane('id(42)',
  File 
"/var/lib/buildbot/slaves/enable-optimizations-bot/3.x.gps-debian-profile-opt.nondebug/build/Lib/test/test_gdb.py",
 line 504, in assertSane
self.get_gdb_repr(source,
  File 
"/var/lib/buildbot/slaves/enable-optimizations-bot/3.x.gps-debian-profile-opt.nondebug/build/Lib/test/test_gdb.py",
 line 278, in get_gdb_repr
self.fail('Unexpected gdb output: %r\n%s' % (gdb_output, gdb_output))
AssertionError: Unexpected gdb output: 'Breakpoint 1 at 0x201df0: file 
Python/bltinmodule.c, line 1217.\n[Thread debugging using libthread_db 
enabled]\nUsing host libthread_db library 
"/lib/x86_64-linux-gnu/libthread_db.so.1".\n\nBreakpoint 1, builtin_id () at 
Python/bltinmodule.c:1217\n1217\t{\n#0  builtin_id () at 
Python/bltinmodule.c:1217\n#1  _PyMethodDef_RawFastCallKeywords () at 
Objects/call.c:650\n#2  _PyCFunction_FastCallKeywords (func=, args=, 
nargs=, kwnames=) at Objects/call.c:736\n#3  
call_function (kwnames=0x0, oparg=1, pp_stack=, 
tstate=) at Python/ceval.c:4831\n#4  _PyEval_EvalFrameDefault () 
at Python/ceval.c:3347\n#5  PyEval_EvalFrameEx (throwflag=0, f=Frame 
0x76e94800, for file , line 1, in  ()) at 
Python/ceval.c:685\n#6  _PyEval_EvalCodeWithName () at Python/ceval.c:4173\n#7  
PyEval_EvalCodeEx (closure=0x0,
  kwdefs=0x0, defcount=0, defs=, kwcount=0, kws=, argcount=0, args=, 
locals={\'__name__\': \'__main__\', \'__doc__\': None, \'__package__\': None, 
\'__loader__\': , \'__spec__\': None, 
\'__annotations__\': {}, \'__builtins__\': }, 
globals={\'__name__\': \'__main__\', \'__doc__\': None, \'__package__\': None, 
\'__loader__\': , \'__spec__\': None, 
\'__annotations__\': {}, \'__builtins__\': }, 
_co=) at Python/ceval.c:4202\n#8  
PyEval_EvalCode (co=, globals={\'__name__\': 
\'__main__\', \'__doc__\': None, \'__package__\': None, \'__loader__\': , \'__spec__\': None, \'__annotations__\': {}, 
\'__builtins__\': }, locals={\'__name__\': 
\'__main__\', \'__doc__\': None, \'__package__\': None, \'__loader__\': , \'__
 spec__\': None, \'__annotations__\': {}, \'__builtins__\': }) at Python/ceval.c:662\n#9  run_eval_code_obj () at 
Python/pythonrun.c:1078\n#10 run_mod () at Python/pythonrun.c:1100\n#11 
PyRun_StringFlags () at Python/pythonrun.c:987\n#12 PyRun_SimpleStringFlags () 
at Python/pythonrun.c:461\n#13 pymain_run_command (cf=, command=) at Modules/main.c:241\n#14 pymain_run_python (exitcode=) at 
Modules/main.c:522\n#15 _Py_RunMain () at Modules/main.c:610\n#16 pymain_main 
() at Modules/main.c:640\n#17 _Py_UnixMain (argc=, 
argv=) at Modules/main.c:664\n#18 __libc_start_main 
(main=, argc=7, argv=, init=, fini=, 
rtld_fini=, stack_end=) at ../csu/libc-start.c:291\n#19 _start 
()\n'
Breakpoint 1 at 0x201df0: file Python/bltinmodule.c, line 1217.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Breakpoint 1, builtin_id () at Python/bltinmodule.c:1217
1217{
#0  builtin_id () at Python/bltinmodule.c:1217
#1  _PyMethodDef_RawFastCallKeywords () at Objects/call.c:650
#2  _PyCFunction_FastCallKeywords (func=, args=, nargs=, 
kwnames=) at Objects/call.c:736
#3  call_function (kwnames=0x0, oparg=1, pp_stack=, 
tstate=) at Python/ceval.c:4831
#4  _PyEval_EvalFrameDefault () at Python/ceval.c:3347
#5  PyEval_EvalFrameEx (throwflag=0, f=Frame 0x76e94800, for file , 
line 1, in  ()) at Python/ceval.c:685
#6  _PyEval_EvalCodeWithName () at Python/ceval.c:4173
#7  PyEval_EvalCodeEx (closure=0x0, kwdefs=0x0, defcount=0, defs=, kwcount=0, 
kws=, argcount=0, args=, locals={'__name__': '__main__', '__doc__': None, 
'__package__': None, '__loader__': , '__spec__': 
None, '__annotations__': {}, '__builtins__': }, globals={'__name__': '__main__', '__doc__': None, 
'__package__': None, '__loader__': , '__spec__': 
None, '__annotations__': {}, '__builtins__': }, _co=) at Python/ceval.c:4202
#8  PyEval_EvalCode (co=, globals={'__name__': 
'__main__', '__doc__': None, '__package__': None, '__loader__': , '__spec__': None, '__annotations__': {}, '__builtins__': 
}, locals={'__name__': '__main__', '__doc__': 
None, '__package__': None, '__loader__': , 
'__spec__': None, '__annotations__': {}, '__builtins__': }) at Python/ceval.c:662
#9  run_eval_code_obj () at Python/pythonrun.c:1078
#10 run_mod () at Python/pythonrun.c:1100
#11 PyRun_StringFlags () at 

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

2019-05-23 Thread STINNER Victor


STINNER Victor  added the comment:

If someone wants to document that _start_new_thread() return value is similar 
to threading.get_ident() but not threading.get_native_id(): please go ahead and 
propose a PR :-)

Adding support for AIX to get_native_id() should be done in a separated issue 
since AIX seems to come with specific challenges :-)

The initial feature request is now implemented. Well done! I know that many 
people were awaiting to expose "gettid()" in Python. Now it's there!

Thanks everyone who was involved in this issue.

Sorry for the CI hiccup which required to revert the change temporarily. At 
least, it didn't miss Python 3.8 feature freeze!

--
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-23 Thread Steve Dower


Steve Dower  added the comment:

test_gdb failed on the Debian PGO buildbot

https://buildbot.python.org/all/#builders/47/builds/2854

I'm going to do what I can to investigate, but I may be out of my depth here!

--
stage: patch review -> commit review

___
Python tracker 

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



[issue37017] Use LOAD_METHOD optimization in CallMethod C API functions

2019-05-23 Thread Michael J. Sullivan


Michael J. Sullivan  added the comment:

I believe that this is orthogonal to PEP 590.

PyObject_CallMethodObjArgs and friends take varargs which need to be copied 
into an array one way or another. It is easy (and efficient) to prepend the 
base while copying the function arguments into the array (see the attached PR). 
I don't think that vector call will change anything about this.

--

___
Python tracker 

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



[issue37021] Can _random.getrandbits() be converted to METH_FASTCALL?

2019-05-23 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

If you hate Argument Clinic you can use METH_O and _PyLong_AsInt().

--

___
Python tracker 

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



[issue22577] local variable changes lost after pdb jump command

2019-05-23 Thread Henry Chen


Henry Chen  added the comment:

PEP 558 will fix this issue, which I've verified with the proposed 
implementation (https://github.com/python/cpython/pull/3640/files).

Perhaps this issue can be closed?

--

___
Python tracker 

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



[issue37021] Can _random.getrandbits() be converted to METH_FASTCALL?

2019-05-23 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

Sure. The simlest way is to use Argument Clinic.

--

___
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-23 Thread Jake Tesler


Jake Tesler  added the comment:

Michael Felt -
If you would like some help with adding/building AIX support for this 
functionality, tag me, I'd be glad to help out! :)

--

___
Python tracker 

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



[issue37022] pdb: do_p and do_pp swallow exceptions from __repr__

2019-05-23 Thread daniel hahler


New submission from daniel hahler :

Given:

```
class BadRepr:
def __repr__(self):
raise Exception('repr_exc')


obj = BadRepr()

__import__('pdb').set_trace()
```

```
(Pdb) p obj
(Pdb) pp obj
(Pdb)
```

Possible patch - clumsy due to `self._getval` both printing any error already, 
and raising the exception:

```
diff --git i/Lib/pdb.py w/Lib/pdb.py
index f5d33c27fc..59a419d961 100755
--- i/Lib/pdb.py
+++ w/Lib/pdb.py
@@ -1177,18 +1177,28 @@ def do_p(self, arg):
 Print the value of the expression.
 """
 try:
-self.message(repr(self._getval(arg)))
+val = self._getval(arg)
 except:
-pass
+return
+try:
+self.message(repr(val))
+except:
+exc_info = sys.exc_info()[:2]
+self.error(traceback.format_exception_only(*exc_info)[-1].strip())

 def do_pp(self, arg):
 """pp expression
 Pretty-print the value of the expression.
 """
 try:
-self.message(pprint.pformat(self._getval(arg)))
+val = self._getval(arg)
 except:
-pass
+return
+try:
+self.message(pprint.pformat(val))
+except:
+exc_info = sys.exc_info()[:2]
+self.error(traceback.format_exception_only(*exc_info)[-1].strip())

 complete_print = _complete_expression
 complete_p = _complete_expression
```

--
components: Library (Lib)
messages: 343306
nosy: blueyed
priority: normal
severity: normal
status: open
title: pdb: do_p and do_pp swallow exceptions from __repr__
type: behavior
versions: 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



[issue37014] [First easy issue] fileinput module should document that openhook and mode are ignored when reading from stdin

2019-05-23 Thread Grant Wu


Change by Grant Wu :


--
nosy: +grantwu -Grant Wu2

___
Python tracker 

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



[issue37000] _randbelow_with_getrandbits function inefficient with powers of two

2019-05-23 Thread Mark Dickinson


Mark Dickinson  added the comment:

Related:
`randrange(0)` raises an exception
`choice([])` raises an exception

Those are very different from `getrandbits(0)`: in both cases there's no 
reasonable value that can be returned: for the first case, there's no integer 
`x` with `0 <= x < 0`; for the second, there's no element of `[]`, period. In 
contrast, there's an obvious, valid, return value for `getrandbits(0)`.

The `getrandbits(0)` example is much more similar to `randrange(1)` (in fact, 
it's pretty much the same thing: apart from `n = 0`, `getrandbits(n)` is 
equivalent at some level to `randrange(2**n)`.

So if `getrandbits(0)` should be an exception on the basis of not having any 
randomness in the result, then `randrange(1)` should be an exception on the 
same basis, as should `random.uniform(2.0, 2.0)`, etc.

So to me, it makes no sense at all that `getrandbits(0)` raises: I can't see 
any good reason for it to do so.

--

___
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-23 Thread Steve Dower


Steve Dower  added the comment:


New changeset b82e17e626f7b1cd98aada0b1ebb65cb9f8fb184 by Steve Dower in branch 
'master':
bpo-36842: Implement PEP 578 (GH-12613)
https://github.com/python/cpython/commit/b82e17e626f7b1cd98aada0b1ebb65cb9f8fb184


--

___
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-23 Thread Steve Dower


Steve Dower  added the comment:

Is it worth also implementing if_nameindex() using (I assume) GetIfTable2Ex 
[1]? Or maybe just the simpler GetIfTable is sufficient - I'm not sure exactly 
what semantics Unix if_nameindex() has, whether it includes all logical 
adapters.

[1]: 
https://docs.microsoft.com/en-us/windows/desktop/api/netioapi/nf-netioapi-getiftable2ex

--

___
Python tracker 

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



[issue37000] _randbelow_with_getrandbits function inefficient with powers of two

2019-05-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> it's a bit surprising all on its own that `getrandbits(0)` 
> raises an exception.

Given that there would be no randomness in the result, it makes sense to me 
that getrandbits(0) is documented to raise an exception.

Related:
`randrange(0)` raises an exception
`choice([])` raises an exception


> In any case, I'd leave _randbelow_with_getrandbits alone.

That makes sense to me as well. I'll mark this as closed.

There's one other bright side.  If someone really cares about the speed of the 
power-of-two case, they can already call `getrandbits(10)` instead of 
`randrange(1024)`.  The former is about 7x faster.

Mathis, thank you for taking the time to look at this code.

--
resolution:  -> rejected
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



[issue37021] Can _random.getrandbits() be converted to METH_FASTCALL?

2019-05-23 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
components: Extension Modules
nosy: rhettinger, serhiy.storchaka, vstinner
priority: normal
severity: normal
status: open
title: Can _random.getrandbits() be converted to METH_FASTCALL?
type: performance
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



[issue36713] duplicate method definition in Lib/ctypes/test/test_unicode.py

2019-05-23 Thread Ezio Melotti


Ezio Melotti  added the comment:

Fixed, thanks for the PR!

--
assignee:  -> ezio.melotti
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



[issue36713] duplicate method definition in Lib/ctypes/test/test_unicode.py

2019-05-23 Thread Ezio Melotti


Ezio Melotti  added the comment:


New changeset 25d8404c358f3b1cc8321cdc74049d45dcb8d014 by Ezio Melotti (Michele 
Angrisano) in branch '2.7':
bpo-36713: Rename duplicated method in test_unicode. (#13525)
https://github.com/python/cpython/commit/25d8404c358f3b1cc8321cdc74049d45dcb8d014


--

___
Python tracker 

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



[issue36978] `python3 -m pip install` has no `--requirement` option on Windows

2019-05-23 Thread Marco Sulla


Marco Sulla  added the comment:

Excuse me, after a 

python -m pip install --upgrade setuptools
python -m pip install --upgrade pip

it works like a charme.

--
resolution:  -> works for me
stage: test needed -> resolved
status: pending -> closed
versions: +Python 3.6 -Python 3.8

___
Python tracker 

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



[issue36713] duplicate method definition in Lib/ctypes/test/test_unicode.py

2019-05-23 Thread Michele Angrisano


Change by Michele Angrisano :


--
keywords: +patch
pull_requests: +13440
stage: needs patch -> patch review

___
Python tracker 

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



[issue36797] Cull more oudated distutils information

2019-05-23 Thread miss-islington


miss-islington  added the comment:


New changeset a3488e5902f5c26e5cc289aec2518e7b5058e5d1 by Miss Islington (bot) 
in branch '3.7':
bpo-36797: Reduce levels of indirection in outdated distutils docs (GH-13462)
https://github.com/python/cpython/commit/a3488e5902f5c26e5cc289aec2518e7b5058e5d1


--
nosy: +miss-islington

___
Python tracker 

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



[issue36797] Cull more oudated distutils information

2019-05-23 Thread Nick Coghlan


Nick Coghlan  added the comment:


New changeset e788057a9188ff37e232729815dfda2529079420 by Nick Coghlan in 
branch 'master':
bpo-36797: Reduce levels of indirection in outdated distutils docs (#13462)
https://github.com/python/cpython/commit/e788057a9188ff37e232729815dfda2529079420


--

___
Python tracker 

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



[issue36797] Cull more oudated distutils information

2019-05-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13439

___
Python tracker 

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



[issue37016] Python embedded in C++ cannot open a file

2019-05-23 Thread Soumya Mohanty

Soumya Mohanty  added the comment:

Hello Stéphane,

I appreciate the reply, but read the docs and they did not resolve my problem. 

I solved it by adding full paths to the file instead of just there names, even 
though the file being loaded was in the present working directory and when 
working in pure python it works.

I would like to know what exactly is causing this issue, but we can close the 
issue (As it is not a bug)

--

___
Python tracker 

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



[issue36713] duplicate method definition in Lib/ctypes/test/test_unicode.py

2019-05-23 Thread Michele Angrisano


Michele Angrisano  added the comment:

I'm on it.

--

___
Python tracker 

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



[issue36713] duplicate method definition in Lib/ctypes/test/test_unicode.py

2019-05-23 Thread Ezio Melotti


Ezio Melotti  added the comment:

The duplicate method is gone from 3.5+, but it is still present on 2.7:
2.7/Lib/ctypes/test/test_unicode.py:96
2.7/Lib/ctypes/test/test_unicode.py:110

The one at line 96 should be renamed "test_ascii_strict".

Michele, do you want to work on a PR to fix it?

--
nosy: +ezio.melotti

___
Python tracker 

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



[issue1230540] sys.excepthook doesn't work in threads

2019-05-23 Thread STINNER Victor


STINNER Victor  added the comment:

There is a special case. If a thread calls os.fork() and Thread.run() raises an 
exception, the thread name is still logged even if there is only 1 thread after 
fork. Try attached fork_thread.py.

Output on Python 3.7:
---
main thread: spawn fork thread
thread: before fork [<_MainThread(MainThread, started 140623217481536)>, 
]
thread: after fork []
thread: after fork: raise
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib64/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
  File "fork_thread.py", line 17, in run
raise Exception("what happens here?")
Exception: what happens here?

main thread: done
---

Moreover, threading.Thread silently ignores SystemExit in run() even if it's 
the only remaining thread (main thread is gone after fork).

I don't think that we *have to* change the current behavior. It's just that we 
have to take it in account if we modify how exceptions are handled.

--
Added file: https://bugs.python.org/file48351/fork_thread.py

___
Python tracker 

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



[issue36713] duplicate method definition in Lib/ctypes/test/test_unicode.py

2019-05-23 Thread Michele Angrisano


Michele Angrisano  added the comment:

The proper link is this: cf448832ebca7ed34809168660fa96c3c61f8abb.

Sorry.

--

___
Python tracker 

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



[issue36713] duplicate method definition in Lib/ctypes/test/test_unicode.py

2019-05-23 Thread Michele Angrisano


Michele Angrisano  added the comment:

That method was already removed in cf44883.

--
nosy: +mangrisano

___
Python tracker 

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



[issue37017] Use LOAD_METHOD optimization in CallMethod C API functions

2019-05-23 Thread Inada Naoki


Inada Naoki  added the comment:

I want to wait this until PEP 590 is implemented.

Unlike CALL_METHOD, we can not avoid prepending self.

New method signature may be like this:

PyObject_VectorCallMethod(PyObject *name, PyObject **args, Py_ssize_t nargs, 
PyObject *kwds);

And args[0] is self.  With API like this, we can avoid prepending self.

--
nosy: +inada.naoki

___
Python tracker 

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



[issue35331] Incorrect __module__ attribute for _struct.Struct and perhaps a few others

2019-05-23 Thread Dan Snider


Change by Dan Snider :


--
nosy:  -bup

___
Python tracker 

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



[issue35331] Incorrect __module__ attribute for _struct.Struct and perhaps a few others

2019-05-23 Thread Dan Snider


Change by Dan Snider :


--
nosy: +bup

___
Python tracker 

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



[issue37020] Invalid floating point multiplication result

2019-05-23 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Relevant doc : https://docs.python.org/3/tutorial/floatingpoint.html

--
nosy: +xtreak

___
Python tracker 

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



[issue37020] Invalid floating point multiplication result

2019-05-23 Thread SilentGhost


SilentGhost  added the comment:

This is a limitation of floating points representation. If you need objects 
representing decimal numeral, you could use decimal module.

--
nosy: +SilentGhost
resolution:  -> not a bug
stage:  -> 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



[issue37020] Invalid floating point multiplication result

2019-05-23 Thread Antony


New submission from Antony :

Incorrect Multiplication result of number 40.95


>>> 40.94 * 100
4094.0

>>> 40.96 * 100
4096.0

but:
>>> 40.95 * 100
4095.5

checked with:
Python 2.7.15rc1 (default, Nov 12 2018, 14:31:15) 
and
Python 3.6.7 (default, Oct 22 2018, 11:32:17) 
[GCC 8.2.0] on linux

--
messages: 343287
nosy: Tonimore
priority: normal
severity: normal
status: open
title: Invalid floating point multiplication result
type: behavior
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue35907] [security][CVE-2019-9948] Unnecessary URL scheme exists to allow local_file:// reading file in urllib

2019-05-23 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +13438

___
Python tracker 

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



[issue37008] make unittest.mock.mock_open honor next()

2019-05-23 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
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



[issue37008] make unittest.mock.mock_open honor next()

2019-05-23 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



[issue36829] Add sys.unraisablehook() to custom how "unraisable exceptions" are logged

2019-05-23 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Could test.support.catch_unraisable_exception also be documented at 
https://docs.python.org/3/library/test.html#module-test.support ?

--
nosy: +xtreak

___
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-23 Thread Zackery Spytz


Zackery Spytz  added the comment:

I've created a PR for this issue. Few changes are needed to implement these 
functions on Windows.

--
nosy: +ZackerySpytz, eryksun

___
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-23 Thread Zackery Spytz


Change by Zackery Spytz :


--
keywords: +patch
pull_requests: +13437
stage:  -> patch review

___
Python tracker 

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



[issue37008] make unittest.mock.mock_open honor next()

2019-05-23 Thread miss-islington


miss-islington  added the comment:


New changeset 7cc47e9c19b7d67c8f08df15a413d14cf69f45da by Miss Islington (bot) 
in branch '3.7':
bpo-37008: make mock_open handle able to honor next() (GH-13492)
https://github.com/python/cpython/commit/7cc47e9c19b7d67c8f08df15a413d14cf69f45da


--

___
Python tracker 

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



[issue37008] make unittest.mock.mock_open honor next()

2019-05-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13436

___
Python tracker 

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



[issue37008] make unittest.mock.mock_open honor next()

2019-05-23 Thread miss-islington

miss-islington  added the comment:


New changeset 394119afc6611f17bac96f5ec6fefa0ae795 by Miss Islington (bot) 
(Damien Nadé) in branch 'master':
bpo-37008: make mock_open handle able to honor next() (GH-13492)
https://github.com/python/cpython/commit/394119afc6611f17bac96f5ec6fefa0ae795


--
nosy: +miss-islington

___
Python tracker 

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



[issue37014] [First easy issue] fileinput module should document that openhook and mode are ignored when reading from stdin

2019-05-23 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
keywords: +easy

___
Python tracker 

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



[issue37014] [First easy issue] fileinput module should document that openhook and mode are ignored when reading from stdin

2019-05-23 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Hi Grant,

Thank you for your bug report,

Would you interested to propose a Pull Request for a fix? You can read the 
devguide for more info https://devguide.python.org/

Thank you

--
nosy: +matrixise
title: fileinput module should document that openhook and mode are ignored when 
reading from stdin -> [First easy issue] fileinput module should document that 
openhook and mode are ignored when reading from stdin

___
Python tracker 

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



[issue37016] Python embedded in C++ cannot open a file

2019-05-23 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Hi Soumya,

But Py_Initialize and Py_Finalize are not called in this case, and it's not a 
bug of CPython.

I suggest you read this link: 
https://docs.python.org/3/extending/embedding.html#very-high-level-embedding 

Thank you

--
nosy: +matrixise
resolution:  -> not a bug
stage:  -> 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



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

2019-05-23 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
components: +Windows -Library (Lib)
nosy: +paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue1230540] sys.excepthook doesn't work in threads

2019-05-23 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

> Moreover, when sys.excepthook is called, the hook doesn't get access to the 
> thread object

You can get it with threading.current_thread(), no?

--

___
Python tracker 

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



[issue33110] Adding a done callback to a concurrent.futures Future once it has already completed, may raise an exception, contrary to docs

2019-05-23 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

Thank you Sam for your contribution!

--
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



[issue37019] Create symlinks relative to cwd

2019-05-23 Thread SilentGhost


SilentGhost  added the comment:

This would be backward incompatible change. I just wanted to point out that the 
symlink was only broken because the file did not exist, and one might want to 
legitimately create a link relative to the target's location. I'd imagine 
creating a link in the same directory is one such example. I think the issue 
you're raising can be addressed in documentation, by making clear that the 
relative link will be relative to target. This is already done in the given 
example for symlink_to, but could be improved using a target in subdirectory 
and a clarifying note.

The relative_to issue does indeed deserve a separate issue (if there isn't one 
already).

--
assignee:  -> docs@python
components: +Documentation
nosy: +SilentGhost, docs@python, serhiy.storchaka
title: using pathlib objects to create symlinks produces broken links -> Create 
symlinks relative to cwd
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



[issue37019] using pathlib objects to create symlinks produces broken links

2019-05-23 Thread Shannon


New submission from Shannon :

when using pathlib objects to define src and dst for os.symlink (also relevant 
for Path(dst).symlink_to(src)), if the src path is not absolute, or relative to 
the directory the link is being created in, a broken link will be created.

example/

src = pathlib.Path('dir1/file')
dst = pathlib.Path('dir2/file')
os.symlink(src, dst) # or dst.symlink_to(src)

this will create a broken link in dir2, attempting to link to dir1/file, 
relative to dir2.

It seems to me, if src given is a pathlib object (relative to cwd), the linking 
process should be smart enough to point the link the created symlink to the 
right place.

os.symlink(src.absolute(), dst) works, but creates an absolute symlink which 
may not be desired behaviour.

My current workaround is:
os.symlink(os.path.relpath(src, dst.parent), dst)
which creates a working relative symlink as desired. I would suggest this 
should be the default behaviour of both os.symlink and 
pathlib.Path().symlink_to when a non-absolute path object is given as src.

Interestingly, src.relative_to(dst.parent) will raise a ValueError while 
os.path.relpath(src, dst.parent) correctly returns '../dir1/file'.
I also think Path().relative_to should be changed to match the behaviour of 
os.path.relpath here, but perhaps that is a separate issue.

--
components: Library (Lib)
messages: 343277
nosy: skeo
priority: normal
severity: normal
status: open
title: using pathlib objects to create symlinks produces broken links
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