[issue33455] test.test_posix.TestPosixSpawn::test_specify_environment fails with custom LD_LIBRARY_PATH

2018-05-10 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 7ec8f28656ea9d84048e9b5655375c6a74a59f53 by Serhiy Storchaka 
(Miro Hrončok) in branch 'master':
bpo-33455: Pass os.environ in test_posix::test_specify_environment. (GH-6753)
https://github.com/python/cpython/commit/7ec8f28656ea9d84048e9b5655375c6a74a59f53


--

___
Python tracker 

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



[issue33455] test.test_posix.TestPosixSpawn::test_specify_environment fails with custom LD_LIBRARY_PATH

2018-05-10 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6451

___
Python tracker 

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



[issue15443] datetime module has no support for nanoseconds

2018-05-10 Thread Giampaolo Rodola'

Change by Giampaolo Rodola' :


--
nosy: +giampaolo.rodola

___
Python tracker 

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



[issue33463] Can namedtuple._asdict return a regular dict instead of OrderedDict?

2018-05-10 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
assignee:  -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue33462] reversible dict

2018-05-10 Thread Raymond Hettinger

Change by Raymond Hettinger :


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



[issue33463] Can namedtuple._asdict return a regular dict instead of OrderedDict?

2018-05-10 Thread Raymond Hettinger

Change by Raymond Hettinger :


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



[issue33463] Can namedtuple._asdict return a regular dict instead of OrderedDict?

2018-05-10 Thread Michael Selik

New submission from Michael Selik :

Since the basic dict is now keeping insertion order, can we switch 
namedtuple._asdict to return a basic dict? Other than OrderedDict.move_to_end 
and the repr, I believe there is no compatibility issue.

--
messages: 316387
nosy: selik
priority: normal
severity: normal
status: open
title: Can namedtuple._asdict return a regular dict instead of OrderedDict?
type: enhancement
versions: Python 3.7, Python 3.8

___
Python tracker 

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



[issue33462] reversible dict

2018-05-10 Thread Michael Selik

New submission from Michael Selik :

Now that dicts are tracking insertion order, they can be made reversible via 
the built-in reversed, just like OrderedDict.

--
messages: 316386
nosy: selik
priority: normal
severity: normal
status: open
title: reversible dict
type: enhancement

___
Python tracker 

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



[issue31817] Compilation Error with Python 3.6.1/3.6.3 with Tkinter

2018-05-10 Thread dplusplus

dplusplus  added the comment:

I am trying to build Python 3.6.5 from source, with Tcl 8.6.8 and Tk 8.6.8, and 
I get the same issue (Building on Ubuntu 18.04, tried with GCC 7.3 and 8.1 with 
same results). 
Run 'readelf -d` on 
'build/lib.linux-x86_64-3.6/_tkinter.cpython-36m-x86_64-linux-gnu_failed.so' 
and I get three NEEDED entries:


 0x0001 (NEEDED) Shared library: [libpython3.6m.so.1.0]
 0x0001 (NEEDED) Shared library: [libpthread.so.0]
 0x0001 (NEEDED) Shared library: [libc.so.6]


Tcl and Tk libraries are not listed as needed shared libraries, which explains 
why settings runpaths (which I tried by setting CFLAGS) does not seem to work.
I'm comparing this to the ELF entries in Ubuntu's Python 3.6.5 tkinter module 
'/usr/lib/python3.6/lib-dynload/_tkinter.cpython-36m-x86_64-linux-gnu.so', 
which does have NEEDED entries for tcl8.6.so and tk8.6.so.

--
nosy: +dplusplus -6598335

___
Python tracker 

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



[issue29204] Add code deprecations in ElementTree

2018-05-10 Thread Matthias Bussonnier

Change by Matthias Bussonnier :


--
pull_requests: +6450

___
Python tracker 

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



[issue33461] json.loads(encoding=) does not emit deprecation warning.

2018-05-10 Thread Matthias Bussonnier

Change by Matthias Bussonnier :


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

___
Python tracker 

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



[issue33461] json.loads(encoding=) does not emit deprecation warning.

2018-05-10 Thread Matthias Bussonnier

