[issue37628] IDLE: Fix Font sample (config dialog) geometry

2019-07-25 Thread Tal Einat


Tal Einat  added the comment:

Since it's a text widget, it would be simple and rather intuitive to make it 
scrollable.  We could then make its size set according to the size of the 
config dialog window, rather than the other way around.

--

___
Python tracker 

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



[issue37585] Comparing PyDictValues does not give expected results

2019-07-25 Thread Kyle Stanley


Kyle Stanley  added the comment:

Added Brett to the nosy list since he was the one who suggested a documentation 
change.

--
nosy: +brett.cannon

___
Python tracker 

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



[issue37585] Comparing PyDictValues does not give expected results

2019-07-25 Thread Kyle Stanley


Kyle Stanley  added the comment:

Based on the current status of the discussion in python-dev, the most agreed 
upon solution so far seems to be updating the documentation to mention this 
behavior, rather than modifying the existing behavior. I opened a PR which 
updates the documentation for dict.values() to mention this, feel free to leave 
any suggestions.

python-dev discussion archive: 
https://mail.python.org/archives/list/python-...@python.org/thread/R2MPDTTMJXAF54SICFSAWPPCCEWAJ7WF/#723CHZBH4ZBKQJOOPXFFX3HYSPDBPDPR

--
nosy: +aeros167

___
Python tracker 

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



[issue37585] Comparing PyDictValues does not give expected results

2019-07-25 Thread Kyle Stanley


Change by Kyle Stanley :


--
pull_requests: +14723
pull_request: https://github.com/python/cpython/pull/14954

___
Python tracker 

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



[issue29446] Improve tkinter 'import *' situation

2019-07-25 Thread Terry J. Reedy


Change by Terry J. Reedy :


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



[issue29446] Improve tkinter 'import *' situation

2019-07-25 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 76b645124b3aaa34bc664eece43707c01ef1b382 by Terry Jan Reedy 
(Flavian Hautbois) in branch 'master':
bpo-29446: tkinter 'import *' only imports what it should (GH-14864)
https://github.com/python/cpython/commit/76b645124b3aaa34bc664eece43707c01ef1b382


--

___
Python tracker 

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



[issue37628] IDLE: Fix Font sample (config dialog) geometry

2019-07-25 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I consider it a bug for *IDLE* to place and size windows so that the bottom of 
the window is hidden.  (If users, perhaps temporarily, move a window down so 
that the bottom is hidden, that is their business.)

This is especially bad for the Settings dialog because the Enter and Escape 
keys are not bound to the Ok and Cancel handlers, as with at least most of the 
other dialogs.  This should be easy to fix.

The general problem in preventing over-sizing and misplacement is that, 
as far as Tal and I know, tk will only tell us the full size of a particular 
screen, not the current, usually reduced, view size.

Until about a month ago, ZoomHeight used platform-specific expressions from 
long ago that do not, in general, work now.  For issue #37039, Tal's solution 
was to 'calibrate' each screen the first time a window is zoomed on a screen in 
a session.  The window is maximized, the pixel height is saved, and the window 
is narrowed to what is was.  The saved height is used for subsequent zooms.  
Maximizing works because the OS + tk maximize to the current view size, 
depending on the current screen settings.

I suggested then the possibility of IDLE opening with a maximized splash 
screen.  Tal objected that this a) did not solve the problem of multiple 
screens, and b) would unnecessarily bother people who never zoom.  But zoom 
height is not the only feature that needs this knowledge.

On my machine with 45 line shell/editor windows, Shell is initially placed too 
low if I open IDLE one particular way.  I'll leave that to another issue.

For the config dialog, there is a geometry bug independent of the font sample 
content.  Even if the box is cleared, the dialog expands with font size.  
Fixing this is also a priority.

To completely solve geometry issues, we again need to know the screen's view 
height.  If not available, we would have to momentarily maximize the dialog as 
now done with zoom height.

The height of the Setting dialog is the maximum of the page sizes.  For normal 
font sizes, the font page is the shortest of the first 4, meaning that is has 
the most extra space.  The Highlight and General pages seem to be equally 
tallest.  So adding settings to the latter will increase the minimum size.

