[issue34137] Add Path.lexist() to pathlib

2018-07-17 Thread e-kayrakli


e-kayrakli  added the comment:

I haven't contributed to Python yet and I can contribute this as a way for me 
to practice the PR process in Python.

As this is a small addition, should I create a PR right away, or wait for a 
consensus here?

--
nosy: +e-kayrakli

___
Python tracker 

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



[issue25150] 3.5: Include/pyatomic.h is incompatible with OpenMP (compilation of the third-party yt module fails on Python 3.5)

2018-07-17 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

I think this should be reconsidered.  I understand the desire to compile Python 
with OpenMP.  But the resolution here is hiding _Py_atomic symbols all the 
time, even when OpenMP isn't involved, and even when building a standard 
extension module.

--
nosy: +pitrou

___
Python tracker 

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



[issue25150] 3.5: Include/pyatomic.h is incompatible with OpenMP (compilation of the third-party yt module fails on Python 3.5)

2018-07-17 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

(see issue34128 for context)

--

___
Python tracker 

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



[issue34136] Del on class __annotations__ regressed, failing test

2018-07-17 Thread Guido van Rossum


Guido van Rossum  added the comment:

Serhiy, what question do you want us to answer?

On Tue, Jul 17, 2018 at 5:22 AM Serhiy Storchaka 
wrote:

>
> Change by Serhiy Storchaka :
>
>
> --
> nosy: +Mark.Shannon, gvanrossum, levkivskyi
>
> ___
> Python tracker 
> 
> ___
>
-- 
--Guido (mobile)

--

___
Python tracker 

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



[issue34128] Release GIL periodically in _pickle module

2018-07-17 Thread ppperry


Change by ppperry :


--
components: +Library (Lib)
title: Do not block threads when pickle/unpickle -> Release GIL periodically in 
_pickle module

___
Python tracker 

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



[issue34128] Release GIL periodically in _pickle module

2018-07-17 Thread Martin Bammer


Martin Bammer  added the comment:

Maybe an optional parameter with the desired interval would be good idea. So 
that the coder can decide if he wants/needs that feature and which interval he 
needs for his application.
Otherwise it is hard to define a specific interval which fits for everyone.

--

___
Python tracker 

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



[issue33123] Path.unlink should have a missing_ok parameter

2018-07-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It can be written as

try:
path.inlink()
except FileNotFoundError:
pass

If you want to save few lines of code, you can use contextlib.suppress().

with suppress(FileNotFoundError): path.inlink()

I suggest to close this issue. It is better to keep the API simple and 
orthogonal. Adding an option in Path.unlink() will require adding this support 
of this option in third-part implementations of Path. In general, adding a 
single boolean parameter is not considered a good practice in Python.

A "strict" parameter in Path.resolve() does the different thing. In both cases 
Path.resolve() returns a value, and you can't implement strict=False by 
catching exception externally.

--
nosy: +pitrou, serhiy.storchaka

___
Python tracker 

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



[issue34136] Del on class __annotations__ regressed, failing test

2018-07-17 Thread Guido van Rossum


Guido van Rossum  added the comment:

The test fails on CPython master, so shouldn't it be removed? Don't we have a 
policy that all tests must pass on master?

This is what I see:

cpython38$ ./python.exe Lib/test/test_opcodes.py 
./python.exe Lib/test/test_opcodes.py 
.F..
==
FAIL: test_do_not_recreate_annotations (__main__.OpcodeTest)
--
Traceback (most recent call last):
  File "Lib/test/test_opcodes.py", line 45, in test_do_not_recreate_annotations
class C:
  File "Lib/test/test_opcodes.py", line 48, in C
x: int
AssertionError: NameError not raised

--
Ran 8 tests in 0.003s

FAILED (failures=1)
cpython38$

--

___
Python tracker 

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



[issue34128] Release GIL periodically in _pickle module

2018-07-17 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

Attaching demonstration script.

--
Added file: https://bugs.python.org/file47701/pickle_gil.py

___
Python tracker 

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



[issue34128] Release GIL periodically in _pickle module

2018-07-17 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

Attaching proof-of-concept patch.

--
keywords: +patch
Added file: https://bugs.python.org/file47700/pickle_gil.patch

___
Python tracker 

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



[issue34134] multiprocessing memory huge usage

2018-07-17 Thread Xiang Zhang


Xiang Zhang  added the comment:

One thing worth a try here maybe turn `len` to `operator.length_hint`. But I am 
not sure it's a good idea and just a mention here.

--
nosy: +xiang.zhang
versions:  -Python 2.7, 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



[issue34134] multiprocessing memory huge usage

2018-07-17 Thread Windson Yang


Windson Yang  added the comment:

Thank you Xiang Zhang, I found the code keeps hanging when I use imap, I will 
try to figure out tomorrow.

--

___
Python tracker 

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



[issue34136] Del on class __annotations__ regressed, failing test

