[issue38440] Possible new issues with IDLE

2019-11-06 Thread Ned Deily


Ned Deily  added the comment:

> That would be very helpful! If you do so I'd be happy to test on Windows, 
> macOS.

Sorry, I meant for macOS only.  I'm not getting into the business of building 
Windows installers, too. :)  As for Ubuntu, you should be able to build that 
yourself.  But I think Kevin's point is that there are a lot of macOS-specific 
changes in Tk 8.6.10 and that's what we can really help to test.

--

___
Python tracker 

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



[issue38440] Possible new issues with IDLE

2019-11-06 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Quick summary and opinions so far:
* Jump to top: general IDLE bug, fixed.

* Repeated quit message: never seen by me, likely IDLE bug.  I need to check 
code where message emitted.

* Arrow keys emit ? replacement char: never seen by me, likely tcl bug. IDLE 
only binds  and  for completion, font, and path/browser 
lists, but not editor.  So if bug happens in editor, as implied, IDLE likely 
not involved.

* SaveFile crash: never seen by me with this dialog that I remember, likely tcl 
or even macOS bug.  The dialog matches Safari SaveAs box with Python-specific 
formats.  It results from IDLE tkinter call, which calls tcl, which calls 
AppKit -- lines 41-40 in C call stack.  Line 35 is the only non-OS (tcl) call 
thereafter.

--

___
Python tracker 

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



[issue38440] Possible new issues with IDLE

2019-11-06 Thread Tal Einat


Tal Einat  added the comment:

Ned:
- I could also try to make a 3.8.0 and/or 3.7.5 with 8.6.10rc1 installer 
available informally.

That would be very helpful! If you do so I'd be happy to test on Windows, 
macOS. I'm also able to test on Ubuntu if that would help.

I suggest we somehow collect new issues we find with the 3.6.10 release 
candidates and follow up those with the Tk developers - perhaps we could use a 
dedicated issue here or some other shared document?

--

___
Python tracker 

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



[issue38440] Possible new issues with IDLE

2019-11-06 Thread Ned Deily


Ned Deily  added the comment:

Thanks, Kevin.  I do see that 8.6.10rc1 is now available.  Yay!

Tal:
> How can we work with the Tk developers to ensure it works with Python across 
> platforms?

We have the first 3.9.0 alpha scheduled in about 10 days. I will try to build 
8.6.10rc1 (or later release) and include it in 3.9.0a1. I could also try to 
make a 3.8.0 and/or 3.7.5 with 8.6.10rc1 installer available informally.

--

___
Python tracker 

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



[issue38731] bad input crashes py_compile library

2019-11-06 Thread Kaoru Esashika


New submission from Kaoru Esashika :

How to reproduction:
Step 1: make bad source code
Step 2: run "python -m py_compile bad_source_code.py"
Step 3: errors printed

It seems that this problem is introduced at issue 22640 (commit 
https://github.com/python/cpython/commit/2e33ecd7c9b0cac3efc6fcbdd4547fd086b4e2d1)
and it have not fixed yet.

variable 'quiet' is not defined in main function as far as I can see.

```
Traceback (most recent call last):
  File "c:\users\\.scoop\apps\python\3.8.0\Lib\py_compile.py", line 
144, in compile
code = loader.source_to_code(source_bytes, dfile or file,
  File "", line 846, in source_to_code
  File "", line 219, in _call_with_frames_removed
  File "c:/Users//AppData/Local/Temp/flycheckrIYLj4/test.py", line 25
def calc_entropy(self):
^
IndentationError: expected an indented block

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\\.scoop\apps\python\3.8.0\Lib\py_compile.py", line 
209, in main
compile(filename, doraise=True)
  File "c:\users\\.scoop\apps\python\3.8.0\Lib\py_compile.py", line 
150, in compile
raise py_exc
__main__.PyCompileError: Sorry: IndentationError: expected an indented block 
(c:/Users//AppData/Local/Temp/flycheckrIYLj4/test.py, line 25)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\\.scoop\apps\python\3.8.0\Lib\runpy.py", line 192, 
in _run_module_as_main
return _run_code(code, main_globals, None,
  File "c:\users\\.scoop\apps\python\3.8.0\Lib\runpy.py", line 85, in 
_run_code
exec(code, run_globals)
  File "c:\users\\.scoop\apps\python\3.8.0\Lib\py_compile.py", line 
218, in 
sys.exit(main())
  File "c:\users\\.scoop\apps\python\3.8.0\Lib\py_compile.py", line 
213, in main
if quiet < 2:
NameError: name 'quiet' is not defined

```

--
components: Library (Lib)
messages: 356173
nosy: Kaoru Esashika
priority: normal
severity: normal
status: open
title: bad input crashes py_compile library
type: crash
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



[issue38440] Possible new issues with IDLE

2019-11-06 Thread Tal Einat


Tal Einat  added the comment:

Thanks for the report on the freezes, Raymond! My mac was recently fixed and 
I've upgraded to the latest OS version, so I'll take a look at this as well.

Thanks for the update on the Tk side, Kevin. It's very unfortunate that we've 
found 3.6.9 unusable with Python, and I certainly hope that 3.6.10 will not be 
like that. How can we work with the Tk developers to ensure it works with 
Python across platforms?

--

___
Python tracker 

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



[issue38382] statistics.harmonic_mean fails to raise error with negative input that follows a 0

2019-11-06 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 6b66dc387935df432cdbc01397ddef534a84ade9 by Raymond Hettinger 
(Miss Islington (bot)) in branch '3.8':
bpo-38382: Document the early-out behavior for a zero (GH-17037) (GH-17078)
https://github.com/python/cpython/commit/6b66dc387935df432cdbc01397ddef534a84ade9


--

___
Python tracker 

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



[issue38382] statistics.harmonic_mean fails to raise error with negative input that follows a 0

2019-11-06 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
resolution:  -> not a bug
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



[issue38382] statistics.harmonic_mean fails to raise error with negative input that follows a 0

2019-11-06 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16588
pull_request: https://github.com/python/cpython/pull/17078

___
Python tracker 

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



[issue38382] statistics.harmonic_mean fails to raise error with negative input that follows a 0

2019-11-06 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 7f460494d2309ace004a400bae8fc59134dc325c by Raymond Hettinger in 
branch 'master':
bpo-38382: Document the early-out behavior for a zero (GH-17037)
https://github.com/python/cpython/commit/7f460494d2309ace004a400bae8fc59134dc325c


--

___
Python tracker 

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



[issue36406] doctest.testmod(empty_package) raises TypeError in 3.7 (and no errors in 3.6)

2019-11-06 Thread larabrian

larabrian  added the comment:

A subscriptable object is any object that implements the __getitem__ special 
method (think lists, dictionaries). It is an object that records the operations 
done to it and it can store them as a "script" which can be replayed. You are 
trying to subscript an object which you think is a list or dict, but actually 
is None. NoneType is the type of the None object which represents a lack of 
value, for example, a function that does not explicitly return a value will 
return None. 'NoneType' object is not subscriptable is the one thrown by python 
when you use the square bracket notation object[key] where an object doesn't 
define the __getitem__ method . You might have noticed that the method sort() 
that only modify the list have no return value printed – they return the 
default None. This is a design principle for all mutable data structures in 
Python. http://net-informations.com/python/err/nonetype.htm

--
nosy: +larabrian

___
Python tracker 

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



[issue37731] Possible redifinition of _POSIX_C_SOURCE in ./pyconfig.h

2019-11-06 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset 089e5f52a34377193a9e6c03088114b14c8507af by Benjamin Peterson in 
branch '2.7':
bpo-37731: Squish another _POSIX_C_SOURCE redefinition problem in expat. 
(GH-17077)
https://github.com/python/cpython/commit/089e5f52a34377193a9e6c03088114b14c8507af


--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue37731] Possible redifinition of _POSIX_C_SOURCE in ./pyconfig.h

