[issue29650] abstractmethod does not work when deriving from Exception

2017-02-26 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
dependencies:  -abstract class instantiable when subclassing dict
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> abstract class instantiable when subclassing dict

___
Python tracker 

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



[issue29657] os.symlink: FileExistsError shows wrong message

2017-02-26 Thread Wolfgang Rohdewald

New submission from Wolfgang Rohdewald:

execute the attached script. It should return

FileExistsError: [Errno 17] File exists: 'a_link' -> 'a'

but it returns

FileExistsError: [Errno 17] File exists: 'a' -> 'a_link'

--
components: Library (Lib)
files: x.py
messages: 288591
nosy: wrohdewald
priority: normal
severity: normal
status: open
title: os.symlink: FileExistsError shows wrong message
versions: Python 3.5
Added file: http://bugs.python.org/file46671/x.py

___
Python tracker 

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



[issue29110] [patch] Fix file object leak in `aifc.open` when given invalid AIFF file.

2017-02-26 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee: serhiy.storchaka -> inada.naoki

___
Python tracker 

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



[issue29657] os.symlink: FileExistsError shows wrong message

2017-02-26 Thread Xiang Zhang

Xiang Zhang added the comment:

I concur the current message is misleading.

OSError makes the string "file1 -> file2". This also affects other methods 
calling `path_error2()` such as os.link().

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



[issue29598] Write unit tests for pdb module

2017-02-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

And decorate this test class with test.support.cpython_only.

--

___
Python tracker 

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



[issue28961] unittest.mock._Call ignores `name` parameter

2017-02-26 Thread Berker Peksag

Changes by Berker Peksag :


--
pull_requests: +269

___
Python tracker 

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



[issue28961] unittest.mock._Call ignores `name` parameter

2017-02-26 Thread Berker Peksag

Changes by Berker Peksag :


--
pull_requests: +270

___
Python tracker 

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



[issue29110] [patch] Fix file object leak in `aifc.open` when given invalid AIFF file.

2017-02-26 Thread INADA Naoki

Changes by INADA Naoki :


--
pull_requests: +271

___
Python tracker 

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



[issue29110] [patch] Fix file object leak in `aifc.open` when given invalid AIFF file.

2017-02-26 Thread INADA Naoki

Changes by INADA Naoki :


--
pull_requests: +272

___
Python tracker 

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



[issue28961] unittest.mock._Call ignores `name` parameter

2017-02-26 Thread Berker Peksag

Changes by Berker Peksag :


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

___
Python tracker 

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



[issue29652] Fix evaluation order of keys/values in dict comprehensions

2017-02-26 Thread Xiang Zhang

Changes by Xiang Zhang :


--
nosy: +xiang.zhang

___
Python tracker 

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



[issue29657] os.symlink: FileExistsError shows wrong message

2017-02-26 Thread Sayan Chowdhury

Changes by Sayan Chowdhury :


--
nosy: +sayanchowdhury

___
Python tracker 

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



[issue29658] Process hangs (sometimes)

2017-02-26 Thread djstrong

New submission from djstrong:

I have this code, which sometimes hangs (1 of 5 runs):

# -*- coding: utf-8 -*-

import sys
import threading
import multiprocessing

mpl = multiprocessing.log_to_stderr()
mpl.setLevel(1)


class A(threading.Thread):
def __init__(self):
super(A, self).__init__()

def run(self):
print(self.name, 'RUN')

for line in sys.stdin: #increases probability of hanging
pass

print(self.name, 'STOP')


class B(multiprocessing.Process):
def __init__(self):
super(B, self).__init__()

def run(self):
print(self.name, 'RUN')


a = A()
a.start()

b = B()
b.start()
print('B started', b, b.is_alive(), b.pid)
print('A', a)

a.join()
b.join()

print('FINISHED')

I am running it on Ubuntu with command: echo "" | python3 time_test4.py

Output is:
Thread-1 RUN
B started  True 31439
A 
Thread-1 STOP

--
messages: 288594
nosy: djstrong
priority: normal
severity: normal
status: open
title: Process hangs (sometimes)
type: behavior
versions: Python 3.4