2018-07-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Sorry. I thought the discussion issue32550 shows that this CPython behavior 
change was intended, but it is not a part of Python language, and alternate 
implementations can have different behavior. But I expected that someone of 
participants with better English can confirm this more clearly, and may be even 
suggest what to do with Nuitka's tests. (I think that Nuitka can do what is 
simpler for it.) I am wondering if it is worth to document this behavior change 
explicitly in the "What's New in 3.8" document.

--

___
Python tracker 

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



[issue34068] traceback.clear_frames(): Objects/typeobject.c:3086: _PyType_Lookup: Assertion `!PyErr_Occurred()' failed.

2018-07-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

> The assertion failure is a little bit "far" from the bug: would it make sense 
> to add "assert(!PyErr_Occurred());" to the entry point of:

This looks like a part of larger issue, and I think it deserves a separate 
issue on the tracker.

See also issue26776.

--
stage: patch review -> resolved

___
Python tracker 

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



[issue34128] Release GIL periodically in _pickle module

2018-07-17 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

The right way to do this is not to pass a timeout parameter but to check for 
GIL interrupts as done in the main bytecode evaluation loop.

--

___
Python tracker 

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



[issue34136] Del on class __annotations__ regressed, failing test

2018-07-17 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +Mark.Shannon, gvanrossum, levkivskyi

___
Python tracker 

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



[issue34128] Release GIL periodically in _pickle module

2018-07-17 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

(as the demo script shows, there is no detectable slowdown)

--

___
Python tracker 

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



[issue34136] Del on class __annotations__ regressed, failing test

2018-07-17 Thread Kay Hayen


Kay Hayen  added the comment:

Thanks for pointing out, where it comes from, Serhiy.

So, should the test case be removed then. I still am not so sure about
the bug nature.

Because using the standard mechanism will do this:

x : int

class C:
del __annotations__
x : float
y : int

print(__annotations__)

This will give float for x, and int for y, both of which are wrong for the 
module.

I do agree that "del" on "__annotations__" might not have a use case, or does 
it? I think
it's optimized away if not used for classes anyway, isn't it?

Maybe you want make "del" on __annotations__ a syntax error then?

Yours,
Kay

--

___
Python tracker 

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



[issue34128] Release GIL periodically in _pickle module

2018-07-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The demo script shows around 8% slowdown to me for

data = list(map(float, range(N)))

--

___
Python tracker 

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



[issue34068] traceback.clear_frames(): Objects/typeobject.c:3086: _PyType_Lookup: Assertion `!PyErr_Occurred()' failed.

2018-07-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset fc153d127901361d7fe5f60caa6f41d2b8db0eb0 by Serhiy Storchaka in 
branch '2.7':
[2.7] bpo-34068: iobase_close could call PyObject_SetAttrString with an 
exception set (GH-8282). (GH-8312) (GH-8314)
https://github.com/python/cpython/commit/fc153d127901361d7fe5f60caa6f41d2b8db0eb0


--

___
Python tracker 

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



[issue34138] RFC 6855 issue

2018-07-17 Thread Sam Varshavchik


New submission from Sam Varshavchik :

Greetings. I am in the process of implementing RFC 6855 in Courier-IMAP. A 
Google search for IMAP clients that implement RFC 6855 led me to 
https://bugs.python.org/issue21800 and looking over the code that was added to 
imaplib, to support RFC 6855, a few things stood out. I checked, and the 
changes introduces in 21800 still appear to be unchanged in 
https://github.com/python/cpython/blob/master/Lib/imaplib.py 

Issue 21800 modified sub append(), that implements the IMAP APPEND command, 
thusly:

-self.literal = MapCRLF.sub(CRLF, message)
+literal = MapCRLF.sub(CRLF, message)
+if self.utf8_enabled:
+literal = b'UTF8 (' + literal + b')'
+self.literal = literal

"literal" here appears to be the contents of the message with CRLF line ending. 
But section 4 of https://tools.ietf.org/html/rfc6855.html states:

  The ABNF for the "APPEND" data extension and "CATENATE" extension 
  follows:

utf8-literal   = "UTF8" SP "(" literal8 ")"

literal8   = 

append-data=/ utf8-literal

cat-part   =/ utf8-literal

As indicated above, "literal8" comes from RFC 4466, which also defines 
"append-data". RFC 4466 additionally states:

   In addition, the non-terminal "literal8" defined in [BINARY] got
   extended to allow for non-synchronizing literals if both [BINARY] and
   [LITERAL+] extensions are supported by the server.

I'll come back to this revealing paragraph in a moment, but, as stated, 
"literal8" actually comes from [BINARY] which is RFC 3516, which specifies the 
following:

   append =/  "APPEND" SP mailbox [SP flag-list]
  [SP date-time] SP literal8

   fetch-att  =/  "BINARY" [".PEEK"] section-binary [partial]
  / "BINARY.SIZE" section-binary

   literal8   =   "~{" number "}" CRLF *OCTET
  ;  represents the number of OCTETs
  ; in the response string.

An exhaustive search of imaplib.py seems to indicate that this pesky tilde is 
in hiding. And the wrong thing seems to be quoted as the actual literal. 
Anyway, back to the RFCs: combine all of the above together, spin it in a 
blender, and you get the following result:

Supposing that the message being appended consists of a single header line 
"Subject: test", and a blank line, a sample command of what actually goes out 
the wire (based on the above, and other parts of these, and related RFCs):

APPEND INBOX NIL NIL UTF8 (~{17}Subject: test)

I haven't tested imaplib against Courier-IMAP in this respect, but it doesn't 
seem like this is going to be results.

But wait, there's more!

"literal8" is a synchronizing literal, like "literal" from RFC 3501, which 
specifies:

  ...In the case of
   literals transmitted from client to server, the client MUST wait
   to receive a command continuation request (described later in
   this document) before sending the octet data (and the remainder
   of the command).

The LITERAL+ IMAP extension, that was mentioned in the excerpt from RFC 4466 
that I cited above, introduced non-synchronizing literals:

   The protocol receiver of an IMAP4 server must check the end of every
   received line for an open brace ('{') followed by an octet count, a
   plus ('+'), and a close brace ('}') immediately preceeding the CRLF.
   If it finds this sequence, it is the octet count of a non-
   synchronizing literal and the server MUST treat the specified number
   of following octets and the following line as part of the same
   command.

Otherwise, after the closing brace and the  the IMAP client must wait 
for the continuation response from the server.

So, to summarize:

1) RFC 4466, combined with RFC 6855 an IMAP UTF-8 client talking to an IMAP 
UTF-8 server can send the following, on the wire, if the server supports 
LITERAL+:

APPEND INBOX NIL NIL UTF8 (~{17+}Subject: test)

2) But, if the server did not advertise LITERAL+, the IMAP client is required 
to send only:

APPEND INBOX NIL NIL UTF8 (~{17}

Then wait for the continuation response from the server, then send the rest of 
the command.

IMAP specifications have been painful to read, for the 20+ years I've been 
reading them. Historically there's been a lot of interoperability problems 
between IMAP clients and servers. I lay the blame squarely on the horrible 
specs, but that's off-topic. Suffice to say, nothing of that sort has been 
observed for POP3 and SMTP, and I think there's a very good reason for that.

--
components: email
messages: 321819
nosy: Sam Varshavchik, barry, r.david.murray
priority: normal
severity: normal
status: open
title: RFC 6855 issue
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list

[issue34139] Remove stale unix datagram socket before binding

2018-07-17 Thread Quentin Dawans


New submission from Quentin Dawans :

Like 
https://github.com/python/asyncio/commit/806cc68d762acc30490cf5583569e41441c25c35
 but for unix datagram socket.

I'm looking into making a PR

--
components: asyncio
messages: 321829
nosy: asvetlov, qdawans, yselivanov
priority: normal
severity: normal
status: open
title: Remove stale unix datagram socket before binding

___
Python tracker 

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



[issue34140] Possible multiprocessing deadlock when placing too many objects in Queue()

2018-07-17 Thread Horace Stoica


New submission from Horace Stoica :

I am trying to use the  multiprocessing module for a simulation on a spherical 
lattice, but the process hangs when the lattice is too large. 

In the file IssuesWithQueueMultiProcessing.py, the method createLattice(), use 
either "return(I4)" for the small lattice or "return(I5)" for the large 
lattice. 

Running the script when using the large lattice causes the process to hang 
while for the small lattice it works fine. I have tested with Python 3.5.2 and 
3.6.1 and the behavior is the same in both versions.

--
files: IssuesWithQueueMultiProcessing.tar.bz
messages: 321832
nosy: fhstoica
priority: normal
severity: normal
status: open
title: Possible multiprocessing deadlock when placing too many objects in 
Queue()
type: performance
versions: Python 3.5, Python 3.6
Added file: 
https://bugs.python.org/file47702/IssuesWithQueueMultiProcessing.tar.bz

___
Python tracker 

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



[issue34133] ValueError should not be documented as being restricted to only "a built-in operation or function"

2018-07-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7850

___
Python tracker 

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



[issue34133] ValueError should not be documented as being restricted to only "a built-in operation or function"

2018-07-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7852

___
Python tracker 

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



[issue34133] ValueError should not be documented as being restricted to only "a built-in operation or function"

2018-07-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7851

___
Python tracker 

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



[issue34140] Possible multiprocessing deadlock when placing too many objects in Queue()

2018-07-17 Thread Xiang Zhang


Change by Xiang Zhang :


--
nosy: +davin, pitrou, xiang.zhang

___
Python tracker 

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



[issue34088] [EASY] sndhdr.what() throws exceptions on unknown files

2018-07-17 Thread Ammar Askar


Ammar Askar  added the comment:

Hey David, thanks for your contribution, I've added some feedback in context of 
the code on Github.

--

___
Python tracker 

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



[issue34140] Possible multiprocessing deadlock when placing too many objects in Queue()

2018-07-17 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

Closing as not a bug.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type: performance -> behavior

___
Python tracker 

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



[issue34141] Speed up pickling simple non-recusive values

2018-07-17 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue34140] Possible multiprocessing deadlock when placing too many objects in Queue()