2019-11-06 Thread Benjamin Peterson


Change by Benjamin Peterson :


--
pull_requests: +16587
pull_request: https://github.com/python/cpython/pull/17077

___
Python tracker 

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



[issue37731] Possible redifinition of _POSIX_C_SOURCE in ./pyconfig.h

2019-11-06 Thread miss-islington


miss-islington  added the comment:


New changeset 30114c7119a9ae0e610d6974f57f22d8d05ed50d by Miss Islington (bot) 
in branch '2.7':
bpo-37731: Reorder includes in xmltok.c to avoid redefinition of 
_POSIX_C_SOURCE (GH-16733)
https://github.com/python/cpython/commit/30114c7119a9ae0e610d6974f57f22d8d05ed50d


--

___
Python tracker 

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



[issue37731] Possible redifinition of _POSIX_C_SOURCE in ./pyconfig.h

2019-11-06 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16586
pull_request: https://github.com/python/cpython/pull/17076

___
Python tracker 

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



[issue38730] 2.7 modern compiler warnings

2019-11-06 Thread Benjamin Peterson


Change by Benjamin Peterson :


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

___
Python tracker 

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



[issue38730] 2.7 modern compiler warnings

2019-11-06 Thread Benjamin Peterson


New submission from Benjamin Peterson :

GCC 9's -Wstringop-truncation warnings trigger several times in 2.7. Some of 
these instances are all actual bugs. In all cases, we should clarify the code 
to make the compiler happy.

--
components: Build
messages: 356166
nosy: benjamin.peterson
priority: normal
severity: normal
status: open
title: 2.7 modern compiler warnings
versions: Python 2.7

___
Python tracker 

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



[issue38440] Possible new issues with IDLE

2019-11-06 Thread Kevin Walzer


Kevin Walzer  added the comment:

On macOS, Tk 8.6.8 is considered ancient, even obsolete, on 10.14 or later. Tk 
has required huge re-work to accommodate changes in the Mac's drawing API's on 
10.14, mostly done by Marc Culler; these issues are not observable with the 
current tip of 8.6 development and IDLE 3.7.4. An RC of 8.6.10 has just gone 
out and we are anticipating the final release by Nov. 21, which includes too 
many changes to enumerate here. In any case, it should be considerably more 
stable than what is being reported.

--

___
Python tracker 

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



[issue38692] add a pidfd child process watcher

2019-11-06 Thread Benjamin Peterson


Benjamin Peterson  added the comment:

On Wed, Nov 6, 2019, at 09:57, STINNER Victor wrote:
> 
> STINNER Victor  added the comment:
> 
> Would it be useful to use a pidfd in subprocess.Popen to fix bpo-38630 
> root issue, when pidfd is available?

Probably, but as noted above, we need to figure out the best way to integrate 
pidfds into subprocess. (Probably not in this issue.)

--

___
Python tracker 

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



[issue16575] ctypes: unions as arguments

2019-11-06 Thread Ammar Askar


Change by Ammar Askar :


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



[issue11588] Add "necessarily inclusive" groups to argparse

2019-11-06 Thread Jack Wong


Change by Jack Wong :


--
nosy: +iforapsy

___
Python tracker 

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



[issue38729] mock.create_autospec generates incorrect signature for some decorated methods

2019-11-06 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
components: +Library (Lib) -Tests
nosy: +cjw296, lisroach, mariocj89, michael.foord, xtreak

___
Python tracker 

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



[issue38440] Possible new issues with IDLE

2019-11-06 Thread Ned Deily


Ned Deily  added the comment:

That's quite a stack trace, bouncing back and forth between Python and Tk and 
macOS.  I don't really have any experience with the flow of control there with 
call outs to file save dialogs.  CCing Kevin Walzer on the off chance that this 
might be familiar and hopefully fixed in the forthcoming Tk 8.6.10 release.  
Kevin, we are still running with a vanilla 8.6.8 release built on macOS 10.9.

--
nosy: +wordtech

___
Python tracker 

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



[issue36906] Compile time textwrap.dedent() equivalent for str or bytes literals

2019-11-06 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

.cleandoc is _probably_ more of what people want than .dedent?  I hadn't 
bothered to even try to pick between the two yet.

--

___
Python tracker 

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



[issue38440] Possible new issues with IDLE

2019-11-06 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

A new intermittent problem has arisen on macOS since I updated to Catalina.  It 
occurs on both 10.15.0 and 10.15.1.  I'm using the 3.8.0 mac 64-bit install 
taken directly from python.org.

In a long-running session of IDLE, the process freezes-up during File/SaveAs.  
The file save dialog comes-up.  When typing the filename, the dialog window 
greys-out, the list of files goes blank, and the situation is unrecoverable 
(see the attached screenshot).

And see below for the core dump in the terminal session.