For 3.7.3, the dialog already fills the view height between menu line and icon 
bar on my Macbook Air.  But it is opened a quarter of the way down, so that a 
quarter of the dialog is covered.  This is another geometry bug.  On this 
machine, the dialog should be opened flush up against the app menu.  But 
hard-coding that for all machines would likely annoy most people who do not 
need that positioning.

I am worried that the addition of two more items to the General page, for zoom 
height and line numbers, will make the dialog too tall for the available space. 
 When 3.8.0a3 is released, I will check. 

I am thinking of moving indent size, revised, to the General page and moving 
Additional Help Sources, possibly flattened a bit, to the Font page.  Perhaps 
we should try to make the pages wider rather than taller.

--
nosy: +taleinat
stage:  -> needs patch
title: IDLE Font Sample distracting and too large -> IDLE: Fix Font sample 
(config dialog) geometry
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



[issue37687] Invalid regexp should rise exception

2019-07-25 Thread Matthew Barnett


Matthew Barnett  added the comment:

For historical reasons, if it isn't valid as a repeat then it's a literal. This 
is true in other regex implementations, and is by no means unique to the re 
module.

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



[issue37687] Invalid regexp should rise exception

2019-07-25 Thread belegnar


New submission from belegnar :

`re.error` should be rised on `re.compile("string{data}")` because manual says 
only numbers are valid within `{}`

--
components: Regular Expressions
messages: 348458
nosy: belegnar, ezio.melotti, mrabarnett
priority: normal
severity: normal
status: open
title: Invalid regexp should rise exception
versions: Python 3.6

___
Python tracker 

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



[issue37686] No error message in joining two root directories

2019-07-25 Thread Bin Hu


New submission from Bin Hu :

Two root directories shall not be joined in the first place. But, when such a 
command is passed, os.path.join() module should give a warning message instead 
of just keeping the second argument being passed as the output. 

Python 3.7.3 (default, Mar 27 2019, 16:54:48)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.4.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: from os import path

In [2]: a = '/tmp'

In [3]: b = '/data'

In [4]: print(path.join(a, b))
/data

In [5]: b = 'data'

In [6]: print(path.join(a, b))
/tmp/data

--
components: Extension Modules
messages: 348457
nosy: Bin Hu
priority: normal
severity: normal
status: open
title: No error message in joining two root directories
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



[issue37641] Embeddable distribution pyc filenames show build machine location

2019-07-25 Thread miss-islington


miss-islington  added the comment:


New changeset 0f211979c29109dcffc3039a24a9d3ecdfd900c9 by Miss Islington (bot) 
in branch '3.8':
bpo-37641 preserve relative file location in embeddable zip (GH-14884)
https://github.com/python/cpython/commit/0f211979c29109dcffc3039a24a9d3ecdfd900c9


--
nosy: +miss-islington

___
Python tracker 

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



[issue37641] Embeddable distribution pyc filenames show build machine location

2019-07-25 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14722
pull_request: https://github.com/python/cpython/pull/14953

___
Python tracker 

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



[issue37641] Embeddable distribution pyc filenames show build machine location

2019-07-25 Thread Steve Dower


Steve Dower  added the comment:


New changeset c4cda4369f4b8f33082890d16dfc364a90658ef6 by Steve Dower (Bill 
Collins) in branch 'master':
bpo-37641 preserve relative file location in embeddable zip (GH-14884)
https://github.com/python/cpython/commit/c4cda4369f4b8f33082890d16dfc364a90658ef6


--

___
Python tracker 

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



[issue37579] Difference in equality check between C and Python implementation for datetime module's timedelta and time

2019-07-25 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

See issue37685.

--

___
Python tracker 

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



[issue37555] _CallList.__contains__ doesn't always respect ANY.

2019-07-25 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

See issue37685.

--

___
Python tracker 

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



[issue37685] Fix equality checks for some types

2019-07-25 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue37685] Fix equality checks for some types

2019-07-25 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