2018-07-17 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

The problem is you're joining the child processes before draining the queue in 
the parent.

Generally, instead of building your own kind of synchronization like this, I 
would recommend you use the higher-level abstractions provided by 
multiprocessing.Pool or concurrent.futures.ProcessPoolExecutor.

By the way, this issue is mentioned precisely in the documentation:

"""
As mentioned above, if a child process has put items on a queue (and it has not 
used JoinableQueue.cancel_join_thread), then that process will not terminate 
until all buffered items have been flushed to the pipe.

This means that if you try joining that process you may get a deadlock unless 
you are sure that all items which have been put on the queue have been 
consumed. Similarly, if the child process is non-daemonic then the parent 
process may hang on exit when it tries to join all its non-daemonic children.
"""

(from https://docs.python.org/3/library/multiprocessing.html#pipes-and-queues)

--

___
Python tracker 

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



[issue34128] Release GIL periodically in _pickle module

2018-07-17 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

Interesting, which kind of computer / system / compiler are you on?

--

___
Python tracker 

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



[issue34088] [EASY] sndhdr.what() throws exceptions on unknown files

2018-07-17 Thread david awad


Change by david awad :


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

___
Python tracker 

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



[issue34128] Release GIL periodically in _pickle module

2018-07-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

CPU = Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
Ubuntu 18.04
Linux 4.15.0 x86_64
gcc 7.3.0

Performing the check in save() can have not insignificant overhead (especially 
after implementing the issue34141 optimization). It can be reduced if perform 
it when flush a frame (in protocol 4) or buffer to the file, or after writing 
significant amount of bytes into buffer.

--

___
Python tracker 

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



[issue34141] Speed up pickling simple non-recusive values

2018-07-17 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

The proposed PR reduces an overhead of calling Py_EnterRecursiveCall() when 
pickle simple non-recusive values: None, True, False, instances of int, float, 
bytes, str.

$ ./python -m timeit -s 'data = list(range(10**7)); import pickle' -- 
'pickle.dumps(data)'

Unpatched:  218 msec per loop
Patched:147 msec per loop

$ ./python -m timeit -s 'data = list(map(float, range(10**7))); import pickle' 
-- 'pickle.dumps(data)'

Unpatched:  218 msec per loop
Patched:179 msec per loop

$ ./python -m timeit -s 'data = list(map(str, range(10**6))); import pickle' -- 
'pickle.dumps(data)'

Unpatched:  212 msec per loop
Patched:201 msec per loop

--
components: Library (Lib)
messages: 321841
nosy: alexandre.vassalotti, pitrou, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Speed up pickling simple non-recusive values
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



[issue33111] Merely importing tkinter breaks parallel code (multiprocessing, sharedmem)

2018-07-17 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Ronald Oussoren> I can provide a patch, but that will likely be during 
EuroPython as I’m currently taking a roundabout route towards Edinburgh.

Can you add a test of the procedure you document for using _tkinter with 
multiprocessing?

--

___
Python tracker 

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



[issue34133] ValueError documented as being restricted to only "a built-in operation or function"

2018-07-17 Thread Brett Cannon


Brett Cannon  added the comment:

Just an FYI, Nathaniel, your title and message are bit "pushy". I've gone ahead 
and tweaked the title.

--
nosy: +brett.cannon
title: ValueError should not be documented as being restricted to only "a 
built-in operation or function" -> ValueError documented as being restricted to 
only "a built-in operation or function"

___
Python tracker 

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



[issue34128] Release GIL periodically in _pickle module

2018-07-17 Thread ppperry


Change by ppperry :


--
nosy:  -ppperry

___
Python tracker 

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



[issue34088] [EASY] sndhdr.what() throws exceptions on unknown files

2018-07-17 Thread david awad


david awad  added the comment:

Hey, I saw the issue and spent some time piecing together a PR for it. I've 
never contributed to Python before but this seemed like a good place to start!  

I posted these questions on the PR but I'll echo them here as well.

- Should we only handle the specific exceptions that are created in these two 
examples? or is there a cleaner, more pythonic way to handle it?

- It doesn't appear that test_sndhdr.py does any testing of bad inputs. Can I 
add test cases to the test_sndhdr.py file?

Thanks! I'm here to learn so if there's anything I missed please feel free to 
let me know.

--
nosy: +davidawad

___
Python tracker 

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



[issue34133] ValueError documented as being restricted to only "a built-in operation or function"

2018-07-17 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Nathaniel, thanks for the bug report. I've fixed the docs.

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



[issue34133] ValueError documented as being restricted to only "a built-in operation or function"

2018-07-17 Thread Nathaniel Manista


Nathaniel Manista  added the comment:

Thank you both!

--

___
Python tracker 

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



[issue34022] 6 tests fail using SOURCE_DATE_EPOCH env var

2018-07-17 Thread Alexander Mohr


Alexander Mohr  added the comment:

we're compiling similar to debian and getting the same issues now only with 3.7 
so interested in what the resolution is.  I tried both w/ and w/o setting 
SOURCE_DATE_EPOCH and still get failures.

--
nosy: +thehesiod

___
Python tracker 

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



[issue33695] Have shutil.copytree(), copy() and copystat() use cached scandir() stat()s

2018-07-17 Thread Giampaolo Rodola'


Giampaolo Rodola'  added the comment:

Unless somebody has complaints I think I'm gonna merge this soon.

--

___
Python tracker 

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



[issue34132] Obscure netrc parser "bug"

2018-07-17 Thread bbayles


Change by bbayles :


--
keywords: +patch
pull_requests: +7856
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



[issue34142] Windows launcher version lookup flawed

2018-07-17 Thread LarryZA


New submission from LarryZA :

In the manual it says that the following .ini file will cause the launcher to 
run Python3.1 for calls of `py` or `py -3`

[defaults]
python=3
python3=3.1

On my Windows 7 machine I have Python2.7-32, Python3.4-64, and Python3.7-64 
(installed in that order).

Setting the ini to:

[defaults]
python=3
python3=3.4

results in `py` running 3.7-64 (expected 3.4-64) and `py -3` running 3.4-64.

Setting both to point to 3.4 in the ini will run 3.4-64 for both commands.

--
components: Windows
messages: 321855
nosy: LarryZA, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Windows launcher version lookup flawed
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



[issue34134] multiprocessing memory huge usage

2018-07-17 Thread Windson Yang


Windson Yang  added the comment:

The code didn't work with imap because imap create a generator, so we can't 
access result outside the with statement.

with Pool(os.cpu_count()) as p:
result = p.imap(clean_up, k, 50)
for r in result:
print(r)

In 
https://docs.python.org/3.4/library/multiprocessing.html?highlight=process#using-a-pool-of-workers
 I found the correct example. I'm not sure should me add example or warning in 
imap function.

--

___
Python tracker 

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



[issue34142] Windows launcher version lookup flawed

2018-07-17 Thread Steve Dower


Steve Dower  added the comment:

The behavior is correct, so the documentation needs fixing.

Which page has that example on it? Is it assuming that you only have 3.1 
installed?

--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python

___
Python tracker 

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



[issue34142] Windows launcher version lookup flawed

2018-07-17 Thread LarryZA


LarryZA  added the comment:

https://docs.python.org/3/using/windows.html

Section 3.4.4.2

--

___
Python tracker 

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



[issue34134] multiprocessing memory huge usage

2018-07-17 Thread Xiang Zhang


Xiang Zhang  added the comment:

Why accessing the result outside of with block? The pool is terminated while 
exiting the block before the work is done.

--

___
Python tracker 

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



[issue24618] Invalid read in PyCode_New

2018-07-17 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.6, Python 3.7, Python 3.8 -Python 3.4

___
Python tracker 

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



[issue33111] Merely importing tkinter breaks parallel code (multiprocessing, sharedmem)

2018-07-17 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

It will definitely break *some* user code. Also, everyone not using tkinter 
(which I think is the majority of users) isn't affected by this.

--

___
Python tracker 

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



[issue34128] Do not block threads when pickle/unpickle

2018-07-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

A workaround is writing Python wrappers for IO:

def Writer:
def __init__(self, file):
self.file = file
def write(self, data):
return self.file.write(data)

def Reader:
def __init__(self, file):
self.file = file
def read(self, size=-1):
return self.file.read(size)
def readline(self, size=-1):
return self.file.readline(size)
def peek(self, size=-1):
return self.file.peek(size)

def mydump(obj, file, *args, **kwargs):
return pickle.dump(obj, Writer(file), *args, **kwargs)

def myload(file, *args, **kwargs):
return pickle.load(Reader(file), *args, **kwargs)

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue34136] Del on class __annotations__ regressed, failing test