$ python3.8 -m idlelib.idle
2019-11-06 13:52:34.765 Python[38668:423017] WARNING:  running implicitly; please run panels using NSSavePanel rather 
than NSApplication.
2019-11-06 13:52:40.958 Python[38668:423017] *** Assertion failure in 
-[NSSavePanel _attachSandboxExtensions:toURL:orURLs:], 
/BuildRoot/Library/Caches/com.apple.xbs/Sources/AppKit/AppKit-1894.10.126/Nav.subproj/OpenAndSavePanelRemote/NSVBOpenAndSavePanels.m:711
2019-11-06 13:52:40.963 Python[38668:423017] -[NSSavePanel 
observeValueForKeyPath:ofObject:change:context:] caught non-fatal 
NSInternalInconsistencyException 'unexpected class type for sandbox extension 
string!' with backtrace (
0   CoreFoundation  0x7fff3b080f53 
__exceptionPreprocess + 250
1   libobjc.A.dylib 0x7fff71146835 
objc_exception_throw + 48
2   CoreFoundation  0x7fff3b09c810 
+[NSException raise:format:arguments:] + 88
3   Foundation  0x7fff3d77c5d1 
-[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] 
+ 191
4   AppKit  0x7fff38be944c 
__53-[NSSavePanel _attachSandboxExtensions:toURL:orURLs:]_block_invoke + 240
5   CoreFoundation  0x7fff3b0d15a7 
__NSARRAY_IS_CALLING_OUT_TO_A_BLOCK__ + 7
6   CoreFoundation  0x7fff3b00923d 
-[__NSSingleObjectArrayI enumerateObjectsWithOptions:usingBlock:] + 80
7   AppKit  0x7fff38be925c 
-[NSSavePanel _attachSandboxExtensions:toURL:orURLs:] + 125
8   AppKit  0x7fff38bedf4b 
-[NSSavePanel _URLsWithSecurityScoped:] + 193
9   AppKit  0x7fff38be9481 
-[NSSavePanel _attachSandboxExtensionsAndStartAccessing] + 48
10  AppKit  0x7fff38bea7ce 
-[NSSavePanel completeWithReturnCode:url:urls:] + 164
11  AppKit  0x7fff38bec787 
-[NSSavePanel observeValueForKeyPath:ofObject:change:context:] + 341
12  Foundation  0x7fff3d672412 
NSKeyValueNotifyObserver + 335
13  Foundation  0x7fff3d7faf56 
NSKeyValueDidChange.llvm.18255262684423441536 + 434
14  Foundation  0x7fff3d7fa761 
NSKeyValueDidChangeWithPerThreadPendingNotifications.llvm.18255262684423441536 
+ 146
15  ViewBridge  0x7fff6d7d8adc 
__41-[NSViewBridge setObject:forKey:withKVO:]_block_invoke + 360
16  ViewBridge  0x7fff6d860b5c 
withHintInProgress + 472
17  ViewBridge  0x7fff6d7cf17b 
-[NSViewBridge setObject:forKey:withKVO:] + 856
18  ViewBridge  0x7fff6d7d087a 
-[NSViewBridge nonLocalChangeInProgress:block:] + 352
19  ViewBridge  0x7fff6d7d04d7 
-[NSRemoteViewMarshal exceptionSafeSetRemoteObject:forKey:withReply:] + 264
20  ViewBridge  0x7fff6d7d038b 
-[NSRemoteViewMarshal setRemoteObject:forKey:withReply:] + 56
21  CoreFoundation  0x7fff3afdf1dc 
__invoking___ + 140
22  CoreFoundation  0x7fff3afdf07f 
-[NSInvocation invoke] + 305
23  ViewBridge  0x7fff6d7cdb1e 
__deferNSXPCInvocationOntoMainThread_block_invoke + 228
24  ViewBridge  0x7fff6d7c33ec 
__wrapBlockWithVoucher_block_invoke + 37
25  ViewBridge  0x7fff6d7c31b1 
__deferBlockOntoMainThread_block_invoke_2 + 507
26  CoreFoundation  0x7fff3b00cd6b 
__CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
27  CoreFoundation  0x7fff3afcffdd 
__CFRunLoopDoBlocks + 379
28  CoreFoundation  0x7fff3afcfd50 
__CFRunLoopRun + 2792
29  CoreFoundation  0x7fff3afcefe3 
CFRunLoopRunSpecific + 499
30  HIToolbox   0x7fff39b5667d 
RunCurrentEventLoopInMode + 292
31  HIToolbox   0x7fff39b563bd 
ReceiveNextEventCommon + 

[issue13214] Cmd: list available completions from the cmd.Cmd subclass and filter out EOF handler(s)

2019-11-06 Thread Roundup Robot


Change by Roundup Robot :


--
pull_requests: +16584
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/17074

___
Python tracker 

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



[issue38710] unsynchronized write pointer in io.TextIOWrapper in 'r+' mode

2019-11-06 Thread Josh Rosenberg


Change by Josh Rosenberg :


--
nosy: +josh.r

___
Python tracker 

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



[issue38710] unsynchronized write pointer in io.TextIOWrapper in 'r+' mode

2019-11-06 Thread Josh Rosenberg


Change by Josh Rosenberg :


--
components: +Library (Lib)

___
Python tracker 

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



[issue36906] Compile time textwrap.dedent() equivalent for str or bytes literals

2019-11-06 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

Is there a reason folks are supporting a textwrap.dedent-like behavior over the 
generally cleaner inspect.cleandoc behavior? The main advantage to the latter 
being that it handles:

'''First
Second
Third
'''

just fine (removing the common indentation from Second/Third), and produces 
identical results with:

'''
First
Second
Third
'''

where textwrap.dedent behavior would leave the first string unmodified (because 
it removes the largest common indentation, and First has no leading 
indentation), and dedenting the second, but leaving a leading newline in place 
(where cleandoc removes it), that can only be avoided by using the typically 
discouraged line continuation character to make it:

'''\
First
Second
Third
'''

cleandoc behavior means the choice of whether the text begins and ends on the 
same line at the triple quote doesn't matter, and most use cases seem like 
they'd benefit from that flexibility.

--
nosy: +josh.r

___
Python tracker 

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



[issue38729] mock.create_autospec generates incorrect signature for some decorated methods

2019-11-06 Thread Ben Reilly


Change by Ben Reilly :


--
components: +Tests

___
Python tracker 

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



[issue38729] mock.create_autospec generates incorrect signature for some decorated methods

2019-11-06 Thread Ben Reilly


New submission from Ben Reilly :

mock.create_autospec is meant to create a mock that will ensure, among other 
things, that method calls on the mock correspond to real methods on the 
original object and that the arguments match the signature of the original 
method. However, if the original method is decorated with a method that returns 
a callable object, the signature check may fail.

Attached is a script that demonstrates the error.

The essential part of the script looks like this:

def decorator(m):
return Wrapper(m)

class Wrapper(object):
def __init__(self, method):
self.method = method
update_wrapper(self, method)

def __call__(self, instance, *args, **kwargs):
return self.__get__(instance, type(instance))(*args, **kwargs)

def __get__(self, instance, owner):
... # do the wrapping


The `decorator` method returns an instance of the `Wrapper` class, which is 
callable. Mock will calculate the signature of a method wrapped with 
`decorator` to be equal to that of `Wrapper.__call__`, namely `(instance, 
*args, **kwargs)`. Consequently, calls to the mocked method...

1. will incorrectly fail if the method usually takes no arguments, and
2. will incorrectly pass if the method takes at least one argument but too many 
arguments are provided.

This list of incorrect behaviour is not exhaustive, but hopefully you get the 
point.

If anyone's concerned about real-life examples, this kind of wrapper is used, 
for example, in the public Box SDK, as shown here: 
https://github.com/box/box-python-sdk/blob/b7f41d9a3f8be0ff3622a0c417bf31d2fbbee969/boxsdk/util/api_call_decorator.py#L10

--
files: decorator.py
messages: 356159
nosy: breilly_box
priority: normal
severity: normal
status: open
title: mock.create_autospec generates incorrect signature for some decorated 
methods
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file48698/decorator.py

___
Python tracker 

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



[issue38728] Update PC/pyconfig.h to support disabling auto linking

2019-11-06 Thread Jean-Christophe Fillion-Robin


New submission from Jean-Christophe Fillion-Robin :

When configuring project using build-system generator like CMake, the linking 
is explicitly handled and does not to be implicitly hard-coded in pyconfig.h

Having the "pythonXY.lib" library hard-coded in pyconfig.h currently requires 
to explicitly specify a link directory. While possible, this require to 
increase the complexity of our build-system.

I suggest we introduce a new macro (e.g PY_CONFIG_AUTOLINK_DISABLED)

--
components: Windows
messages: 356158
nosy: Jean-Christophe Fillion-Robin, paul.moore, steve.dower, tim.golden, 
zach.ware
priority: normal
severity: normal
status: open
title: Update PC/pyconfig.h to support disabling auto linking
type: enhancement
versions: Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue38599] Deprecate creation of asyncio object when the loop is not running

2019-11-06 Thread Emmanuel Arias


Emmanuel Arias  added the comment:

Hi, 

@asvetlov are you thinking something like the patch attached?

--
keywords: +patch
Added file: 
https://bugs.python.org/file48697/0001-Add-a-deprectation-warning-for-queue-w-o-event-runni.patch

___
Python tracker 

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



[issue38599] Deprecate creation of asyncio object when the loop is not running

2019-11-06 Thread Emmanuel Arias


Change by Emmanuel Arias :


--
nosy: +eamanu