The __eq__ implementation should return NotImplemented instead of False or 
raising an exception (like AttributeError or TypeError) when it does not 
support comparison with the other operand's type. It is so for most of 
implementations in the stdlib, but there are several exceptions. The proposed 
patch fixes these cases.

--
components: Library (Lib)
messages: 348452
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Fix equality checks for some types
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



[issue37674] Is imp module deprecated or pending deprecation?

2019-07-25 Thread Brett Cannon


Brett Cannon  added the comment:

It's deprecated: https://github.com/python/cpython/blob/master/Lib/imp.py#L31. 
The wording is from back when the module was soft-deprecated via documentation 
before it was hard-deprecated via code. Feel free to tweak it to say "The imp 
module is deprecated in favor of :mod:`importlib`."

--

___
Python tracker 

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



[issue37684] list.extend docs inaccurate

2019-07-25 Thread wim glenn


Change by wim glenn :


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

___
Python tracker 

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



[issue37684] list.extend docs inaccurate

2019-07-25 Thread wim glenn


New submission from wim glenn :

>From https://docs.python.org/3/tutorial/datastructures.html#more-on-lists :

list.extend(iterable)
Extend the list by appending all the items from the iterable.
Equivalent to a[len(a):] = iterable.

The "equivalent" is not very good. Consider 

def gen():
yield 1
yield 2
raise Exception

Using `a.extend(gen())` would mutate `a`. Using slice assignment would still 
consume the generator, but `a` would not be modified.

I propose a different example to use to describe the behaviour of extend:

for x in iterable:
a.append(x)

--
assignee: docs@python
components: Documentation
messages: 348450
nosy: docs@python, wim.glenn
priority: normal
severity: normal
status: open
title: list.extend docs inaccurate
versions: Python 2.7, 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



[issue37652] Multiprocessing shared_memory ValueError on race with ShareableList

2019-07-25 Thread mental


mental  added the comment:

Interestingly enough the race only seems to occur when the mutator resets the 
index with an identical value (try replacing the setitem value with: `not X[0]` 
or populate from `[b'hi']` and with the mutator code use `X[0][::1]`.

I can't help but think to implement an internal cache that would store the hash 
of the last modified value, then when another set occurs compare the two hashes 
and have the operation be a no-op if they match (thoughts?).

In the meantime I'll continue investigating to see what exactly causes this 
quirk :)

--

___
Python tracker 

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



[issue37683] Use importlib.resources in venv

2019-07-25 Thread Brett Cannon


New submission from Brett Cannon :

Right now the venv module directly reads the file system to find the activation 
scripts and then copies them over. Moving over to importlib.resources would be 
a more portable solution.

Unfortunately the venv API is specifically tied to the file system via 
EnvBuilder.install_scripts() 
(https://github.com/python/cpython/blob/master/Lib/venv/__init__.py#L341). I'm 
not sure how doable this idea would be due to this.

--
components: Library (Lib)
messages: 348448
nosy: barry, brett.cannon, vinay.sajip
priority: low
severity: normal
status: open
title: Use importlib.resources in venv
type: enhancement

___
Python tracker 

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



[issue37682] random.sample should support iterators

2019-07-25 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Possible implementation:

from itertools import islice as _islice

def reservoir_sample(self, population, k):
if k < 0:
raise ValueError("Sample is negative")
it = iter(population)
result = list(_islice(it, k))
if len(result) < k:
raise ValueError("Sample larger than population")
self.shuffle(result)
randbelow = self._randbelow
for i, x in enumerate(it, k+1):
j = randbelow(i)
if j < k:
result[j] = x
return result

--

___
Python tracker 

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



[issue24935] LDSHARED is not set according when CC is set.

2019-07-25 Thread Hong Xu


Change by Hong Xu :


--
pull_requests: +14719
pull_request: https://github.com/python/cpython/pull/14950

___
Python tracker 

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



[issue37682] random.sample should support iterators

2019-07-25 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

FYI, random.sample() (as most of other functions in the random module) is 
implemented in pure Python.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue37682] random.sample should support iterators

2019-07-25 Thread mental


Change by mental :


--
nosy: +mark.dickinson, rhettinger

___
Python tracker 

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