___
Python tracker 

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



[issue29658] Combining thread and process, process hangs (sometimes)

2017-02-26 Thread djstrong

Changes by djstrong :


--
title: Process hangs (sometimes) -> Combining thread and process, process hangs 
(sometimes)

___
Python tracker 

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



[issue29658] Combining thread and process, process hangs (sometimes)

2017-02-26 Thread djstrong

djstrong added the comment:

Sometimes the output is:
Thread-1 RUN
Thread-1 STOP
B started  True 20187
A 
[INFO/B-1] child process calling self.run()


but "print" in "run" method of process is not executed.

--

___
Python tracker 

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



[issue25452] Add __bool__() method to subprocess.CompletedProcess

2017-02-26 Thread Sayan Chowdhury

Changes by Sayan Chowdhury :


--
pull_requests: +273

___
Python tracker 

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



[issue29648] Missed reference to create_module() in versionadded (import.rst)

2017-02-26 Thread Nick Coghlan

Nick Coghlan added the comment:

Version added is correct here, as the "create_module()" methods are all new in 
3.4, and the traditional granularity for deciding "addition or change?" is that 
new functions, methods, and attributes are always additions, even if they're 
being added to a class definition.

--

___
Python tracker 

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



[issue29121] sqlite3 Controlling Transactions documentation not updated

2017-02-26 Thread Berker Peksag

Changes by Berker Peksag :


--
pull_requests: +274

___
Python tracker 

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



[issue29648] Missed reference to create_module() in versionadded (import.rst)

2017-02-26 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +275

___
Python tracker 

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



[issue29648] Missed reference to create_module() in versionadded (import.rst)

2017-02-26 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +276

___
Python tracker 

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



[issue22594] Add a link to the regex module in re documentation

2017-02-26 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +277

___
Python tracker 

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



[issue22594] Add a link to the regex module in re documentation

2017-02-26 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +278

___
Python tracker 

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



[issue28518] execute("begin immediate") throwing OperationalError

2017-02-26 Thread Berker Peksag

Changes by Berker Peksag :


--
pull_requests: +279

___
Python tracker 

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



[issue29121] sqlite3 Controlling Transactions documentation not updated

2017-02-26 Thread Berker Peksag

Changes by Berker Peksag :


--
pull_requests: +280

___
Python tracker 

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



[issue26184] Add versionchanged note for error when create_module() is not defined by loaders

2017-02-26 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +281

___
Python tracker 

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



[issue29648] Missed reference to create_module() in versionadded (import.rst)

2017-02-26 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Thanks for the clarification, Nick :)

Marco, I merged your PR, and backported to 3.5 and 3.6 branches.
Thanks!

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



[issue22594] Add a link to the regex module in re documentation

2017-02-26 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +282

___
Python tracker 

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



[issue29121] sqlite3 Controlling Transactions documentation not updated

2017-02-26 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the patch, Aviv!

--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 

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



[issue28518] execute("begin immediate") throwing OperationalError

2017-02-26 Thread Berker Peksag

Berker Peksag added the comment:

Thank you everyone! This should be fixed now.

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

___
Python tracker 

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



[issue29355] sqlite3: remove sqlite3_stmt_readonly()

2017-02-26 Thread Berker Peksag

Berker Peksag added the comment:

The patch for issue 28518 has been merged and it doesn't contain any use of 
sqlite3_stmt_readonly(). Closing this as 'out of date'. Thanks again Ma!

--
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue29098] document minimum sqlite version

2017-02-26 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the report, Carl! The patch for issue 28518 has been lifted the 
requirement for sqlite3_stmt_readonly() so you can now use and compile Python 
3.6.1 without a warning at compile time.

--
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue28231] zipfile does not support pathlib

2017-02-26 Thread Berker Peksag

Changes by Berker Peksag :


--
pull_requests: +283

___
Python tracker 

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



[issue28231] zipfile does not support pathlib

2017-02-26 Thread Berker Peksag

Berker Peksag added the comment:

PR 322 should make the example in msg284754 work:

>>> import pathlib, zipfile
>>> f = pathlib.Path('spam.zip')
>>> with zipfile.ZipFile(f) as zf:
...   zf.namelist()
... 
['LICENSE']

It doesn't implement full PathLike support, but it at least covers the use 
cases of Jeremy and Steve.

--

___
Python tracker 

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



[issue25452] Add __bool__() method to subprocess.CompletedProcess

2017-02-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I'm not sure that it is worth to implement the __bool__() method. This doesn't 
add much in comparison with checking the returncode attribute.

The change can break existing code that uses boolean testing instead of 
checking for None.

--

___
Python tracker 

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



[issue28624] Make the `cwd` argument to `subprocess.Popen` accept a `PathLike`

2017-02-26 Thread Berker Peksag

Changes by Berker Peksag :


--
pull_requests: +284

___
Python tracker 

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



[issue28230] tarfile does not support pathlib

2017-02-26 Thread Berker Peksag

Berker Peksag added the comment:

Serhiy's patch looks good to me, but it would be nice to document the support 
for PathLike objects in the tarfile documentation.

--

___
Python tracker 

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



[issue28624] Make the `cwd` argument to `subprocess.Popen` accept a `PathLike`

2017-02-26 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the patch, Sayan!

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



[issue25882] argparse help error: arguments created by add_mutually_exclusive_group() are shown outside their parent group created by add_argument_group()

2017-02-26 Thread paul j3

paul j3 added the comment:

Earlier issue on the same topic - passing a mutually exclusive group via parents

http://bugs.python.org/issue16807

Can they be consolidated?

--

___
Python tracker 

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



[issue29553] Argparser does not display closing parentheses in nested mutex groups

2017-02-26 Thread paul j3

paul j3 added the comment:

The PR117 patch adds an apparent symmetry.  There's a if/else for 'start', so 
shouldn't there also be one for 'end'?

if start in inserts:
inserts[start] += ' ['
else:
inserts[start] = '['

But why the '+=' case?  It's needed for cases like this:

usage: prog [-h] [-A | -B] [-C | -D]

It ensures that the insert between B and C is '] [', as opposed to just '['. 

Without any groups usage for the 4 Actions is

usage: prog [-h] [-A] [-B] [-C] [-D]

Adding the first group adds a '[','|', and ']' (the inner [] will be deleted 
later).  The second group also wants to add '[','|',']', but its '[' has to be 
concatenated to the existing ']', rather than replace it.

-

To understand what's happening when we nest groups, we have to look at the 
resulting groups.  

Usage is created with

formatter.add_usage(self.usage, self._actions,
self._mutually_exclusive_groups)

  
In christofsteel's original example, the parser._mutually_exclusive_groups is a 
len 3 list.  Each group has a list of '_group_actions'.  

In [13]: [len(g._group_actions) for g in parser._mutually_exclusive_groups]
Out[13]: [6, 4, 2]

The first, outermost group, contains all the defined Actions, including the 
ones defined in the nested groups.  It doesn't contain 2 actions and a group. 
The link between child and parent group is one way.  The child knows its 
'container', but the parent has not information about 'children'. 

Usage using just the 1st group produces:

usage: ipython3 [-h] [-a A | -b B | -c C | -d D | -e E | -f F]

With 2 groups:

usage: ipython3 [-h] [-a A | -b B | [-c C | -d D | -e E | -f F]

The second group has added it's '[ | | | ]' on top of the first group's 
inserts.  The '[' was appended, the others over write.

That's more apparent if I change the 2nd group to be 'required':

usage: ipython3 [-h] [-a A | -b B | (-c C | -d D | -e E | -f F)

The final ']' (from the 1st group) has been replaced with a ')'.

The patch ensures that the new ']' is appended to the existing ']'. But if the 
2nd group is required, the patch will produce:

 | -f F])

not  

 | -f F)]

as would be expected if the groups were really nested.

In sum, patching brittle code to do something it wasn't designed to do in the 
first place isn't the solution.

Disabling nesting as recommended in http://bugs.python.org/issue22047, is, I 
think a better solution.

---

An old (2011) issue tries to put an action in 2 or more groups:

http://bugs.python.org/issue10984 'argparse add_mutually_exclusive_group should 
accept existing arguments to register conflicts'

Adding an existing action to a new group is relatively easy.  But usage display 
runs into the same issues.  I had to recommend a total rewrite that ditches the 
'inserts' approach entirely.

--

___
Python tracker 

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



[issue28718] '*' matches entire path in fnmatch

2017-02-26 Thread Aaron Whitehouse

Aaron Whitehouse added the comment:

Note that somebody has forked the standard library to implement this:
https://github.com/kianxineki/python-wildcard
This shows that the actual changes would be pretty small (though pywildcard is 
based on 2.x code and does not handle the cross-platform slashes you have been 
discussing).

It is also worth noting that the glob standard library:
https://docs.python.org/3.7/library/glob.html
implements a "recursive" option that has similar behaviour (* does not span 
path separators whereas ** does) and essentially builds this on top of fnmatch 
for the actual filename matching. 

I do not think we can change the default behaviour of fnmatch at this point, 
but I would like to see this behaviour triggered by an optional argument to the 
various functions, e.g.:
fnmatch.fnmatch(filename, pattern, glob_asterisks=False)
fnmatch.fnmatchcase(filename, pattern, glob_asterisks=False)
fnmatch.filter(names, pattern, glob_asterisks=False)
fnmatch.translate(pattern, glob_asterisks=False)

In each case, if glob_asterisks (or whatever other name we came up with) is 
true, the behaviour would match the pywildcard behaviour, i.e.:
**  matches everything
*   matches in one path level

I look after the glob matching code in duplicity and would like to start using 
the standard library to do filename matching for us, but we need the above 
behaviour. I am happy to do the patching if there is a realistic chance of it 
being accepted.

--
nosy: +aaron-whitehouse
title: '*' matches entire path in fnmatch.translate -> '*' matches entire path 
in fnmatch

___
Python tracker 

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



[issue29553] Argparser does not display closing parentheses in nested mutex groups

2017-02-26 Thread paul j3

paul j3 added the comment:

I should probably give PR 120 more credit.  By checking the group's container 
it in effect eliminates this overlapping action problem.  Nested groups aren't 
used in the usage, just the union xor.

Maybe the question is, which is better for the user?  To tell them up front 
that nesting is not allowed, or to display the union group without further 
comment?  Does allowing nesting on the input give them a false sense of control?

More often on StackOverFlow users try to nest ArgumentGroups in a mutually 
exclusive one, thinking that this will give some sort of 'any-of' logic.

--

___
Python tracker 

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



[issue29658] Combining thread and process, process hangs (sometimes)

2017-02-26 Thread djstrong

djstrong added the comment:

It is confirmed with other hardware with Python 3.5.2. Process is forked, but 
method "run" is not executing.

--
versions: +Python 3.5 -Python 3.4

___
Python tracker 

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



[issue29110] [patch] Fix file object leak in `aifc.open` when given invalid AIFF file.

2017-02-26 Thread INADA Naoki

INADA Naoki added the comment:

Anyone mind Python 2.7?

Since Python 2.7 doesn't have mock and check_no_resource_warning context 
manager, I can't cherry-pick easily.

Backporting is bother to me, and the issue doesn't seem so critical.
Can I just close this issue?

--

___
Python tracker 

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



[issue29573] NamedTemporaryFile with delete=True should not fail if file already deleted

2017-02-26 Thread Andrew Nester

Andrew Nester added the comment:

some updates?

--

___
Python tracker 

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



[issue29553] Argparser does not display closing parentheses in nested mutex groups

2017-02-26 Thread Andrew Nester

Andrew Nester added the comment:

JFYI, from my perspective as a developer PR 120 is more preferred one.

--

___
Python tracker 

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



[issue26184] Add versionchanged note for error when create_module() is not defined by loaders

2017-02-26 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +285

___
Python tracker 

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



[issue26184] Add versionchanged note for error when create_module() is not defined by loaders

2017-02-26 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +286

___
Python tracker 

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



[issue26184] Add versionchanged note for error when create_module() is not defined by loaders