___
Python tracker 

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



[issue38716] logging: rotating handlers set namer and rotator null

2019-11-06 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset 519cb8772a9745b1c7d8218cabcd2f96ceda4d62 by Vinay Sajip (l0rb) in 
branch 'master':
bpo-38716: stop rotating handlers from setting inherited namer and rotator to 
None (GH-17072)
https://github.com/python/cpython/commit/519cb8772a9745b1c7d8218cabcd2f96ceda4d62


--

___
Python tracker 

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



[issue36906] Compile time textwrap.dedent() equivalent for str or bytes literals

2019-11-06 Thread Marco Sulla


Marco Sulla  added the comment:

If I can say my two cents:

1. I preferred that the default behaviour of multi-line was to dedent. But 
breaking old code, even if for a little percentage of code, IMHO is never a 
good idea. Py2->Py3 should have proved it.

2. ``` remembers me too much the Markdown for add a code block, not a text block

3. yes, the new prefix is really useless, because it's significant only for 
multiline strings. Anyway, if this solution is accepted, I propose `t` for 
`trim`.

--
nosy: +Marco Sulla

___
Python tracker 

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



[issue36906] Compile time textwrap.dedent() equivalent for str or bytes literals

2019-11-06 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I think it would be better to use use backtick quotes for f-strings instead of 
the f prefix. This would stress the special nature of f-strings (they are not 
literals, but expressions). But there was strong opposition to using backticks 
anywhere in Python syntax.

--

___
Python tracker 

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



[issue36906] Compile time textwrap.dedent() equivalent for str or bytes literals

2019-11-06 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Another option not using a new letter: A triple-backtick token.


def foo():
value = ```this is a
 