New submission from Matthias Bussonnier :

The `encoding` keyword of json.loads is ignored and deprecated. AFAICT this is 
since Python 3.1. 

Passing a value for encoding does not emit a deprecation warning.

--
messages: 316384
nosy: mbussonn
priority: normal
severity: normal
status: open
title: json.loads(encoding=) does not emit deprecation warning.

___
Python tracker 

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



[issue33351] Support compiling with clang-cl on Windows

2018-05-10 Thread Ethan Smith

Change by Ethan Smith :


--
keywords: +patch
pull_requests: +6448
stage: test needed -> patch review

___
Python tracker 

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



[issue33459] Define "tuple display" in the docs

2018-05-10 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

Actually, 'tuple display' is in the index under 'display' and links to the last 
paragraph in 6.2.3.  However, except for the index name, that paragraph doesn't 
use the phrase 'tuple display'.  So it gives the definition without saying what 
it is defining.

> Note that tuples are not formed by the parentheses, but rather by use of the 
> comma operator. The exception is the empty tuple, for which parentheses are 
> required — allowing unparenthesized “nothing” in expressions would cause 
> ambiguities and allow common typos to pass uncaught.

--
nosy: +csabella

___
Python tracker 

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



[issue33459] Define "tuple display" in the docs

2018-05-10 Thread R. David Murray

R. David Murray  added the comment:

Nope, a tuple display is not equal to a parenthesized list.  For example, in:

   x = 1, 2, 3

1, 2, 3 is a tuple display.  The parenthesis are optional in that case (in the 
general case it is the comma that makes the tuple, not the parens).

However, as far as I can see that's the only mention of "tuple display" in the 
docs, which makes the doc you reference less than useful to a reader that 
doesn't know what it means.

--
nosy: +r.david.murray
title: Fix "tuple display" mention in Expressions -> Define "tuple display" in 
the docs

___
Python tracker 

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



[issue33460] ... used to indicate many different things in chapter 3, some are confusing

2018-05-10 Thread Lew Kurtz

New submission from Lew Kurtz :

https://docs.python.org/3/tutorial/introduction.html
uses ... to mean 5 or 6 different things. Since ... is continuation prompt, 
some of these other uses on that page are confusing - at least they were to 
this newbie. The most confusing are where it is used to hide output in the 
error messages.

If someone has the patience to send me pointers on how to fix this, I would 
love to fix this myself. -Lew

ps. the section headers in chapter 3 also need some work, 3.1.1 is the only 
section that is really about python being a calculator 3.1.2 and 3.1.3 don't 
seem very 'calculator-y' - Id like to fix this too.

--
assignee: docs@python
components: Documentation
messages: 316381
nosy: docs@python, lew18
priority: normal
severity: normal
status: open
title: ... used to indicate many different things in chapter 3, some are 
confusing
type: enhancement
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



[issue33459] Fix "tuple display" mention in Expressions

2018-05-10 Thread Andrés Delfino

Change by Andrés Delfino :


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

___
Python tracker 

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



[issue33459] Fix "tuple display" mention in Expressions

2018-05-10 Thread Andrés Delfino

New submission from Andrés Delfino :

Expressions mentions "tuple displays" in 6.16 (Operator precedence).

AFAIK, there ano "tuple displays". Expressions mentions list, dict, and set 
displays, and then talks about generator expressions.

I guess "parenthesized expressions" should be the term that fits here?

--
assignee: docs@python
components: Documentation
messages: 316380
nosy: adelfino, docs@python
priority: normal
severity: normal
status: open
title: Fix "tuple display" mention in Expressions
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



[issue31670] Associate .wasm with application/wasm

2018-05-10 Thread Brad Nelson

Brad Nelson  added the comment:

We have a provisional registration for application/wasm now with IANA:
https://www.iana.org/assignments/provisional-standard-media-types/provisional-standard-media-types.xhtml

This is also shipping in Firefox and Chrome.

Would it be possible to merge this?

Thanks!

--

___
Python tracker 

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



[issue33449] Documentation for email.charset confusing about the location of constants

2018-05-10 Thread R. David Murray

R. David Murray  added the comment:

Ah, I see.  Yes, those strings are actually hardcoded in the documentation 
source instead of being references.  You are correct, they should be fixed.  
Note, however, that Charset is part of the legacy API and isn't actually used 
if you use the new API in python3.

--
stage:  -> needs patch
type: enhancement -> behavior
versions:  -Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue13044] pdb throws AttributeError at end of debugging session

2018-05-10 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

See also issue 33458 that deals with the same problem when pdb is run as 
'python -m pdb some_main.py' instead of by inserting a breakpoint with 
'pdb.set_trace()'.

--

___
Python tracker 

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



[issue33458] pdb.run() does not trace destructors of __main__

2018-05-10 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

The following patch fixes the problem when applied applied on top of PR 6730:

diff --git a/Lib/bdb.py b/Lib/bdb.py
index c6a10359ac..07231ec588 100644
--- a/Lib/bdb.py
+++ b/Lib/bdb.py
@@ -582,7 +582,7 @@ class Bdb:
 cmd = compile(cmd, "", "exec")
 sys.settrace(self.trace_dispatch)
 try:
-exec(cmd, globals, locals)
+exec(cmd, dict(globals), dict(locals))
 except BdbQuit:
 pass
 finally:

--

___
Python tracker 

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



[issue33458] pdb.run() does not trace destructors of __main__

2018-05-10 Thread Xavier de Gaye

New submission from Xavier de Gaye :

This issue is a companion to issue 13044.

Running with Python 3.6.5 the following code fails with NameError:

1 class C:
2 def __del__(self):
3 print('deleted')
4
5 c = C()
6 x = 1

$  python -m pdb bar.py
> ./bar.py(1)()
-> class C:
(Pdb) break 6
Breakpoint 1 at ./bar.py:6
(Pdb) continue
> ./bar.py(6)()
-> x = 1
(Pdb) step
--Return--
> ./bar.py(6)()->None
-> x = 1
(Pdb) step
--Return--
> (1)()->None
(Pdb) step
> /usr/lib/python3.6/bdb.py(438)run()
-> self.quitting = True
(Pdb) step
The program finished and will be restarted
Exception ignored in: >
Traceback (most recent call last):
  File "./bar.py", line 3, in __del__
print('deleted')
NameError: name 'print' is not defined
> ./bar.py(1)()
-> class C:
(Pdb)

--
components: Library (Lib)
messages: 316375
nosy: xdegaye
priority: normal
severity: normal
status: open
title: pdb.run() does not trace destructors of __main__
type: behavior
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue33449] Documentation for email.charset confusing about the location of constants

2018-05-10 Thread Francois Labelle

Francois Labelle  added the comment:

Original poster here (OpenID just wouldn't work anymore).

For instance: https://docs.python.org/2/library/email.charset.html

Under "class email.charset.Charset"

Under "header_encoding"

"If the character set must be encoded before it can be used in an email header, 
this attribute will be set to Charset.QP (for quoted-printable), Charset.BASE64 
(for base64 encoding), or Charset.SHORTEST for the shortest of QP or BASE64 
encoding. Otherwise, it will be None."

--
nosy: +quantum.om...@gmail.com -Francois Labelle

___
Python tracker 

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



[issue13044] pdb throws AttributeError at end of debugging session

2018-05-10 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

Actually the segfault can be avoided by running the garbage collection before 
_PyState_ClearModules() in PyImport_Cleanup() and one can trace the C 
destructor with the attached patch global_destructors.diff applied on top of PR 
6730.

_PyState_ClearModules() clears the state->modules_by_index list and causes the 
readline module to be non-functional. The same problem occurs in 
test_create_at_shutdown_without_encoding() in test_io.py when it is run with 
the io module: the C destructor fails before hitting the "LookupError: unknown 
encoding: ascii" error message because the garbage collection is made after 
_PyState_ClearModules() and the _io module is non-functional 
(PyState_FindModule() returns NULL).

So the destructors can be traced during finalization provided the tracer does 
not access any of the sys attributes that are set to None at the start of 
PyImport_Cleanup().  This is true for the globals of the modules that are only 
owned by sys.modules at the time 'weaklist' is about to be built in 
PyImport_Cleanup(). But it is not the case of '_ag' and that explains at last 
why the destructor was called and failed:
'_ag' is a global of the types module which is owned (imported) by the inspect 
module, which is owned (imported) by the bdb module which is owned by 
PyThreadState through its c_profileobj member. So the types module, and all 
modules imported directly or indirectly by pdb, can only be cleared at the end 
of PyImport_Cleanup() when 'weaklist' is browsed for the last modules to clear. 
At that point any module may be non-functional and tracing must not be allowed.

The global_destructors.diff patch ensures that no access is made by the pdb and 
bdb modules (but imported modules have not been checked) to the the sys 
attributes that are set to None at the start of PyImport_Cleanup():
* Pdb.lookupmodule() accesses sys.path and is used to set breakpoints so we 
forbid setting breakpoint when sys.path is None.
* All the values of sys.modules are set to None when 'weaklist' is built. This 
causes the lazy imports to fail and the patch removes them except the lazy 
import of pydoc in pdb.py because pydoc imports threading and when threading 
has been imported wait_for_thread_shutdown() in Py_FinalizeEx() runs the 
threading._shutdown() Python code which is traced (this happens in Python 3.6 
too whenever threading is imported). Since it is annoying to systematically 
trace this function and pydoc is a heavy module, pdb.help() is disabled on 
Python finalization.

--
Added file: https://bugs.python.org/file47581/global_destructors.diff

___
Python tracker 

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



[issue28556] typing.py upgrades

2018-05-10 Thread Ivan Levkivskyi

Change by Ivan Levkivskyi :


--
pull_requests: +6446

___
Python tracker 

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



[issue28556] typing.py upgrades

2018-05-10 Thread Ivan Levkivskyi

Change by Ivan Levkivskyi :


--
pull_requests: +6445

___
Python tracker 

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



[issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS

2018-05-10 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I think it safer to silence this kind of warnings in 3.7 and 3.6. PR 6757 does 
this.

--

___
Python tracker 

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



[issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS

2018-05-10 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +6444

___
Python tracker 

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



[issue33413] asyncio.gather should not use special Future

2018-05-10 Thread Ned Deily

Change by Ned Deily :


--
components: +asyncio
nosy: +asvetlov, yselivanov

___
Python tracker 

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



[issue33413] asyncio.gather should not use special Future

2018-05-10 Thread Martin Teichmann

Martin Teichmann  added the comment:

I looked a bit into the details, and found that bpo-30048 created the described 
weird behavior. There they fixed the problem that a cancel is ignored if a 
coroutine manages to cancel its own task and return immediately. As shown in 
the discussion there, this is actually something happening in real code, and is 
a valid use case.

They fixed that by setting a CancelledError as an exception raised by the task, 
but did not cancel that task (they could have, I tested it, it would pass all 
tests).

But this is just a side show of the fact that we have now four different beasts 
that can be awaited, and behave differently: coroutines, Futures, Tasks, and 
_GatheringFutures. I think we should consolidate that.

--

___
Python tracker 

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



[issue33448] Output_Typo_Error

2018-05-10 Thread Mark Dickinson

Mark Dickinson  added the comment:

Marking as pending; we can't take this forward without more input from the OP. 
As far as I can tell, the documentation is perfectly correct here: I suspect 
that there was a misunderstanding somewhere along the line.

--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
resolution:  -> not a bug
status: open -> pending
type: resource usage -> 

___
Python tracker 

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



[issue33419] Add functools.partialclass

2018-05-10 Thread Nick Coghlan

Nick Coghlan  added the comment:

Marking as closed/later to indicate that we're not going to pursue this in the 
near term, but it's not out of the question that we might accept a future 
proposal along these lines.

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



[issue33457] python-config ldflags, PEP 513 and explicit linking to libpython in python extensions

2018-05-10 Thread dimi

New submission from dimi :

The python-config outputs ldflag for explicit linking to libpyhton, which is a 
good idea in many use cases. However, this is inconsistent with the PEP 513 
recommendation for building manylinux1 python extensions 
(https://www.python.org/dev/peps/pep-0513/) that requires avoiding explicit 
linking to libpythonX.Y.so.1.

--
components: Distutils
messages: 316368
nosy: dimi, dstufft, eric.araujo
priority: normal
severity: normal
status: open
title: python-config ldflags, PEP 513 and explicit linking to libpython in 
python extensions
type: behavior

___
Python tracker 

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



[issue33456] site.py: by default, a virtual environment is *not* isolated from the system-level site-packages directories

2018-05-10 Thread Lukas Waymann

Change by Lukas Waymann :


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

___
Python tracker 

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



[issue32962] test_gdb fails in debug build with `-mcet -fcf-protection -O0`

2018-05-10 Thread Marcel Plch

Change by Marcel Plch :


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

___
Python tracker 

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



[issue33455] test.test_posix.TestPosixSpawn::test_specify_environment fails with custom LD_LIBRARY_PATH

2018-05-10 Thread Miro Hrončok

Change by Miro Hrončok :


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

___
Python tracker 

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



[issue33456] site.py: by default, a virtual environment is *not* isolated from the system-level site-packages directories

2018-05-10 Thread Lukas Waymann

New submission from Lukas Waymann :

PEP 405 says this:

> By default, a virtual environment is entirely isolated from the system-level 
> site-packages directories.
>
> If the pyvenv.cfg file also contains a key include-system-site-packages with 
> a value of true (not case sensitive), the site module will also add the 
> system site directories to sys.path after the virtual environment site 
> directories.

The documentation of the site module 
(https://docs.python.org/3/library/site.html) says (emphasis added):

> If pyvenv.cfg […] contains the key include-system-site-packages set to 
> anything other than false (case-insensitive), the system-level prefixes will 
> still also be searched for site-packages; *otherwise they won’t*.

However, what actually happens in site.py is different: see 
.  The system_site 
variable is initialized to "true" and doesn't change unless the key 
include-system-site-packages exists in pyvenv.cfg.

I think system_site should be initialized to "false" and the condition in line 
468 should be `if system_site.lower() != "false"`.

--
components: Library (Lib)
messages: 316367
nosy: meribold
priority: normal
severity: normal
status: open
title: site.py: by default, a virtual environment is *not* isolated from the 
system-level site-packages directories
type: behavior
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue26701] Documentation for int constructor mentions __int__ but not __trunc__

2018-05-10 Thread miss-islington

miss-islington  added the comment:


New changeset 22df4187c3882c6ec67180902e1151e65b03aee0 by Miss Islington (bot) 
in branch '3.7':
bpo-26701: Tweak the documentation for special methods in int(). (GH-6741)
https://github.com/python/cpython/commit/22df4187c3882c6ec67180902e1151e65b03aee0


--

___
Python tracker 

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



[issue26701] Documentation for int constructor mentions __int__ but not __trunc__

2018-05-10 Thread miss-islington

miss-islington  added the comment:


New changeset 7488c79b600cd173b0ccea13adb567d078e7b835 by Miss Islington (bot) 
in branch '3.6':
bpo-26701: Tweak the documentation for special methods in int(). (GH-6741)
https://github.com/python/cpython/commit/7488c79b600cd173b0ccea13adb567d078e7b835


--

___
Python tracker 

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



[issue33449] Documentation for email.charset confusing about the location of constants

2018-05-10 Thread R. David Murray

R. David Murray  added the comment:

Can you provide an example of where this occurs in the docs?

--
nosy: +r.david.murray

___
Python tracker 

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



[issue33453] from __future__ import annotations breaks dataclasses ClassVar and InitVar handling

2018-05-10 Thread Rick Teachey

Rick Teachey  added the comment:

> Is there any scenario where the following code would be useful...

Perhaps if someone, in search of a speedup, were sort of rolling their own 
lighter-weight equivalent to the typing module (in order to avoid importing the 
full typing module), but duck typed enough to fool the average type checker? Is 
that possible?

--

___
Python tracker 

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



[issue33455] test.test_posix.TestPosixSpawn::test_specify_environment fails with custom LD_LIBRARY_PATH

2018-05-10 Thread Miro Hrončok

New submission from Miro Hrončok :

When we build Python in Fedora, we set LD_LIBRARY_PATH environment variable so 
the testsuite is run against the currently built Python.

However a test added in ef347535f289baad22c0601e12a36b2dcd155c3a 
(test_specify_environment) spawns a process without passing the environment 
variables. This means that the new process fails with 

error while loading shared libraries: libpython3.7m.so.1.0: cannot open 
shared object file: No such file or directory

And the test fails with:

test_specify_environment (test.test_posix.TestPosixSpawn) ... 
/builddir/build/BUILD/Python-3.7.0b4/build/optimized/python: error while 
loading shared libraries: libpython3.7m.so.1.0: cannot open shared object file: 
No such file or directory
test test_posix failed
FAIL
==
FAIL: test_specify_environment (test.test_posix.TestPosixSpawn)
--
Traceback (most recent call last):
  File "/builddir/build/BUILD/Python-3.7.0b4/Lib/test/test_posix.py", line 
1467, in test_specify_environment
self.assertEqual(os.waitpid(pid, 0), (pid, 0))
AssertionError: Tuples differ: (11457, 32512) != (11457, 0)
First differing element 1:
32512
0
- (11457, 32512)
? ^
+ (11457, 0)
? ^
--
Ran 101 tests in 0.608s
FAILED (failures=1, skipped=9)
1 test failed again:
test_posix
Total duration: 23 min 22 sec
Tests result: FAILURE

I believe that a fix for this is to copy os.environ, update it with {'foo': 
'bar'} and pass that copy. I'll check and send PR if it works.

--
components: Tests
messages: 316363
nosy: hroncok, serhiy.storchaka
priority: normal
severity: normal
status: open
title: test.test_posix.TestPosixSpawn::test_specify_environment fails with 
custom LD_LIBRARY_PATH
versions: Python 3.7, Python 3.8

___
Python tracker 

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



[issue26701] Documentation for int constructor mentions __int__ but not __trunc__

2018-05-10 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6439

___
Python tracker 

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



[issue26701] Documentation for int constructor mentions __int__ but not __trunc__

2018-05-10 Thread miss-islington

Change by miss-islington :


--
pull_requests: +6438

___
Python tracker 

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



[issue26701] Documentation for int constructor mentions __int__ but not __trunc__

2018-05-10 Thread Nick Coghlan

Nick Coghlan  added the comment:


New changeset df00f048250b9a07195b0e3b1c5c0161fdcc9db8 by Nick Coghlan (Serhiy 
Storchaka) in branch 'master':
bpo-26701: Tweak the documentation for special methods in int(). (GH-6741)
https://github.com/python/cpython/commit/df00f048250b9a07195b0e3b1c5c0161fdcc9db8


--

___
Python tracker 

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



[issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS

2018-05-10 Thread pmpp

Change by pmpp :


--
nosy: +pmpp

___
Python tracker 

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



[issue32216] Document PEP 557 Data Classes (dataclasses module)

2018-05-10 Thread Ned Deily

Ned Deily  added the comment:

We really need to get this done prior to 370rc1 coming up on 05-21.

--
priority: deferred blocker -> release blocker

___
Python tracker 

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



[issue33444] Memory leak/high usage on copy in different thread

2018-05-10 Thread whitespacer

whitespacer  added the comment:

pitrou, thanks for great diagnosing program! You are right that there is no 
memory leak. 

We have investigated this issue a little bit more - it looks real reason for 
large memory consuming in the end is not fragmentation, just glibc doesn't 
release all free memory.

So what happens in this example (according to 
http://man7.org/linux/man-pages/man3/mallopt.3.html):
1) More threads leads to creating of more arenas (e.g. to more sub-heaps). It 
can be tested with setting environment variable MALLOC_ARENA_MAX to 1 - memory 
consumption in example will be reduced significantly. But this can be used in 
real code, performance will degrade.  
2) Heap trim threshold (M_TRIM_THRESHOLD) is calculated dynamically. Creation 
and deletion of small arrays leads to 
M_MMAP_THRESHOLD=2*4*1024*1024*sizeof(long) on 64 bit systems. So each sub-heap 
in each arena can have up to 64 mb (if long is 8 bytes) of untrimmed space.
It can be tested with setting environment variable MALLOC_TRIM_THRESHOLD_ to 
128*1024 - memory consumption in example will be reduced significantly because 
dynamic calculation of trim threshold will be turned off. Again I doubt this 
can be used in real code.  
3) Maxiumum number of arenas vary on number of cpu's. On my system it looks 
like it is set to 16. So I get around 16*64 of untrimmed space.

To conclude:
There is similar bug in python tracker: https://bugs.python.org/issue11849. 
Message https://bugs.python.org/msg134992 states that nothing can be done in 
some cases (like in attached example).

One possible solution is to use jemalloc - we have tested that it doesn't have 
such problems. Limiting maximum number of arenas also helps, but can degrade 
performance.

--
nosy: +whitespacer

___
Python tracker 

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



[issue32942] Regression: test_script_helper fails

2018-05-10 Thread Ethan Smith

Ethan Smith  added the comment:

For reference this is happening with a clean checkout and build of master for 
me, which seems like it shouldn't be the case...

--
nosy: +Ethan Smith

___
Python tracker 

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



[issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS

2018-05-10 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

See also issue33454 about a real bug found thanks to these warnings.

--

___
Python tracker 

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



[issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS

2018-05-10 Thread Charalampos Stratakis

Charalampos Stratakis  added the comment:

Is it possible/feasible to fix that for the 3.7 and 3.6 branches as well?

--

___
Python tracker 

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



[issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS

2018-05-10 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

The following PRs fix warnings in casts to PyCFunction for method conventions 
different from METH_NOARGS, METH_O and
METH_VARARGS. PR 6748 does this for Argument Clinic generated code (all files 
except Tools/clinic/clinic.py are generated). PR 6749 does it for hand-written 
code. It also fixes few missed or new cases for METH_NOARGS.

--

___
Python tracker 

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



[issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS

2018-05-10 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +6437

___
Python tracker 

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



[issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS

2018-05-10 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +6436

___
Python tracker 

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



[issue33454] Mismatched C function signature in _xxsubinterpreters.channel_close()

2018-05-10 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue33454] Mismatched C function signature in _xxsubinterpreters.channel_close()

2018-05-10 Thread Serhiy Storchaka

New submission from Serhiy Storchaka :

The C function that implements _xxsubinterpreters.channel_close() is defined 
with the signature

PyObject *channel_close(PyObject *self, PyObject *args, PyObject *kwds)

which corresponds the method convention METH_VARARGS | METH_KEYWORDS, but is 
used with the incompatible method convention METH_VARARGS. Either the signature 
or flags are not correct.

Actually it can use just METH_O. The proposed PR changes both signature and 
flags and simplifies the implementation.

The bug was found thanks to gcc 8 emitting a warning for invalid function cast 
(it also emits a lot of false alarms). See also issue33012.

--
components: Extension Modules
messages: 316354
nosy: eric.snow, serhiy.storchaka, siddhesh
priority: normal
severity: normal
status: open
title: Mismatched C function signature in _xxsubinterpreters.channel_close()
type: behavior
versions: Python 3.7, Python 3.8

___
Python tracker 

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



[issue33450] unexpected EPROTOTYPE returned by sendto on MAC OSX

2018-05-10 Thread Ronald Oussoren

Ronald Oussoren  added the comment:

The second link contains an explanation of what's going on, and that this is 
unexpected behaviour of the macOS kernel.

I'm not sure what we could do about this, the blog post explains that this 
error can happen when send(2) is called while the socket is teared down. A 
possible workaround (based on reading the blog post and without fully analysing 
the side effects) is to treat EPROTOTYPE the same as EGAIN in the python 
wrappers for send/write/sendto. 

That's easier said than done though, socketmodule.c indirectly calls socket 
functions through a helper function that does some bookkeeping (including 
handling EGAIN) and is used for more than just the send calls.

--

___
Python tracker 

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



[issue20171] Derby #2: Convert 115 sites to Argument Clinic in Modules/_cursesmodule.c

2018-05-10 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset b00854caa080cec613496d3a5e1b0891c9ff83e6 by Serhiy Storchaka in 
branch 'master':
bpo-20171: Convert the _curses and _curses_panel modules to Argument Clinic. 
(GH-4251)
https://github.com/python/cpython/commit/b00854caa080cec613496d3a5e1b0891c9ff83e6


--

___
Python tracker 

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



[issue33453] from __future__ import annotations breaks dataclasses ClassVar and InitVar handling

2018-05-10 Thread Eric V. Smith

Eric V. Smith  added the comment:

I see that https://github.com/python/typing/issues/508 is also referenced in 
https://github.com/python-attrs/attrs/issues/361, where it contributed to attrs 
using string inspection.

--

___
Python tracker 

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



[issue33453] from __future__ import annotations breaks dataclasses ClassVar and InitVar handling

2018-05-10 Thread Eric V. Smith

Eric V. Smith  added the comment:

See also [2]_ for a brief discussion of forward references, which makes 
get_type_hints() undesirable in this case.

> This is why attrs went with the fast way which covers most (but not all) 
> bases in this case. If the annotation is a string, just check if it starts 
> with "typing.ClassVar", "t.ClassVar", or just "ClassVar". That's a fast check 
> and doesn't ever require importing typing.  On the flip side, the 0.001% of 
> users [1]_ who import ClassVar differently, will not have their class 
> variables recognized.

I'm okay with the fast check for the string "ClassVar". My only concern is how 
the user would figure out what's going on, if for example they "import typing 
as T". The generated __init__ wouldn't have the params they expect, but with 
default values thrown in I'm not so sure how quickly they'd notice. Hopefully 
they'd figure out soon enough there's a problem, but I'm not sure they'd know 
the cause if it.

Maybe we could do some additional checking if typing has been imported? If we 
see "T.ClassVar" ("[identifier].ClassVar" appears at the beginning of the 
string) then if typing has been imported, further check that "T is typing"? 
Although this isn't going to help with "from typing import ClassVar as CV" (but 
only 0.4% of users would do that [3]_) and I don't want to use regex's for 
this. str.partition() is likely good enough, if we decide to go this route.

Is there any scenario where the following code would be useful, or expected to 
work, if "import typing as T" hadn't been executed before @dataclass runs? 
After all, if we do decide to call get_type_hints() it wouldn't work without it.

  field: "T.ClassVar[SomeTypeReferencedLater]" = get_some_type_object()

But again, unless [2]_ is addressed, get_type_hints() will fail unless both T 
and SomeTypeReferencedLater are known when @dataclass runs, if we used 
get_type_hints().

So, I guess this is my roundabout way of saying we should do the best we can 
with string inspection, and not use get_type_hints(). Maybe we can discuss it 
with Guido at the sprints.

For all of this, I'm assuming we'll do something similar with InitVar. Although 
we obviously know it's been imported, it doesn't solve all of the other issues 
with get_type_hints.

[2] .. https://github.com/python/typing/issues/508

[3] .. Also a made up number.

--
priority: normal -> release blocker

___
Python tracker 

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



[issue32375] Compilation warnings in getpath.c with gcc on Ubuntu / -D_FORTIFY_SOURCE=2

2018-05-10 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Warnings are emitted when compile with gcc-5, gcc-6 and gcc-7, but not when 
compile with gcc-4.8 or gcc-8.

Versions:

gcc-4.8 (Ubuntu 4.8.5-4ubuntu8) 4.8.5
gcc-5 (Ubuntu 5.5.0-12ubuntu1) 5.5.0 20171010
gcc-6 (Ubuntu 6.4.0-17ubuntu1) 6.4.0 20180424
gcc-7 (Ubuntu 7.3.0-16ubuntu3) 7.3.0
gcc-8 (Ubuntu 8-20180414-1ubuntu2) 8.0.1 20180414 (experimental) [trunk 
revision 259383]

--

___
Python tracker 

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



[issue33015] Fix function cast warning in thread_pthread.h

2018-05-10 Thread Siddhesh Poyarekar

Siddhesh Poyarekar  added the comment:

gcc8.1 throws this warning irrespective of the cast since converting function 
pointers may result in undefined behaviour unless it is cast back to its 
original type.

--

___
Python tracker 

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