2017-02-26 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Merged and backported to 3.6.
Closing this issue :) 
Thanks.

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

___
Python tracker 

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



[issue26389] Expand traceback module API to accept just an exception as an argument

2017-02-26 Thread Matthias Bussonnier

Matthias Bussonnier added the comment:

Just came across that with wanting to use print_exception and got the same idea.

It seem like in print_exception, and format_exception, etype is already ignored 
and `type(value)` is used, so I think we could also "just" also ignore tb 
(unless set) and use `value.__traceback__`. Leaving the API to function(None, 
exception)

I don't see any clean way to migrate to a new API (IMHO a forced `exc kwarg` is 
not discoverable enough vs a (None, e, e.__traceback__)

A possibility, as `etype` is already unused, would be replace it with 
etype_or_exception, and in case it's a full exception use it as the sole 
parameter from which type and tb get extracted. 

Though that feels weird as well, and the Deprecation Cycles would need to be 
long.

Already emitting deprecation warnings (that etype is ignored) would be good.

--
nosy: +mbussonn

___
Python tracker 

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



[issue29659] Expose the `length` arg from shutil.copyfileobj for public use

2017-02-26 Thread tyler

New submission from tyler:

It would be handy to be able to pass the `length` default argument defined by 
`shutil.copyfileobj()` to other public functions througout the module. When 
copying very large files (1GB +), increasing the memory buffer can divide the 
copy time in half and currently the only way to accomplish this is by 
overriding the needed function(s) which call `shutil.copyfileobj()`.

I propose a simple non-invasive change where the following functions will also 
expose the `length` kwarg and pass it downwards to `copyfileobj`:
- copyfile
- copy
- copy2

--
messages: 288616
nosy: goodboy
priority: normal
severity: normal
status: open
title: Expose the `length` arg from shutil.copyfileobj for public use
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



[issue26389] Expand traceback module API to accept just an exception as an argument

2017-02-26 Thread Matthias Bussonnier

Changes by Matthias Bussonnier :


--
pull_requests: +287

___
Python tracker 

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



[issue29659] Expose the `length` arg from shutil.copyfileobj for public use

2017-02-26 Thread Tyler Goodlet

Changes by Tyler Goodlet :


--
pull_requests: +288

___
Python tracker 

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



[issue29660] Document that print/format_exception ignore etype

2017-02-26 Thread Matthias Bussonnier

New submission from Matthias Bussonnier:

As far as I can tell, http://bugs.python.org/issue17911 made a couple of 
function in traceback ignore their first arguments (etype) and infer the type 
from the second one (evalue). 

(In git 6bc2c1e7 and 2f0441f0 respectively).

At least print_exception and format_exception are affected.

This likely affect http://bugs.python.org/issue26389 (who wish to expand same 
API to remove these parameters).

And inconsistency with `format_exception_only` which does need `etype` should 
be checked. 

If etype is a deprecated parameter it should be noted, and should likely raise 
a DeprecationWarning as well when set.

--
assignee: docs@python
components: Documentation
messages: 288617
nosy: docs@python, mbussonn
priority: normal
severity: normal
status: open
title: Document that print/format_exception ignore etype
versions: 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



[issue26389] Expand traceback module API to accept just an exception as an argument

2017-02-26 Thread Matthias Bussonnier

Matthias Bussonnier added the comment:

I've attempted a Pull-request trying to implement what Brett is describing. See 
https://github.com/python/cpython/pull/327, and opened 
http://bugs.python.org/issue29660 to document that etype is ignored and decide 
wether it should emit DeprecationWarning when used.

--

___
Python tracker 

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



[issue29376] threading._DummyThread.__repr__ raises AssertionError

2017-02-26 Thread Xiang Zhang

Changes by Xiang Zhang :


--
pull_requests: +290

___
Python tracker 

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



[issue29376] threading._DummyThread.__repr__ raises AssertionError

2017-02-26 Thread Xiang Zhang

Changes by Xiang Zhang :


--
pull_requests: +289

___
Python tracker 

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



[issue29376] threading._DummyThread.__repr__ raises AssertionError