2018-07-17 Thread Kay Hayen


New submission from Kay Hayen :

I am getting this:

PYTHONPATH=`pwd` /c/Python37_32/python test/test_opcodes.py
.F..
==
FAIL: test_do_not_recreate_annotations (__main__.OpcodeTest)
--
Traceback (most recent call last):
  File "test/test_opcodes.py", line 45, in test_do_not_recreate_annotations
class C:
  File "test/test_opcodes.py", line 48, in C
x: int
AssertionError: NameError not raised

I have seen this on Linux as well. I first notices that as a regression of 
Nuitka in the CPython36 test suite. It actually took me a while to implement 
support for "del __annotations__" to make later references not fall back to the 
module "__annotation__", for 3.6 compatibility. 

However, now with 3.7 behavior is back to what 3.5 I think would have done, 
while the test is not updated to match.

I am confused now, which is the intended way for this to work? Should I follow 
this change, or will it be fixed, or am I doing something wrong in running 
something wrong here?

Yours,
Kay

--
components: Interpreter Core
messages: 321807
nosy: kayhayen
priority: normal
severity: normal
status: open
title: Del on class __annotations__ regressed, failing test
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



[issue34136] Del on class __annotations__ regressed, failing test

2018-07-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

See issue32550.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue34135] The results of time.tzname print broken.

2018-07-17 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