[issue37682] random.sample should support iterators

2019-07-25 Thread Thomas Dybdahl Ahle


New submission from Thomas Dybdahl Ahle :

Given a generator `f()` we can use `random.sample(list(f()), 10)` to get a 
uniform sample of the values generated.
This is fine, and fast, as long as `list(f())` easily fits in memory.
However, if it doesn't, one has to implement the reservoir sampling algorithm 
as a pure python function, which is much slower, and not so easy.

It seems that having a fast reservoir sampling implementation in 
`random.sample` to use for iterators would be both useful and make the API more 
predictable.

Currently when passing an iterator `random.sample` throws `TypeError: 
Population must be a sequence or set.`.
This is inconsistent with most of the standard library which accepts lists and 
iterators transparently.

I apologize if this enhancement has already been discussed.
I wasn't able to find it.
If wanted, I can write up a pull request.
I believe questions like this: 
https://stackoverflow.com/questions/12581437/python-random-sample-with-a-generator-iterable-iterator
 makes it clear that such functionality is wanted and non-obvious.

--
components: Library (Lib)
messages: 348445
nosy: thomasahle
priority: normal
severity: normal
status: open
title: random.sample should support iterators
type: enhancement
versions: Python 2.7, 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



[issue37679] test_with_pip fails on FreeBSD 10 bot

2019-07-25 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +koobs

___
Python tracker 

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



[issue37679] test_with_pip fails on FreeBSD 10 bot

2019-07-25 Thread Steve Dower


Steve Dower  added the comment:

Guessing this is a new warning in pip?

Can we just disable the cache explicitly for these tests? Or should we 
reconfigure the buildbot to suppress the warning.

--
nosy: +Marcus.Smith, dstufft, ncoghlan, paul.moore, pradyunsg, steve.dower

___
Python tracker 

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



[issue37502] Fix default argument handling for buffers argument in pickle.loads

2019-07-25 Thread Antoine Pitrou


Change by Antoine Pitrou :


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



[issue37502] Fix default argument handling for buffers argument in pickle.loads

2019-07-25 Thread miss-islington


miss-islington  added the comment:


New changeset 25cb4fd4fb0f44d2b6bf38379634f3d22b77aa17 by Miss Islington (bot) 
in branch '3.8':
bpo-37502: handle default parameter for buffers argument of pickle.loads 
correctly (GH-14593)
https://github.com/python/cpython/commit/25cb4fd4fb0f44d2b6bf38379634f3d22b77aa17


--
nosy: +miss-islington

___
Python tracker 

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



[issue37652] Multiprocessing shared_memory ValueError on race with ShareableList

2019-07-25 Thread mental


mental  added the comment:

I have been able to reproduce the issue.

I'm currently investigating to see what exactly inside the source of 
ShareableList is causing what appears to be miss synchronization.

Currently I think the issue is the documentation failing to mention that 
ShareableList does not perform atomic operations.

But I'm curious if a patch that adds some internal sync primitive is out of the 
question here?

--
nosy: +mental

___
Python tracker 

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



[issue37681] warning: ‘no_sanitize_thread’

2019-07-25 Thread hai shi

New submission from hai shi :