2017-02-26 Thread Xiang Zhang

Changes by Xiang Zhang :


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



[issue29661] Typo in the docstring of timeit.Timer.autorange

2017-02-26 Thread Antony Lee

New submission from Antony Lee:

The docstring of timeit.Timer.autorange currently reads

 |  Return the number of loops so that total time >= 0.2.
 |  
 |  Calls the timeit method with *number* set to successive powers of
 |  ten (10, 100, 1000, ...) up to a maximum of one billion, until
 |  the time taken is at least 0.2 second, or the maximum is reached.
 |  Returns ``(number, time_taken)``.
 |  
 |  If *callback* is given and is not None, it will be called after
 |  each trial with two arguments: ``callback(number, time_taken)``.

Note the contradiction between the return values documented in the first and 
second paragraphs (the second one is correct).

--
components: Library (Lib)
messages: 288619
nosy: Antony.Lee
priority: normal
severity: normal
status: open
title: Typo in the docstring of timeit.Timer.autorange
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



[issue29661] Typo in the docstring of timeit.Timer.autorange

2017-02-26 Thread Antony Lee

Changes by Antony Lee :


--
nosy:  -Antony.Lee

___
Python tracker 

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



[issue29661] Typo in the docstring of timeit.Timer.autorange

2017-02-26 Thread Xiang Zhang

Changes by Xiang Zhang :


--
pull_requests: +291

___
Python tracker 

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



[issue29661] Typo in the docstring of timeit.Timer.autorange

2017-02-26 Thread Xiang Zhang

Changes by Xiang Zhang :


--
assignee:  -> xiang.zhang
nosy: +xiang.zhang
stage:  -> patch review
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



[issue29662] Fix wrong indentation of timeit.Timer's documenation

2017-02-26 Thread Xiang Zhang

Changes by Xiang Zhang :


--
versions: +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



[issue29662] Fix wrong indentation of timeit.Timer's documenation

2017-02-26 Thread Xiang Zhang

Changes by Xiang Zhang :


--
assignee: xiang.zhang
components: Documentation
nosy: xiang.zhang
priority: normal
severity: normal
stage: patch review
status: open
title: Fix wrong indentation of timeit.Timer's documenation

___
Python tracker 

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



[issue29662] Fix wrong indentation of timeit.Timer's documenation

2017-02-26 Thread Xiang Zhang

Changes by Xiang Zhang :


--
pull_requests: +292

___
Python tracker 

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



[issue29662] Fix wrong indentation of timeit.Timer's documenation

2017-02-26 Thread Xiang Zhang

Changes by Xiang Zhang :


--
pull_requests: +293

___
Python tracker 

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



[issue29662] Fix wrong indentation of timeit.Timer's documenation

2017-02-26 Thread Xiang Zhang

Changes by Xiang Zhang :


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



[issue28231] zipfile does not support pathlib

2017-02-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I have different path. It adds the support of path-like objects for all 
external paths.

--
type: behavior -> enhancement
versions:  -Python 3.6
Added file: http://bugs.python.org/file46672/zipfile-pathlib.patch

___
Python tracker 

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



[issue26389] Expand traceback module API to accept just an exception as an argument

2017-02-26 Thread Martin Panter

Martin Panter added the comment:

Matthias’s proposal adds support for a new keyword-only “exc” argument:

print_exception(exc=exception_instance)

I still think it is worth supporting a single positional argument as well:

print_exception(exception_instance)

Another point is that it may be better to keep the existing parameter name 
“value”, rather than (eventually?) replacing it with “exc”. I think both of 
these things could be accomplished by juggling the “value” and “etype” 
parameters:

def print_exception(etype=None, value=None, tb=None, ...):
if value is None:  # Assume value passed as first positional argument
value = etype
etype = None
if etype is tb is None:  # Only value passed
etype = type(value)
tb = value.__traceback__
# Existing code using (etype, value, tb)

The disadvantage of any of these changes is that we may want to maintain 
support for the old signature while Python 2 remains alive.

--
stage: test needed -> patch review
versions: +Python 3.7 -Python 3.6

___
Python tracker 

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