There is some discussion about this at 
https://bugs.python.org/issue16322#msg251068 and seems the issue is a related 
one.

Thanks

--
nosy: +xtreak

___
Python tracker 

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



[issue34132] Obscure netrc parser "bug"

2018-07-17 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



[issue34068] traceback.clear_frames(): Objects/typeobject.c:3086: _PyType_Lookup: Assertion `!PyErr_Occurred()' failed.

2018-07-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 28f07364f066792ceee93231dbb80ae8ad98b2bb by Serhiy Storchaka 
(Zackery Spytz) in branch 'master':
bpo-34068: _io__IOBase_close_impl could call _PyObject_SetAttrId with an 
exception set (GH-8282)
https://github.com/python/cpython/commit/28f07364f066792ceee93231dbb80ae8ad98b2bb


--

___
Python tracker 

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



[issue24618] Invalid read in PyCode_New

2018-07-17 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +7846

___
Python tracker 

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



[issue34134] multiprocessing memory huge usage

2018-07-17 Thread Windson Yang


Windson Yang  added the comment:

Thank you for the hint, INADA. I think we should add something like "if you are 
using generator, consider use imap instead" in 
https://docs.python.org/3.4/library/multiprocessing.html?highlight=process#multiprocessing.pool.Pool.map

--

___
Python tracker 

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



[issue34133] ValueError should not be documented as being restricted to only "a built-in operation or function"

2018-07-17 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee: docs@python -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue34133] ValueError should not be documented as being restricted to only "a built-in operation or function"

2018-07-17 Thread Raymond Hettinger


Change by Raymond Hettinger :


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

___
Python tracker 

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



[issue24618] Invalid read in PyCode_New

2018-07-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset cf30d5c5b88276a9af863438839ba386b9723a14 by Serhiy Storchaka in 
branch '3.6':
bpo-24618: Add a check in the code constructor. (GH-8283) (GH-8311)
https://github.com/python/cpython/commit/cf30d5c5b88276a9af863438839ba386b9723a14


--

___
Python tracker 

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



[issue34068] traceback.clear_frames(): Objects/typeobject.c:3086: _PyType_Lookup: Assertion `!PyErr_Occurred()' failed.

2018-07-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset cc13016658a9ed86d0b702ab6c251ad5952a952f by Serhiy Storchaka in 
branch '3.6':
bpo-34068: _io__IOBase_close_impl could call _PyObject_SetAttrId with an 
exception set (GH-8282). (GH-8312)
https://github.com/python/cpython/commit/cc13016658a9ed86d0b702ab6c251ad5952a952f


--

___
Python tracker 

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



[issue34068] traceback.clear_frames(): Objects/typeobject.c:3086: _PyType_Lookup: Assertion `!PyErr_Occurred()' failed.

2018-07-17 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue33111] Merely importing tkinter breaks parallel code (multiprocessing, sharedmem)

2018-07-17 Thread Ronald Oussoren

Ronald Oussoren  added the comment:

I can provide a patch, but that will likely be during EuroPython as I’m 
currently taking a roundabout route towards Edinburgh. 

Btw. I’m not sure yet how impactful changing the default spawning mechanism 
would be for 3.8.  How likely is that to break user code?   

Op 16 jul. 2018 om 10:24 heeft Antoine Pitrou  het 
volgende geschreven:

> 
> Antoine Pitrou  added the comment:
> 
> macOS users, feel free to propose a doc PR for multiprocessing.
> 
> --
> assignee:  -> docs@python
> components: +Documentation
> nosy: +docs@python
> versions: +Python 3.7, Python 3.8 -Python 3.5
> 
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue34068] traceback.clear_frames(): Objects/typeobject.c:3086: _PyType_Lookup: Assertion `!PyErr_Occurred()' failed.

2018-07-17 Thread miss-islington


miss-islington  added the comment:


New changeset 6020d98beaf6b9945beb7560f9a1df361e0ba4dd by Miss Islington (bot) 
in branch '3.7':
bpo-34068: _io__IOBase_close_impl could call _PyObject_SetAttrId with an 
exception set (GH-8282)
https://github.com/python/cpython/commit/6020d98beaf6b9945beb7560f9a1df361e0ba4dd


--
nosy: +miss-islington

___
Python tracker 

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



[issue33967] functools.singledispatch: Misleading exception when calling without arguments

2018-07-17 Thread INADA Naoki


Change by INADA Naoki :


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



[issue34068] traceback.clear_frames(): Objects/typeobject.c:3086: _PyType_Lookup: Assertion `!PyErr_Occurred()' failed.

2018-07-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7845

___
Python tracker 

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



[issue34068] traceback.clear_frames(): Objects/typeobject.c:3086: _PyType_Lookup: Assertion `!PyErr_Occurred()' failed.

2018-07-17 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +7847

___
Python tracker 

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



[issue34134] multiprocessing memory huge usage

2018-07-17 Thread INADA Naoki


INADA Naoki  added the comment:

> I think we should add something like "if you are using generator, consider 
> use imap instead" 