long multi line string i don't want indented.
```

A discuss thread was started so I reconnected it with this issue.  See
 https://discuss.python.org/t/trimmed-multiline-string/2600/8

--

___
Python tracker 

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



[issue38727] setup.py sdist --format=gztar should use (equivalent of) `gzip -n`

2019-11-06 Thread Zack Weinberg


New submission from Zack Weinberg :

Recent versions of the gzip command-line utility have an option `-n` which 
causes it to omit the FNAME field of the gzip file header, and write out the 
MTIME field as zero.  Both of these properties are desirable when constructing 
reproducible build artifacts (see https://reproducible-builds.org/ ).

An sdist tarball is a build artifact and it should be created as reproducibly 
as possible.  In particular, --format=gztar should behave as-if `gzip -n` were 
in use.  (The stdlib's gzip module can produce output equivalent to what gzip 
-n does, but this is not currently documented nor is it accessible via 
`tarfile`.  Both of those should be easy fixes.  See bug 38725 and bug 38726.)

--
components: Distutils
messages: 356152
nosy: dstufft, eric.araujo, zwol
priority: normal
severity: normal
status: open
title: setup.py sdist --format=gztar should use (equivalent of) `gzip -n`

___
Python tracker 

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



[issue38726] Add equivalent of `gzip -n` (omit timestamp and original file name) to tarfile module's auto-compression support

2019-11-06 Thread Zack Weinberg


New submission from Zack Weinberg :

Recent versions of the gzip command-line utility have an option `-n` which 
causes it to omit the FNAME field of the gzip file header, and write out the 
MTIME field as zero.  Both of these properties are desirable when constructing 
reproducible build artifacts (see https://reproducible-builds.org/ ).

Right now, it's possible to get the `gzip` module to do the same thing (it's 
not documented, but it's possible; see bug 38725) but, as far as I can tell, if 
you use `tarfile`'s "w:gz" or "w|gz" modes you will always get a timestamp and 
a filename in the output.  Please add `w[:|]gzn`, or something like that, that 
behaves as-if the output were piped through `gzip -n`.

(It might make sense to remove the manual creation of a gzip file header from 
the tarfile module at the same time; it looks like this code predates the 
addition of the gzip module to the stdlib.)

--
messages: 356151
nosy: zwol
priority: normal
severity: normal
status: open
title: Add equivalent of `gzip -n` (omit timestamp and original file name) to 
tarfile module's auto-compression support

___
Python tracker 

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



[issue38725] Documented equivalent of `gzip -n` (omit timestamp and original file name) in gzip module

2019-11-06 Thread Zack Weinberg


New submission from Zack Weinberg :

Recent versions of the gzip command-line utility have an option `-n` which 
causes it to omit the FNAME field of the gzip file header, and write out the 
MTIME field as zero.  Both of these properties are desirable when constructing 
reproducible build artifacts (see https://reproducible-builds.org/ ).

Right now, the gzip module lets you set MTIME to zero explicitly by passing 
`mtime=0` to the GzipFile constructor, but this is not documented.  You can 
avoid writing out a filename by opening the output file yourself:

with gzip.GzipFile(fileobj=open("foo.gz", "wb"),
   filename='', mtime=0) as ofp:
... write to ofp ...

but that's awkward and, again, not documented.  I'd like to be able to write 
something like this instead:

with gzip.open("foo.gz", mtime=0, record_filename=False) as ofp:

with this being the documented way to achieve the same effect as `gzip -n`.

--
components: Library (Lib)
messages: 356150
nosy: zwol
priority: normal
severity: normal
status: open
title: Documented equivalent of `gzip -n` (omit timestamp and original file 
name) in gzip module

___
Python tracker 

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



[issue38724] Implement subprocess.Popen.__repr__

2019-11-06 Thread Ammar Askar


Change by Ammar Askar :


--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue38724] Implement subprocess.Popen.__repr__

2019-11-06 Thread Ram Rachum


Change by Ram Rachum :


--
nosy: +taleinat

___
Python tracker 

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



[issue38724] Implement subprocess.Popen.__repr__

2019-11-06 Thread Ram Rachum


New submission from Ram Rachum :

I was working with a Popen object recently in the shell and it was annoying to 
see the `` display. It would be nice to get some 
kind of minimal detail about the Popen, for example its args and return code, 
if finished.

--
components: Library (Lib)
messages: 356149
nosy: cool-RR, pitrou
priority: normal
severity: normal
status: open
title: Implement subprocess.Popen.__repr__
type: enhancement
versions: Python 3.9

___
Python tracker 

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



[issue38692] add a pidfd child process watcher

2019-11-06 Thread STINNER Victor


STINNER Victor  added the comment:

Would it be useful to use a pidfd in subprocess.Popen to fix bpo-38630 root 
issue, when pidfd is available?

--

___
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

2019-11-06 Thread Daniel King


Change by Daniel King :


--
nosy: +Daniel King

___
Python tracker 

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



[issue16575] ctypes: unions as arguments

2019-11-06 Thread Ammar Askar


Ammar Askar  added the comment:

Will close after 
https://buildbot.python.org/all/#/builders?tags=%2Brefleak=%2B3.7 go back 
to green.

--

___
Python tracker 

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



[issue38583] The activate script in Windows is not correct for venvs created in git-bash

2019-11-06 Thread Mo


Mo  added the comment:

I had also tested with pathlib and posixpath and come to the same conclusion.

As suggested by you, I looked into `activate` determining path when run. I 
believe this should do the trick (My bashfoo isn't strong, this is mostly from 
https://stackoverflow.com/a/179231):

pushd . > /dev/null
SCRIPT_PATH="${BASH_SOURCE[0]}"
if ([ -h "${SCRIPT_PATH}" ]); then
  while([ -h "${SCRIPT_PATH}" ]); do cd `dirname "$SCRIPT_PATH"`; 
  SCRIPT_PATH=`readlink "${SCRIPT_PATH}"`; done
fi
cd `dirname ${SCRIPT_PATH}` > /dev/null
cd .. > /dev/null
SCRIPT_PATH=`pwd`;
popd  > /dev/null

VIRTUAL_ENV="$SCRIPT_PATH"

--

___
Python tracker 

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



[issue38722] runpy should use io.open_code() instead of open()

2019-11-06 Thread Dominic Littlewood


New submission from Dominic Littlewood <11dlittlew...@gmail.com>:

Fairly obviously, if you're using something called runpy you're probably trying 
to run some code. To do this it has to open the script as a file.

This is similar to two other issues I'm posting, but they're in different 
modules, so different bugs.

--
components: Library (Lib)
messages: 356144
nosy: plokmijnuhby
priority: normal
severity: normal
status: open
title: runpy should use io.open_code() instead of open()
type: security
versions: Python 3.9

___
Python tracker 

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



[issue38723] Pdb._runscript should use io.open_code() instead of open()

2019-11-06 Thread Dominic Littlewood


New submission from Dominic Littlewood <11dlittlew...@gmail.com>:

Fairly obviously, if you're using something called _runscript you're probably 
trying to run some code. To do this it has to open the script as a file.

This is similar to two other issues I'm posting, but they're in different 
modules, so different bugs.

--
messages: 356145
nosy: plokmijnuhby
priority: normal
severity: normal
status: open
title: Pdb._runscript should use io.open_code() instead of open()

___
Python tracker 

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



[issue38723] Pdb._runscript should use io.open_code() instead of open()

2019-11-06 Thread Dominic Littlewood


Change by Dominic Littlewood <11dlittlew...@gmail.com>:


--
components: +Library (Lib)
type:  -> security
versions: +Python 3.9

___
Python tracker 

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



[issue38721] modulefinder should use io.open_code() instead of open()

2019-11-06 Thread Dominic Littlewood


New submission from Dominic Littlewood <11dlittlew...@gmail.com>:

modulefinder currently will detect modules imported by a script dynamically by 
running the script, and to do this it has to open the script as a file.

This would also fix what appears to be a bug where modulefinder failed to open 
files in bytes mode sometimes, causing it to fail for some modules (like 
functools) if the wrong encoding is used. I say "appears to be", because the 
structure of the module seems to imply this was intended behaviour, but I can't 
think why anyone would want this.

This is similar to two other issues I'm posting, but they're in different 
modules, so different bugs.

--
components: Library (Lib)
messages: 356143
nosy: plokmijnuhby
priority: normal
severity: normal
status: open
title: modulefinder should use io.open_code() instead of open()
type: security
versions: Python 3.9

___
Python tracker 

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



[issue38716] logging: rotating handlers set namer and rotator null

2019-11-06 Thread lorb


lorb  added the comment:

I have changed the PR accordingly.

Am Mi., 6. Nov. 2019 um 16:36 Uhr schrieb Vinay Sajip :
>
>
> Vinay Sajip  added the comment:
>
> > Would you consider it more acceptable to just turn
> them into class level attributes of BaseRotatingHandler instead of
> setting them in init?
>
> Yes, that would be better.
>
> --
>
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue16575] ctypes: unions as arguments

2019-11-06 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset 484edbf9bf1a9e6bae0fcb10a0c165b89ea79295 by Vinay Sajip (Ammar 
Askar) in branch '3.7':
bpo-16575: Fix refleak on passing unions in ctypes (GH-17064)
https://github.com/python/cpython/commit/484edbf9bf1a9e6bae0fcb10a0c165b89ea79295


--

___
Python tracker 

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



[issue38716] logging: rotating handlers set namer and rotator null

2019-11-06 Thread Vinay Sajip


Vinay Sajip  added the comment:

> Would you consider it more acceptable to just turn
them into class level attributes of BaseRotatingHandler instead of
setting them in init?

Yes, that would be better.

--

___
Python tracker 

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



[issue38696] HTTP modules documentation error

2019-11-06 Thread Stojan Jovic


Stojan Jovic  added the comment:

Thank you, guys, for really quick fix!

--

___
Python tracker 

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



[issue38720] Logging failure with timestamp messages

2019-11-06 Thread xtobes


New submission from xtobes :

This only happings on Windows, the scripts runs some seconds and then stops and 
exit with: Process finished with exit code -1073740940 (0xC374). This 
happens when the format variable of a logging config object contains the 
identifier '%(asctime)s'.

--
components: Windows
messages: 356138
nosy: paul.moore, steve.dower, tim.golden, xtobes, zach.ware
priority: normal
severity: normal
status: open
title: Logging failure with timestamp messages
type: crash
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



[issue38696] HTTP modules documentation error

2019-11-06 Thread Zachary Ware


Zachary Ware  added the comment:

Thanks for the report, Stojan, and for the patch, Ammar!

--
nosy: +ammar2
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
type: resource usage -> behavior
versions: +Python 3.7, Python 3.9

___
Python tracker 

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



[issue38696] HTTP modules documentation error

2019-11-06 Thread miss-islington


miss-islington  added the comment:


New changeset 91f4b9282fe7cdc51c6612002d033da654f422c1 by Miss Islington (bot) 
in branch '3.7':
bpo-38696: Fix usage example of HTTPStatus (GH-17066)
https://github.com/python/cpython/commit/91f4b9282fe7cdc51c6612002d033da654f422c1


--

___
Python tracker 

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



[issue38696] HTTP modules documentation error

2019-11-06 Thread miss-islington


miss-islington  added the comment:


New changeset 30da387df193b9f05c2891ae601ae5a1d669a5c1 by Miss Islington (bot) 
in branch '3.8':
bpo-38696: Fix usage example of HTTPStatus (GH-17066)
https://github.com/python/cpython/commit/30da387df193b9f05c2891ae601ae5a1d669a5c1


--
nosy: +miss-islington

___
Python tracker 

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



[issue37645] Replace PyEval_GetFuncName/PyEval_GetFuncDesc

2019-11-06 Thread Petr Viktorin


Petr Viktorin  added the comment:

With this change, CPython no longer uses PyEval_GetFuncName/PyEval_GetFuncDesc 
internally.
Shall we deprecate/discourage them?
Shall we expose PyObject_FunctionStr publicly?

--

___
Python tracker 

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



[issue38159] PyState_AddModule docs should say that it's not necessary to call it.

2019-11-06 Thread Petr Viktorin


Change by Petr Viktorin :


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



[issue35381] posixmodule: convert statically allocated types (DirEntryType & ScandirIteratorType) to heap-allocated types

2019-11-06 Thread Petr Viktorin


Petr Viktorin  added the comment:

The module still uses tp_new directly, so it's not limited to only stable ABI, 
but that's for another issue.

Thanks for the contribution!

--
nosy: +petr.viktorin
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



[issue38683] Installation failed - no privileges to access directory

2019-11-06 Thread Steve Dower


Steve Dower  added the comment:

To change the install location to Program Files, you should select the "Install 
for All Users" option at the top of the page where you modified the install 
location. This will cause the installer to elevate.

Generic access errors should not trigger elevation - we have to treat them as 
an error.

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

___
Python tracker 

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



[issue38704] Prevent installation on unsupported Windows versions

2019-11-06 Thread Steve Dower


Steve Dower  added the comment:

We can, and we probably should, but it's not a high priority.

Technically the download page is correct, but updating it to specify Windows 
Vista as the 3.8 cutoff (and for 3.9, Windows 8.1) won't hurt.

--
stage:  -> needs patch
title: No `GetActiveProcessorCount` on Windows Vista -> Prevent installation on 
unsupported Windows versions
type:  -> enhancement
versions: +Python 3.9

___
Python tracker 

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



[issue38719] Surprising and possibly incorrect passing of InitVar to __post_init__ method of data classes

2019-11-06 Thread Eric V. Smith


Eric V. Smith  added the comment:

I don't think that's necessary. We should just document that parameters are 
passed by name to __post_init__. This would have to be a 3.9 feature, since 
it's not strictly backward compatible.

--
versions: +Python 3.9 -Python 3.7

___
Python tracker 

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



[issue38719] Surprising and possibly incorrect passing of InitVar to __post_init__ method of data classes

2019-11-06 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Should we also be checking for __post_init__ to have positional only arguments 
/ syntax in the signature. I tried a simple fix of f.name + "=" + f.name to 
pass them as keyword always where current tests and reported example passes but 
with positional arguments it could be a problem.

https://github.com/python/cpython/blob/5c0c325453a175350e3c18ebb10cc10c37f9595c/Lib/dataclasses.py#L516

--
nosy: +xtreak

___
Python tracker 

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



[issue38719] Surprising and possibly incorrect passing of InitVar to __post_init__ method of data classes

2019-11-06 Thread Eric V. Smith


Eric V. Smith  added the comment:

I think using named parameters in the call to __post_init__ is reasonable. It's 
currently positional.

--
assignee:  -> eric.smith

___
Python tracker 

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



[issue38703] should we expect round(0.95, 1) to be 1.0, instead of 0.9?

2019-11-06 Thread Mark Dickinson


Mark Dickinson  added the comment:

[Steven]

py> '%.17f' % 0.95
'0.94996'

That's tricky to use correctly: it's not a priori clear how many digits after 
the point are needed to give you a faithful representation (the "17" in "%.17f" 
isn't going to be the right thing for most values). You really want to specify 
the number of significant digits rather than the number of places after the 
point, and even then there are going to be cases where 17 significant digits 
aren't enough to show you which side of a tie the exact value lies.

--

___
Python tracker 

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



[issue38719] Surprising and possibly incorrect passing of InitVar to __post_init__ method of data classes

2019-11-06 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +eric.smith

___
Python tracker 

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



[issue38706] What should the error message in the exception raised by assertTrue and assertFalse be?

2019-11-06 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

If there is anything wrong with terms "true" and "false" (I don't know), we 
should fix this not only in one particular place, but everywhere. If there is 
nothing wrong with them, there is nothing to "improve". If this depends of the 
context, we should consider every occurrence case by case. Hope PR 17073 will 
help with this. It marks 665 of possible bugs so you can easily review these 
changes.

--

___
Python tracker 

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



[issue38719] Surprising and possibly incorrect passing of InitVar to __post_init__ method of data classes

2019-11-06 Thread Aaron Ecay


New submission from Aaron Ecay :

I have discovered that InitVar's are passed in a surprising way to the 
__post_init__ method of python dataclasses.  The following program illustrates 
the problem:

=

from dataclasses import InitVar, dataclass

@dataclass
class Foo:
bar: InitVar[str]
quux: InitVar[str]

def __post_init__(self, quux: str, bar: str) -> None:
print(f"bar is {bar}; quux is {quux}")

Foo(bar="a", quux="b")

=

The output (on python 3.7.3 and 3.8.0a3) is (incorrectly):

bar is b; quux is a

This behavior seems like a bug to me, do you agree?

I have not looked into the reason why it behaves this way, but I suspect that 
the InitVar args are passed positionally, rather than as key words, to 
__post_init__.  This requires the order of arguments in the definition of 
__post_init__ to be identical to the order in which they are specified in the 
class.  I would expect the arguments to be passed as keywords instead, which 
would remove the ordering dependency.  If there is agreement that the current 
behavior is undesirable, I can look into creating a patch to change it.

--
components: Library (Lib)
messages: 356125
nosy: Aaron Ecay
priority: normal
severity: normal
status: open
title: Surprising and possibly incorrect passing of InitVar to __post_init__ 
method of data classes
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



[issue38706] What should the error message in the exception raised by assertTrue and assertFalse be?

2019-11-06 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

I have tried sending this message by email twice, and both times it seems to 
have disappeared. So I'm commenting via the web, and my apologies in advance if 
the message shows up later.

*

> There are almost 500 occurrences of "is true".

We can worry about them if and when somebody raises them as a "bug
report" or feature request. Without reading each one in context, I have
no idea whether they are good, bad or indifferent. Doing a massive
search and replace would be a bad idea.

Right now we have a simple feature request: improve the assertTrue and
assertFalse messages. There is a simple way to improve them. We don't
have to touch any other message, just these two.

Personally, I prefer "truthy and falsey" or "true-like and false-like"
over "true and false" to distinguish between "duck-typed bools" and the
actual bool singletons True and False. But I don't prefer them enough to
fight over the terms. If you prefer "true and false", that's okay with
me too :-)

"False is not true" suggests to the user that the test is doing an
identity check. We have proof from the OP's bug report that at least one
person thought that. I had to read the source code to check that it doesn't.

A better failure message would be helpful to make it clear that it
checks by value not identity ``if value is True``.

--

___
Python tracker 

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



[issue38708] parse_message_id in email module is very buggy / crashy

2019-11-06 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
components: +email
nosy: +barry, maxking, r.david.murray
type:  -> behavior

___
Python tracker 

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



[issue38708] parse_message_id in email module is very buggy / crashy

2019-11-06 Thread Dimitri John Ledkov


Dimitri John Ledkov  added the comment:

Yes, issue38698 covers the UnboundLocalError,

but doesn't cover inside get_msg_id there is also this gem:

def get_msg_id(value):
msg_id = MsgID()
if value[0] in CFWS_LEADER:

It should test value before accessing value[0] like it is done in other places, 
ie.:

if value and value[0] in CFWS_LEADER:

or indent the whole block to iterate over value with:

while value:
...

which also tests that value has [0] index.

I guess I want to repurpose this issue for the value[0] indexerror in 
get_msg_id().

--

___
Python tracker 

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



[issue38718] query of global metadata options delivers error messages even when successful

2019-11-06 Thread Arno-Can Uestuensoez


Change by Arno-Can Uestuensoez :


--
title: query of global options delivers error messages even when successful -> 
query of global metadata options delivers error messages even when successful

___
Python tracker 

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



[issue38718] query of global options delivers error messages even when successful

2019-11-06 Thread Arno-Can Uestuensoez


New submission from Arno-Can Uestuensoez :

The 'setup.py' interface offers some global options, which could be queried. 
For example among numerous others the 'classifiers'.

The current implementation displays for example for the following call::

   python setup.py --description

The result::

  (3.8.0) $ python setup.py --description
   
   usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
  or: setup.py --help [cmd1 cmd2 ...]
  or: setup.py --help-commands
  or: setup.py cmd --help

   error: no commands supplied
   (3.8.0) $ echo $?
   1
   (3.8.0) $


I would like to propose some minor enhancements here.

1. The error message is here an error itself, because the
   query was flawless successful.

   This is due to the implementation by relying on an
   exception for the termination condition, when no
   command was given. This is for the global query options
   for the global metadata perfectly allright.

   Thus the error message must not occur.

2. The resulting exit code of '1' is due to the same execption
   for the missing command.

   Thus the exit code must be '0' on Posix based and alike
   systems.

3. The usage message, which is also based on a private method,
   is basically an error itself. This is due to the fact, that
   actually nothing has failed.

   Thus the usage message must not be displayed here.

4. I also would like to propose some layout enhancements at
   this occasion.

   The  value of the queried attribute - here the description,
   should be separated by a .
   E.g. by 'USAGE', or 'global_+usage()' within 'distutils.core'.

   The resulting layout and exit value  would be:

  (3.8.0) $ python setup.py --description

  

  (3.8.0) $ echo $?
  0
  (3.8.0) $

--
components: Distutils
messages: 356122
nosy: acue, dstufft, eric.araujo
priority: normal
severity: normal
status: open
title: query of global options delivers error messages even when successful
type: behavior
versions: Python 2.7, Python 3.5, 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



[issue38716] logging: rotating handlers set namer and rotator null

2019-11-06 Thread lorb


lorb  added the comment:

This PR certainly does not turn them into methods. I believe it also
doesn't encourage the idea that they would have to be. All it does is
preventing __init__ from setting them to None in the case they are
defined as methods. Would you consider it more acceptable to just turn
them into class level attributes of BaseRotatingHandler instead of
setting them in init?

--

___
Python tracker 

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



[issue38706] What should the error message in the exception raised by assertTrue and assertFalse be?

2019-11-06 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I pretty strongly dislike 'truthy' and 'falsey'.  They look slangy and 
https://en.wiktionary.org/wiki/truthy gives the main meaning as 
  (US, colloquial) Only superficially true; ...

The computer language usage is credited to Javascript here and some other sites 
(with the same meaning as in Python).

To be a bit pedantic, the current failure message for assertTrue(x) appears to 
be f'{repr(x)} is not true'.

Exception messages are English phrases and sentences, not Python code, so 'is' 
in exception messages is always the English 'is', as in
  NameError: name 'true' is not defined
I do not see any ambiguity.  Somewhat ironically, the original suggestion 
'False is not True', which should better be written ' is not True' *could* 
be misinterpreted as code.

'x does not evaluate to true' strikes me as wrong because in this context, the 
evaluation by calling bool(x) is to True or False, not 'true' or 'false'.

'assertTrue' is an abbreviation for something like 'assertBoolTrue(x)' or more 
properly, assert_bool(x)_is_True.  A correct failure message, correct both as 
English and Python, should be something like 'bool(x) is not True'.  I see 'x 
is not true' as an informal English equivalent of the full claim.  Perhaps this 
should be better explained somewhere in the doc.  I do not really see 'x is not 
a true value' as adding anything.

We don't usually change exception messages in bugfix releases unless the 
message is buggy, as in actively misleading.  I also think making a change 
would need discussion on pydev.

--
nosy:  -eric.smith, vinay.sajip
versions: +Python 3.9 -Python 3.8

___
Python tracker 

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



[issue38716] logging: rotating handlers set namer and rotator null

2019-11-06 Thread Vinay Sajip


Vinay Sajip  added the comment:

They can be methods, but don't need to be. In my example, I showed how you can 
set the namer and rotator attributes to methods which do have access to self. I 
don't want to encourage the idea that namer and rotator *have* to be methods 
that have to be overridden. You can do this in your own code, but I don't 
especially want to encourage that way of doing things - which is why I 
specifically didn't make them (namer and rotator) methods.

--

___
Python tracker 

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



[issue38717] csv DictWriter's internal _dict_to_list raise error unsupported operand

2019-11-06 Thread Patrick Schneeweiß

Patrick Schneeweiß  added the comment:

Sorry guys, it was an issue with the cusotm Splunk Library. They treated the 
keys Method a little different.

Thanks all for the hints.

Will close this

--
resolution:  -> third party
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



[issue38706] What should the error message in the exception raised by assertTrue and assertFalse be?

2019-11-06 Thread Eric V. Smith


Change by Eric V. Smith :


--
nosy: +eric.smith

___
Python tracker 

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



[issue38716] logging: rotating handlers set namer and rotator null

2019-11-06 Thread lorb


lorb  added the comment:

Thanks for the review and response. I don't understand yet why not to
allow the following while keeping the existing functionality. This
could also be achieved by turning the namer and rotator into class
attributes. I recently created a subclass of the timed rotating
handler where it is beneficial for the handler to be able to access to
self to use the rollover time in the naming.

class MyHandler(BaseRotatingHandler):
def namer(self, default_name):
return default_name  # or whatever you want here

def rotator(self, source, dest):
os.rename(source, dest)  # or whatever you want here

Am Mi., 6. Nov. 2019 um 11:35 Uhr schrieb Vinay Sajip :
>
>
> Vinay Sajip  added the comment:
>
> The namer and rotator attributes are callables, not methods to be overridden. 
> You can certainly do this with methods and set them accordingly:
>
> class MyHandler(BaseRotatingHandler):
> def __init__(self, *args, **kwargs):
> super(MyHandler, self).__init__(*args, **kwargs)
> self.namer = self.my_namer
> self.rotator = self.my_rotator
>
> def my_namer(self, default_name):
> return default_name  # or whatever you want here
>
> def my_rotator(self, source, dest):
> os.rename(source, dest)  # or whatever you want here
>
> Having namer and rotator be callables avoids the need to subclass a handler 
> just to override naming and rotating functionality. So, I think this issue 
> should be closed as "not a bug", and the corresponding PR closed. Thanks for 
> your effort, though - I just think you may have misunderstood the intent of 
> the design.
>
> --
> nosy: +vinay.sajip
>
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue38717] csv DictWriter's internal _dict_to_list raise error unsupported operand

2019-11-06 Thread Patrick Schneeweiß

Patrick Schneeweiß  added the comment:

Ok in a new sample Script it is working. 

As I used my normal script in a software called Splunk, I saw they are using a 
custom class OrderedDict.

I will take a look on this first.

--

___
Python tracker 

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



[issue38717] csv DictWriter's internal _dict_to_list raise error unsupported operand

2019-11-06 Thread Patrick Schneeweiß

Patrick Schneeweiß  added the comment:

Hello all,

This is my dict:
{'rule': 'WAN-2-Web|unknown (Barracuda Networks CloudGen Firewall)', 'April 
(2018)': '', 'May (2018)': '', 'June (2018)': '', 'July (2018)': '', 'August 
(2018)': '', 'April (2019)': '', 'May (2019)': '14', 'June (2019)': '', 'July 
(2019)': '', 'August (2019)': ''}

And this was my fieldnames list:
['rule', 'April (2018)', 'May (2018)', 'June (2018)', 'July (2018)', 'August 
(2018)', 'April (2019)', 'May (2019)', 'June (2019)', 'July (2019)', 'August 
(2019)']


when I call the keys Method on this dict, I receive this:
dict_keys(['rule', 'April (2018)', 'May (2018)', 'June (2018)', 'July (2018)', 
'August (2018)', 'April (2019)', 'May (2019)', 'June (2019)', 'July (2019)', 
'August (2019)'])

--

___
Python tracker 

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



[issue38706] What should the error message in the exception raised by assertTrue and assertFalse be?

2019-11-06 Thread Vinay Sajip


Vinay Sajip  added the comment:

I also feel that lower case true and false are synonymous with any truthy and 
falsey values, as I'm sure many others do, so things in this area should in 
general stay as they are. Certainly -1 for a search-and-replace approach!

--
nosy: +vinay.sajip

___
Python tracker 

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



[issue38717] csv DictWriter's internal _dict_to_list raise error unsupported operand

2019-11-06 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Can you please attach a sample script to reproduce the behavior difference? 
With below script a dictionary is passed then dict.keys() supports subtraction 
over a list to return the difference. I am not sure how you have received a 
list with dict.keys() in Python 3.7.

import csv

fields = ["c", "d"]
with open('test.csv', 'w') as f:
writer = csv.DictWriter(f, fieldnames=fields, extrasaction='raise')
writer.writeheader()
writer.writerow({"n": 1})

--
nosy: +xtreak

___
Python tracker 

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



[issue38716] logging: rotating handlers set namer and rotator null

2019-11-06 Thread Vinay Sajip


Vinay Sajip  added the comment:

The namer and rotator attributes are callables, not methods to be overridden. 
You can certainly do this with methods and set them accordingly:

class MyHandler(BaseRotatingHandler):
def __init__(self, *args, **kwargs):
super(MyHandler, self).__init__(*args, **kwargs)
self.namer = self.my_namer
self.rotator = self.my_rotator

def my_namer(self, default_name):
return default_name  # or whatever you want here

def my_rotator(self, source, dest):
os.rename(source, dest)  # or whatever you want here

Having namer and rotator be callables avoids the need to subclass a handler 
just to override naming and rotating functionality. So, I think this issue 
should be closed as "not a bug", and the corresponding PR closed. Thanks for 
your effort, though - I just think you may have misunderstood the intent of the 
design.

--
nosy: +vinay.sajip

___
Python tracker 

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



[issue38717] csv DictWriter's internal _dict_to_list raise error unsupported operand

2019-11-06 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I guess you try to write not a dict, but an object whose keys() method returns 
a list.

--
nosy: +rhettinger, serhiy.storchaka

___
Python tracker 

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



[issue38706] What should the error message in the exception raised by assertTrue and assertFalse be?

2019-11-06 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +16583
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/17073

___
Python tracker 

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



[issue38717] csv DictWriter's internal _dict_to_list raise error unsupported operand

2019-11-06 Thread Patrick Schneeweiß

New submission from Patrick Schneeweiß :

I switched over to Python 3.7 and still using my csv DictWriter.

No I'm receiving an error when calling the writerow() method. 
unsupported operand type(s) for -: 'list' and 'list'

Digging deeped in the problem I found out, that the internal 
_dict_to_list(self, rowdict) method works different compared to Python 2.7
It tries to substract the fieldnames list and the keys of the dict to find keys 
not included.

But substracting lists is not possible. As a workaround I defined the 
Dictwriter with the option extrasaction="ignore".

I would be better to use the method like in Python 2.7. I will output my 
versions of the method:

Python 3.7:
def _dict_to_list(self, rowdict):
if self.extrasaction == "raise":
wrong_fields = rowdict.keys() - self.fieldnames
if wrong_fields:
raise ValueError("dict contains fields not in fieldnames: "
 + ", ".join([repr(x) for x in wrong_fields]))
return (rowdict.get(key, self.restval) for key in self.fieldnames)

Python 2.7:
def _dict_to_list(self, rowdict):
if self.extrasaction == "raise":
wrong_fields = [k for k in rowdict if k not in self.fieldnames]
if wrong_fields:
raise ValueError("dict contains fields not in fieldnames: "
 + ", ".join([repr(x) for x in wrong_fields]))
return [rowdict.get(key, self.restval) for key in self.fieldnames]

--
components: Library (Lib)
messages: 356110
nosy: afflictor
priority: normal
severity: normal
status: open
title: csv DictWriter's internal _dict_to_list raise error unsupported operand
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



[issue38708] parse_message_id in email module is very buggy / crashy

2019-11-06 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

This seems to be the same as issue38698.

--
nosy: +xtreak

___
Python tracker 

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



[issue38698] While parsing email message id: UnboundLocalError

2019-11-06 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

This was also reported in issue38708 with the original code added in 
issue35805. Commenting out the except clause also doesn't raise any error in 
test suite so I assume the code path was not tested. Maybe the script could be 
added as part of the test suite.

$ git diff
diff --git a/Lib/email/_header_value_parser.py 
b/Lib/email/_header_value_parser.py
index 1668b4a14e..9b6ca3a268 100644
--- a/Lib/email/_header_value_parser.py
+++ b/Lib/email/_header_value_parser.py
@@ -2110,10 +2110,10 @@ def parse_message_id(value):
 message_id = MessageID()
 try:
 token, value = get_msg_id(value)
+message_id.append(token)
 except errors.HeaderParseError:
 message_id.defects.append(errors.InvalidHeaderDefect(
 "Expected msg-id but found {!r}".format(value)))
-message_id.append(token)
 return message_id

 #

--
versions: +Python 3.9

___
Python tracker 

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



[issue38716] logging: rotating handlers set namer and rotator null

2019-11-06 Thread lorb


Change by lorb :


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

___
Python tracker 

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



[issue38716] logging: rotating handlers set namer and rotator null

2019-11-06 Thread lorb


New submission from lorb :

When subclassing the rotating handlers of the logging module and implementing a 
namer or rotator method they are silently set to None in __init__. This is 
surprising behaviour and currently the set a specific namer or rotator it is 
required to create an instance first and than set them.

--
messages: 356107
nosy: lorb
priority: normal
severity: normal
status: open
title: logging: rotating handlers set namer and rotator null

___
Python tracker 

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



[issue38656] mimetypes for python 3.7.5 fails to detect matroska video

2019-11-06 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

It seems that there is a list of files from which the mime types are also added 
at 
https://github.com/python/cpython/blob/5c0c325453a175350e3c18ebb10cc10c37f9595c/Lib/mimetypes.py#L42.
 "video/x-matroska" is not present in CPython repo's list of suffixes so it 
should be inferring from the list of known files. Can you please run the below 
script on 3.7.4 and 3.7.5 on the same machine? I am using Mac and 3.7.4 and 
3.7.5 report video/x-matroska correctly.

import mimetypes
print(mimetypes.guess_type('E01.mkv'))
print(mimetypes.types_map['.mkv'])

--

___
Python tracker 

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



[issue38715] Regression in compileall ddir parameter when recursing

2019-11-06 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue38706] What should the error message in the exception raised by assertTrue and assertFalse be?

2019-11-06 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

There are almost 500 occurrences of "is true".

--

___
Python tracker 

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



[issue38706] What should the error message in the exception raised by assertTrue and assertFalse be?

2019-11-06 Thread Ammar Askar


Ammar Askar  added the comment:

I don't think the word "true" is really the issue here. It's the fact that "is" 
in this context is ambiguous, is it referring to the English "is" or the python 
operator `is`?

--

___
Python tracker 

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



[issue38706] What should the error message in the exception raised by assertTrue and assertFalse be?

2019-11-06 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I am not English expert, but traditionally "true" is used as a synonym of a 
truthy value everywhere in the Python documentation and code. There are almost 
2000 occurrences. If it is a wrong word, it should be fixed in all these cases.

--
nosy: +ezio.melotti, michael.foord, r.david.murray, rbcollins, terry.reedy

___
Python tracker 

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



  1   2   >