When I build cpython, I got this error:
Objects/obmalloc.c:1414:1: warning: ‘no_sanitize_thread’ attribute directive 
ignored [-Wattributes]
 {
 ^
I removed the _Py_NO_SANITIZE_THREAD and build again, this warning dismissed. 
not sure ASAN、TSAN and MSAN have some inner relation?

--
components: Build
messages: 348441
nosy: shihai1991
priority: normal
severity: normal
status: open
title: warning: ‘no_sanitize_thread’

___
Python tracker 

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



[issue37502] Fix default argument handling for buffers argument in pickle.loads

2019-07-25 Thread Antoine Pitrou


Antoine Pitrou  added the comment:


New changeset 898318b53d921298d1f1fcfa0f415844afbeb318 by Antoine Pitrou 
(Markus Mohrhard) in branch 'master':
bpo-37502: handle default parameter for buffers argument of pickle.loads 
correctly (GH-14593)
https://github.com/python/cpython/commit/898318b53d921298d1f1fcfa0f415844afbeb318


--

___
Python tracker 

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



[issue37502] Fix default argument handling for buffers argument in pickle.loads

2019-07-25 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14718
pull_request: https://github.com/python/cpython/pull/14948

___
Python tracker 

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



[issue37652] Multiprocessing shared_memory ValueError on race with ShareableList

2019-07-25 Thread Antoine Pitrou


Change by Antoine Pitrou :


--
nosy: +pierreglaser

___
Python tracker 

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



[issue30685] Multiprocessing Send to Manager Fails for Large Payload

2019-07-25 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

That's right. Thanks Zackery!

--
resolution:  -> duplicate
stage: needs patch -> resolved
status: open -> closed
superseder:  -> problem using multiprocessing with really big objects?

___
Python tracker 

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



[issue37680] distutils appends LDFLAGS environment variable before object file names

2019-07-25 Thread Batuhan


Change by Batuhan :


--
nosy: +BTaskaya

___
Python tracker 

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



[issue37680] distutils appends LDFLAGS environment variable before object file names

2019-07-25 Thread Omer Ozarslan


Omer Ozarslan  added the comment:

Attached a better example. Run make 
(static_example|shared_example|working_shared_example).

--
Added file: https://bugs.python.org/file48506/python-issue-2.tar.gz

___
Python tracker 

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



[issue36692] Unexpected stderr output from test_sys_settrace

2019-07-25 Thread hai shi


hai shi  added the comment:

It looks like setstrace function trigger this codeline: 
https://github.com/python/cpython/blob/master/Modules/_asynciomodule.c#L2618

Looks we can use set_exception_handler() to catch this error, but i am not sure 
it is worth catching this error through adding  a extended exception hander.

so, Nick, what's your thought?

REF: 
https://github.com/python/cpython/blob/master/Lib/asyncio/base_events.py#L1627

--
nosy: +shihai1991

___
Python tracker 

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



[issue37680] distutils appends LDFLAGS environment variable before object file names

2019-07-25 Thread Omer Ozarslan


New submission from Omer Ozarslan :

distutils honors some environment variables during extension build, however, 
LDFLAGS is appended before declaring object files. This causes undefined 
symbols during importing an extension built with some static libraries using 
this environment variable. This is not apparent in the case of dynamic linking, 
but it can be observed by adding "-Wl,--as-needed" flag, since this will link 
libraries only if they are required. Therefore, it will be necessary to add 
them after object files in case of dynamic linking as well in that case.

I believe this part is the culprit as it appends LDFLAGS environment variable 
to executable name: 
https://github.com/python/cpython/blob/c994c8f/Lib/distutils/sysconfig.py#L211-L235

I attached a minimal example (it requires cython, which relies on distutils for 
compilation).

It would be nice if LDFLAGS is appended after object files, or a new 
environment variable (e.g. LDLIBS) is introduced to distutils to be appended 
after object files.

--
components: Distutils
files: python-issue.tar.gz
messages: 348436
nosy: dstufft, eric.araujo, ozars
priority: normal
severity: normal
status: open
title: distutils appends LDFLAGS environment variable before object file names
Added file: https://bugs.python.org/file48505/python-issue.tar.gz

___
Python tracker 

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



[issue35145] sqlite3: optionally autoconvert table_info's DATETIME fields

2019-07-25 Thread Robert Pollak


Robert Pollak  added the comment:

Sorry for not providing a pull request yet.

By the way, the "DB Browser for SQLite" (https://sqlitebrowser.org/) also 
interprets DATETIME fields correctly.

(Could someone please change the "Stage" of this issue to "needs patch"?)

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



[issue37398] contextlib.ContextDecorator decorating async functions

2019-07-25 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

I still think that iscoroutinefunction should not be used for async/sync 
decoration type autodetection.

A day ago stuck with a case when decorator used iscoroutinefunction() for 
separation but returned a regular function wrapper that returns awaitable in 
turn.

As a result, the transparent decorator which should not modify a decorated 
function signature cannot be applied twice, e.g.

@retry
@retry
async def fetch(): 
...

This is very confusing behavior, the obvious fix is providing `sync_retry` and 
`async_retry` decorators to never mix the behavior.

Seems very close to the problem discussed here.

--

___
Python tracker 

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



[issue37664] Update bundled pip and setuptools

2019-07-25 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

This change seems to have buildbot failure on FreeBSD 10 for master and 3.8 
branch. I have opened issue37679 . I couldn't find any issues similar to this 
during previous upgrades.


https://buildbot.python.org/all/#/builders/167/builds/1380


test_with_pip (test.test_venv.EnsurePipTest) ... FAIL
==
FAIL: test_with_pip (test.test_venv.EnsurePipTest)
--
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd10.nondebug/build/Lib/test/test_venv.py",
 line 495, in test_with_pip
self.do_test_with_pip(False)
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd10.nondebug/build/Lib/test/test_venv.py",
 line 478, in do_test_with_pip
self.assertEqual(err.rstrip(), "")
AssertionError: "WARNING: The directory '/.cache/pip/http[202 chars]lag." != ''
- WARNING: The directory '/.cache/pip/http' or its parent directory is not 
owned by the current user and the cache has been disabled. Please check the 
permissions and owner of that directory. If executing pip with sudo, you may 
want sudo's -H flag.
+ 
--

--
nosy: +xtreak

___
Python tracker 

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



[issue37679] test_with_pip fails on FreeBSD 10 bot

2019-07-25 Thread Karthikeyan Singaravelan


New submission from Karthikeyan Singaravelan :

I guess the upgrade in issue37664 caused an issue with FreeBSD bot. The bot 
seems to fail after this change on master and 3.8.

https://buildbot.python.org/all/#/builders/167/builds/1380


test_with_pip (test.test_venv.EnsurePipTest) ... FAIL
==
FAIL: test_with_pip (test.test_venv.EnsurePipTest)
--
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd10.nondebug/build/Lib/test/test_venv.py",
 line 495, in test_with_pip
self.do_test_with_pip(False)
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd10.nondebug/build/Lib/test/test_venv.py",
 line 478, in do_test_with_pip
self.assertEqual(err.rstrip(), "")
AssertionError: "WARNING: The directory '/.cache/pip/http[202 chars]lag." != ''
- WARNING: The directory '/.cache/pip/http' or its parent directory is not 
owned by the current user and the cache has been disabled. Please check the 
permissions and owner of that directory. If executing pip with sudo, you may 
want sudo's -H flag.
+ 
--

--
components: Tests
messages: 348432
nosy: pablogsal, vstinner, xtreak
priority: normal
severity: normal
status: open
title: test_with_pip fails on FreeBSD 10 bot
type: behavior
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



[issue37678] Incorrect behaviour for user@password URI pattern in urlparse

2019-07-25 Thread Sean Wang


New submission from Sean Wang :

When an IPV4 URL with 'username:password' in it, and the password contains 
special characters like #[]?, urlparse would act as unexcepted.
example: 

urlparse('http://user:pass#?[w...@example.com:80/path')

--
components: Library (Lib)
messages: 348431
nosy: Sean.Wang
priority: normal
severity: normal
status: open
title: Incorrect behaviour for user@password URI pattern in urlparse
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



[issue37677] Seg Fault on OSX when multiprocessing

2019-07-25 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks for the report. It would be helpful to have a standalone reproducer for 
this issue to try reproducing it in 3.6 and other versions.

--
nosy: +davin, pitrou, xtreak

___
Python tracker 

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



[issue37676] cmath.phase array support

2019-07-25 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +mark.dickinson
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



[issue37677] Seg Fault on OSX when multiprocessing

2019-07-25 Thread alvis


New submission from alvis :

Encountered a crash with the following logs.
I have already added no_proxy=*, and it fixed the issue which i can replicate 
consistent. However, this crash does not happen every time, maybe once in a few 
week.

Process:   Python [66435]
Path:  
/Library/Frameworks/Python.framework/Versions/3.6/Resources/Python.app/Contents/MacOS/Python
Identifier:Python
Version:   3.6.8 (3.6.8)
Code Type: X86-64 (Native)
Parent Process:Python [65077]
Responsible:   Python [66435]
User ID:   501

Date/Time: 2019-07-24 21:45:29.722 +0800
OS Version:Mac OS X 10.14.2 (18C54)
Report Version:12
Bridge OS Version: 3.5 (16P5125)
Anonymous UUID:3F729BF3-2BB1-3830-B6FE-D22CA431DE5A


Time Awake Since Boot: 160 seconds

System Integrity Protection: enabled

Crashed Thread:2

Exception Type:EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:   KERN_INVALID_ADDRESS at 0x000109b23aa2
Exception Note:EXC_CORPSE_NOTIFY

Termination Signal:Segmentation fault: 11
Termination Reason:Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [66435]

VM Regions Near 0x109b23aa2:
MALLOC_LARGE   000109aa3000-000109b23000 [  512K] rw-/rwx 
SM=COW  
--> 
__TEXT 000109b27000-000109b3d000 [   88K] r-x/rwx 
SM=COW  
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/numpy/.dylibs/libgcc_s.1.dylib

Application Specific Information:
*** multi-threaded process forked ***
crashed on child side of fork pre-exec 

Thread 2 Crashed:
0   libsystem_trace.dylib   0x7fff7d6fdab3 _os_log_cmp_key + 4
1   libsystem_c.dylib   0x7fff7d5aaa5e rb_tree_find_node + 
53
2   libsystem_trace.dylib   0x7fff7d6fbc81 os_log_create + 370
3   libnetwork.dylib0x7fff7c04058f 
nwlog_legacy_init_once + 47
4   libsystem_pthread.dylib 0x7fff7d6e1ce4 
__pthread_once_handler + 66
5   libsystem_platform.dylib0x7fff7d6d7acb _os_once_callout + 18
6   libsystem_pthread.dylib 0x7fff7d6e1c7f pthread_once + 56
7   libnetwork.dylib0x7fff7c024ccd 
networkd_settings_init + 669
8   libnetwork.dylib0x7fff7c024982 
networkd_settings_get_bool + 18
9   libnetwork.dylib0x7fff7c0244f0 
-[NWConcrete_nw_parameters initWithStack:] + 160
10  libnetwork.dylib0x7fff7c023d97 
nw_path_create_evaluator_for_endpoint + 487
11  libnetwork.dylib0x7fff7c2451bc 
nw_nat64_v4_address_requires_synthesis + 220
12  libsystem_info.dylib0x7fff7d609e83 
_gai_nat64_v4_address_requires_synthesis + 67
13  libsystem_info.dylib0x7fff7d609210 
_gai_nat64_second_pass + 512
14  libsystem_info.dylib0x7fff7d5e7b4a si_addrinfo + 1978
15  libsystem_info.dylib0x7fff7d5e7262 
_getaddrinfo_internal + 242
16  libsystem_info.dylib0x7fff7d5e715d getaddrinfo + 61
17  _socket.cpython-36m-darwin.so   0x0001092c24ed socket_getaddrinfo + 
621
18  org.python.python   0x000106d63697 
_PyCFunction_FastCallDict + 183
19  org.python.python   0x000106de5747 call_function + 439
20  org.python.python   0x000106de1eb7 
_PyEval_EvalFrameDefault + 27559
21  org.python.python   0x000106de61af 
_PyEval_EvalCodeWithName + 2447
22  org.python.python   0x000106de6ae1 fast_function + 545
23  org.python.python   0x000106de5721 call_function + 401
24  org.python.python   0x000106de1eb7 
_PyEval_EvalFrameDefault + 27559
25  org.python.python   0x000106de61af 
_PyEval_EvalCodeWithName + 2447
26  org.python.python   0x000106de6ae1 fast_function + 545
27  org.python.python   0x000106de5721 call_function + 401
28  org.python.python   0x000106de1eb7 
_PyEval_EvalFrameDefault + 27559
29  org.python.python   0x000106de6a3d fast_function + 381
30  org.python.python   0x000106de5721 call_function + 401
31  org.python.python   0x000106de1eb7 
_PyEval_EvalFrameDefault + 27559
32  org.python.python   0x000106de61af 
_PyEval_EvalCodeWithName + 2447
33  org.python.python   0x000106de6ae1 fast_function + 545
34  org.python.python   0x000106de5721 call_function + 401
35  org.python.python   0x000106de1eb7 
_PyEval_EvalFrameDefault + 27559
36  org.python.python   0x000106de61af 
_PyEval_EvalCodeWithName + 2447
37  org.python.python   0x000106de6dfb 

[issue20088] locale.getlocale() fails if locale name doesn't include encoding

2019-07-25 Thread Саша Черных

Change by Саша Черных :


--
nosy: +nervov_fan

___
Python tracker 

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



[issue37676] cmath.phase array support

2019-07-25 Thread Hendrik


New submission from Hendrik :

It would be nice if cmath.phase supports arrays like this: 
```
import cmath
import numpy as np

z=255*np.ones((3,3)) * np.exp(1j * np.pi*np.ones((3,3)))

def get_k_amp_array(z):
return abs(z)

def get_k_ph_array(z):
return np.array([[cmath.phase(z_row) for z_row in z_col] for z_col in z ])

amp_array=  get_k_amp_array(z)
ph_array=   get_k_ph_array(z)

print(amp_array)
print(ph_array)
```

--
components: Library (Lib)
messages: 348428
nosy: kolibril13
priority: normal
severity: normal
status: open
title: cmath.phase array support
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



[issue37398] contextlib.ContextDecorator decorating async functions

2019-07-25 Thread Nathaniel Smith


Nathaniel Smith  added the comment:

There are two different axes of sync/async here, and it's important not to mix 
them up: the context manager could be sync or async, and the function that's 
being decorated could be sync or async. This issue is about the case where you 
have a sync context manager, and it's decorating an async function.

The current behavior is definitely super confusing and not at all useful.

In general, I'm also very skeptical about using iscoroutinefunction to 
automatically change semantics, because of the issue Andrew mentions about 
failing to handle complicated objects like functools.partial instances or sync 
functions that return awaitables. In this *specific* case though, I'm not 
sure... maybe it actually is OK?

What's special about this case is that when you write:

@sync_cm()
async def foo():
...

...the same person is writing both the @ line and the 'async def' line, and 
they're right next to each other in the source code. So the normal concern 
about some unexpected foreign object being passed in doesn't really apply. And 
in fact, if I did have an awaitable-returning-function:

@sync_cm()
def foo():
return some_async_fn()

...then I think most people would actually *expect* this to be equivalent to:

def foo():
with sync_cm():
return some_async_fn()

Not very useful, but not surprising either. So maybe this is the rare case 
where switching on iscoroutinefunction is actually OK? The only cases where it 
would fail is if someone invokes the decorator form directly, e.g.

new_fn = sync_cm()(old_fn)

This seems pretty rare, but probably someone does do it, so I dunno.

If we think that's too magic, another option would be to make up some more 
explicit syntax, like:

@sync_cm().wrap_async
async def foo(): ...

...Oh, but I think this breaks the Guido's gut feeling rule 
(https://mail.python.org/pipermail/python-dev/2004-August/046711.html), so it 
would have to instead be:

@sync_cm.wrap_async()
async def foo(): ...

And even if we decide not to automatically switch on iscoroutinefunction, we 
should probably add a warning or something at least, because right now

@sync_cm()
async def ...

is definitely a mistake.

(Adding Nick to nosy as the contextlib maintainer.)

--
nosy: +ncoghlan, njs

___
Python tracker 

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



[issue37398] contextlib.ContextDecorator decorating async functions

2019-07-25 Thread John Belmonte


John Belmonte  added the comment:

I was caught by this again, indirectly via @contextmanager.

If I define a non-async context manager using @contextmanager, I expect the 
decorator support to work on async functions.  I.e. the following should be 
equivalent:

```
async def foo():
with non_async_cm:
...
```
```
@non_async_cm
async def foo():
...
```

Not only does the 2nd case not work, but the decorator is (effectively) 
silently ignored :(

--

___
Python tracker 

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