I think it's not good hint.
There are short generator.  And there are long (or infinite) iterator other 
than generator too.
Maybe, "if iterator is not sequence (e.g. generator) and can be very big, 
consider using `imap` or `imap_unorderd` with explicit `chunksize` option for 
better efficiency."

But I'm not good at writing English.
Someone other than me can write better paragraph.

--

___
Python tracker 

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



[issue34118] Fix some class entries in 'Built-in Functions'

2018-07-17 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> How about a note under the index table:

> Functions that must be classes are tagged *class*.
<  The iterator functions enumerate, filter, map, reversed, and zip 
> are classes in CPython, but they are not tagged because they 
> could be implemented as generator functions.

This doesn't seem like it adds any value at all and I don't see what problem is 
being solved.  Adding a cryptic note at the top doesn't make the docs any more 
readable.  I recommend leaving the iterator factories as-is.  AFAICT, the 
current docs are not a source of confusion and the text descriptions suffice to 
explain what is being done.

--

___
Python tracker 

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



[issue34134] multiprocessing memory huge usage

2018-07-17 Thread Windson Yang


Windson Yang  added the comment:

Thank you, I will try to make a pull request and let other to edit it.

--

___
Python tracker 

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



[issue34128] Do not block threads when pickle/unpickle

2018-07-17 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

This is about releasing the GIL periodically to allow other threads to run, as 
Python already does in its main interpreter loop.

--
nosy: +pitrou
versions: +Python 3.8 -Python 3.6

___
Python tracker 

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



[issue34068] traceback.clear_frames(): Objects/typeobject.c:3086: _PyType_Lookup: Assertion `!PyErr_Occurred()' failed.

2018-07-17 Thread STINNER Victor


STINNER Victor  added the comment:

> The assertion failure is a little bit "far" from the bug: would it make sense 
> to add "assert(!PyErr_Occurred());" to the entry point of:

Stefan, Serhiy: any opinion on my idea?

For example, PyObject_HasAttr() can replace and clear the current exception *by 
design*. This function does more or less:

try: obj.attr; return True
except AttributeError: return False

int
PyObject_HasAttr(PyObject *v, PyObject *name)
{
PyObject *res;
if (_PyObject_LookupAttr(v, name, ) < 0) {
PyErr_Clear();
return 0;
}
if (res == NULL) {
return 0;
}
Py_DECREF(res);
return 1;
}

--

___
Python tracker 

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



[issue31342] test.bisect module causes tests to fail

2018-07-17 Thread STINNER Victor


STINNER Victor  added the comment:

> I considered adding a 'bisect' command to the test/__main__, e.g. you could 
> run 'python -m test --bisect ..'.  That looks not entirely simple to 
> implement though.

Ah yes, for the long term, integrating test.bisect directly in libregrtest 
would be great, but I don't see how to modify the existing libregrtest CLI. 
test.bisect comes with its set of options like -i, -o, -n. Maybe it's fine to 
have a separated tool and file.

--

___
Python tracker 

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



[issue34130] test_signal: test_warn_on_full_buffer() failed on AppVeyor

2018-07-17 Thread STINNER Victor


STINNER Victor  added the comment:

I succeeded to reproduce the issue on Windows, but I also got a failure of 
test_signal.test_socket() as if the C signal handle has not been called 
immediately by _testcapi.raise_signal() and so the socket didn't contain the 
byte of the signal number. It seems quite easy to make test_signal fail on 
Windows.

--

___
Python tracker 

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



[issue34068] traceback.clear_frames(): Objects/typeobject.c:3086: _PyType_Lookup: Assertion `!PyErr_Occurred()' failed.

2018-07-17 Thread STINNER Victor


STINNER Victor  added the comment:

Python 2.7 also has the io module: it may be good to backport the change to 
Python 2.7 as well, no? I see the same bug in 2.7:

res = PyObject_CallMethodObjArgs(self, _PyIO_str_flush, NULL);
PyObject_SetAttrString(self, "__IOBase_closed", Py_True);
if (res == NULL) {
return NULL;
}

--

___
Python tracker 

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



[issue34068] traceback.clear_frames(): Objects/typeobject.c:3086: _PyType_Lookup: Assertion `!PyErr_Occurred()' failed.

2018-07-17 Thread STINNER Victor


Change by STINNER Victor :


--
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue34137] Add Path.lexist() to pathlib

2018-07-17 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



[issue33129] Add kwarg-only option to dataclass

2018-07-17 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

There is an open PR and some discussion about this feature in attrs repo : 
https://github.com/python-attrs/attrs/pull/281

--
nosy: +xtreak

___
Python tracker 

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



[issue34137] Add Path.lexist() to pathlib

2018-07-17 Thread Daniel Pope


New submission from Daniel Pope :

When using pathlib to manipulate paths that may be symlinks or regular files, a 
pattern that comes up frequently is this expression:

path.is_symlink() or path.exists()

os.path.lexists(path) can be used for this, but when using pathlib going back 
to os.path for this seems like defeat.

--
components: Library (Lib)
messages: 321812
nosy: lordmauve
priority: normal
severity: normal
status: open
title: Add Path.lexist() to pathlib
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



[issue33123] Path.unlink should have a missing_ok parameter

2018-07-17 Thread Daniel Pope


Change by Daniel Pope :


--
nosy: +lordmauve

___
Python tracker 

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



[issue34068] traceback.clear_frames(): Objects/typeobject.c:3086: _PyType_Lookup: Assertion `!PyErr_Occurred()' failed.

2018-07-17 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +7849
stage: resolved -> patch review

___
Python tracker 

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



[issue25150] 3.5: Include/pyatomic.h is incompatible with OpenMP (compilation of the third-party yt module fails on Python 3.5)

2018-07-17 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Case in point: if I want to include "internal/pystate.h" from _pickle.c, I get 
the following error:

"""
In file included from ./Include/internal/pystate.h:12:0,
 from /home/antoine/cpython/default/Modules/_pickle.c:10:
./Include/internal/ceval.h:14:5: error: unknown type name ‘_Py_atomic_int’
 _Py_atomic_int calls_to_do;
 ^
"""

--

___
Python tracker 

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



[issue33123] Path.unlink should have a missing_ok parameter

2018-07-17 Thread Daniel Pope


Daniel Pope  added the comment:

This would be a shortcut in the common case that you simply want an idempotent 
"make sure this file/symlink is gone" operation.

There are already boolean options to enable idempotent behaviour in several 
pathlib implementations, such as mkdir(exist_ok=True) and touch(exist_ok=True). 
write_bytes() and write_text() are also idempotent. unlink() aligns well with 
this.

Because this operation doesn't exist, developers are tempted to write

if path.exists():
path.unlink()

which both has a TOCTTOU bug and doesn't correctly handle symlinks.

--

___
Python tracker 

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



[issue25150] 3.5: Include/pyatomic.h is incompatible with OpenMP (compilation of the third-party yt module fails on Python 3.5)

2018-07-17 Thread STINNER Victor


STINNER Victor  added the comment:

This issue is closed. Would you mind to either reopen it or create a new issue?

--

___
Python tracker 

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



[issue34132] Obscure netrc parser "bug"

2018-07-17 Thread Karthikeyan Singaravelan

Karthikeyan Singaravelan  added the comment:

This seems to have been introduced with commit : 
1df0f214a9fdb4dde7506576b144cf6a7fd01b65 before which it was working fine.

Testing shows the error from 1df0f214a9fdb4dde7506576b144cf6a7fd01b65 and 
above. I have checked out only versions of Lib/netrc.py and I think this 
doesn't require a rebuild of Python.

➜  cpython git:(master) $ git log --oneline --format="%h" Lib/netrc.py > 
commits.txt # Get all commits to test the changes
➜  cpython git:(master) ✗ ./python netrc_foo_tester.py

netrc_foo_tester.py is attached with the message which basically does the below 
using Python for every commit. netrc_foo.py contains the actual test of parsing 
two files.

➜  cpython git:(master) ✗ ./python
Python 3.8.0a0 (heads/master:35c0809, Jul 16 2018, 10:29:23)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

➜ cpython git:(master) ✗ cat netrc_foo.py
import netrc

rc = netrc.netrc(file="netrc-comment-blank")
rc = netrc.netrc(file="netrc-blank-comment")

➜  cpython git:(master) ✗ git reset --quiet HEAD . && git checkout . && git 
checkout be19ed7 Lib/netrc.py && ./python netrc_foo.py
netrc_foo.py:2: ResourceWarning: unclosed file <_io.TextIOWrapper 
name='netrc-comment-blank' mode='r' encoding='UTF-8'>
  rc = netrc.netrc(file="netrc-comment-blank")
netrc_foo.py:3: ResourceWarning: unclosed file <_io.TextIOWrapper 
name='netrc-blank-comment' mode='r' encoding='UTF-8'>
  rc = netrc.netrc(file="netrc-blank-comment")
➜  cpython git:(master) ✗ git reset --quiet HEAD . && git checkout . && git 
checkout c12a813 Lib/netrc.py && ./python netrc_foo.py
➜  cpython git:(master) ✗ git reset --quiet HEAD . && git checkout . && git 
checkout 78a1a15 Lib/netrc.py && ./python netrc_foo.py
➜  cpython git:(master) ✗ git reset --quiet HEAD . && git checkout . && git 
checkout 1df0f21 Lib/netrc.py && ./python netrc_foo.py
Traceback (most recent call last):
  File "netrc_foo.py", line 3, in 
rc = netrc.netrc(file="netrc-blank-comment")
  File "/home/cpython/Lib/netrc.py", line 32, in __init__
self._parse(file, fp)
  File "/home/cpython/Lib/netrc.py", line 65, in _parse
"bad toplevel token %r" % tt, file, lexer.lineno)
netrc.NetrcParseError: bad toplevel token 'Comment' (netrc-blank-comment, line 
2)

I hope the above approach is correct.

Thanks

--
Added file: https://bugs.python.org/file47699/netrc_foo_tester.py

___
Python tracker 

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