[issue29847] Path takes and ignores **kwargs

2017-03-19 Thread Jim Fasarakis-Hilliard

Changes by Jim Fasarakis-Hilliard :


--
nosy: +Jim Fasarakis-Hilliard

___
Python tracker 

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



[issue29855] The traceback compounding of RecursionError fails to work with __get__

2017-03-19 Thread Xiang Zhang

Changes by Xiang Zhang :


--
nosy: +ebarry, ncoghlan

___
Python tracker 

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



[issue29856] curses online documentation typo

2017-03-19 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Typo fixed and backported into 2.7, 3.5 and 3.6.
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



[issue29855] The traceback compounding of RecursionError fails to work with __get__

2017-03-19 Thread Jim Fasarakis-Hilliard

Jim Fasarakis-Hilliard added the comment:

I'm pretty sure this is by design; the change introduced in [1] tried to keep 
things simple by only trimming the output when the lines were identical. More 
complicated scenarios are trickier to implement.

It should be interesting to see if the core-devs believe a change like this is 
warranted, though.

[1]: https://bugs.python.org/issue26823

--
components: +Interpreter Core
nosy: +Jim Fasarakis-Hilliard
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



[issue29856] curses online documentation typo

2017-03-19 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +646

___
Python tracker 

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



[issue29856] curses online documentation typo

2017-03-19 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +647

___
Python tracker 

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



[issue29856] curses online documentation typo

2017-03-19 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +645

___
Python tracker 

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



[issue29856] curses online documentation typo

2017-03-19 Thread Jim Fasarakis-Hilliard

Jim Fasarakis-Hilliard added the comment:

Nice catch, that's a typo indeed. If you'd like, submit a PR [see 
https://docs.python.org/devguide/#quick-start] to address this.

--
nosy: +Jim Fasarakis-Hilliard

___
Python tracker 

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



[issue29856] curses online documentation typo

2017-03-19 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Thanks for the report, Raphael.
And thanks Jim, I made a PR just as you commented :)

--
assignee: docs@python -> Mariatta
nosy: +Mariatta
stage:  -> patch review
versions: +Python 2.7, Python 3.5, Python 3.6

___
Python tracker 

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



[issue29856] curses online documentation typo

2017-03-19 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +644

___
Python tracker 

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



[issue29856] curses online documentation typo

2017-03-19 Thread Raphael McSinyx

New submission from Raphael McSinyx:

I think there is a typo in curses online documentation about key constants:

https://docs.python.org/3.7/library/curses.html#constants

The key KEY_SEXIT is described as `Shifted Dxit' while I think that should be 
`Shifted Exit'.

--
assignee: docs@python
components: Documentation
messages: 289868
nosy: McSinyx, docs@python
priority: normal
severity: normal
status: open
title: curses online documentation typo
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



[issue29855] The traceback compounding of RecursionError fails to work with __get__

2017-03-19 Thread assume_away

New submission from assume_away:

class Property:
def __init__(self, getter):
self.getter = getter

def __get__(self, instance, cls):
return self.getter(cls if instance is None else instance)

class MyClass:
@Property
def something(cls):
return cls.something

Calling MyClass.something will show all 990+ RecursionError message.

--
messages: 289867
nosy: assume_away
priority: normal
severity: normal
status: open
title: The traceback compounding of RecursionError fails to work with __get__
type: behavior
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



[issue29116] Make str and bytes error messages on concatenation conform with other sequences

2017-03-19 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

Something is strange: PRs 709, 723, 724 are shown as open in the "Pull 
Requests" section on this page. However, all four PRs are already merged.

Are other see the same? Shouldn't status be automatically updated?

--

___
Python tracker 

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



[issue29854] Segfault when readline history is more then 2 * history size

2017-03-19 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +643

___
Python tracker 

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



[issue29854] Segfault when readline history is more then 2 * history size

2017-03-19 Thread Nir Soffer

New submission from Nir Soffer:

GNU readline let the user select limit the history size by setting:

$ cat ~/.inputrc 
set history-size 1000

So I cooked this test script:

$ cat history.py 
from __future__ import print_function
import readline

readline.read_history_file(".history")

print("current_history_length", readline.get_current_history_length())
print("history_length", readline.get_history_length())
print("history_get_item(1)", readline.get_history_item(1))
print("history_get_item(1000)", readline.get_history_item(1000))

input()

readline.write_history_file(".history")


And this history file generator:

$ cat make-history 
for i in range(2000):
print("%04d" % i)


Generating .history file with 2000 entries:
$ python3 make-history > .history


Finally running the test script:

$ python3 history.py 
current_history_length 1000
history_length -1
history_get_item(1) None
history_get_item(1000) None
please crash
Segmentation fault (core dumped)

So we have few issues here:
- segfault
- history_get_item returns None for both 1 and 1000
  although we have 1000 items in history
- history_length is always wrong (-1), instead of
  the expected value (1000), set in .inputrc

Running with gdb we see:

$ gdb python3
GNU gdb (GDB) Fedora 7.12.1-46.fc25
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from python3...Reading symbols from 
/usr/lib/debug/usr/libexec/system-python.debug...done.
done.

(gdb) run history.py
Starting program: /usr/bin/python3 history.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
current_history_length 1000
history_length -1
history_get_item(1) None
history_get_item(1000) None
crash?

Program received signal SIGSEGV, Segmentation fault.
0x7fffeff60fab in call_readline (sys_stdin=, 
sys_stdout=, prompt=) at 
/usr/src/debug/Python-3.5.2/Modules/readline.c:1281
1281line = (const char *)history_get(length)->line;

(gdb) list
1276if (using_libedit_emulation) {
1277/* handle older 0-based or newer 1-based indexing */
1278line = (const char *)history_get(length + 
libedit_history_start - 1)->line;
1279} else
1280#endif /* __APPLE__ */
1281line = (const char *)history_get(length)->line;
1282else
1283line = "";
1284if (strcmp(p, line))
1285add_history(p);


So we assume that history_get(length) returns non-null
when length > 0, but this assumption is not correct.

In 2 other usages in Modules/readline.c, we validate
that history_get() return value is not null before
using it.


If we change the .history contents to 1999 lines, we get:

$ python3 make-history | head -1999 > .history

$ python3 history.py
current_history_length 1000
history_length -1
history_get_item(1) None
history_get_item(1000) 0999
crash?

$ wc -l .history
1000 .history

$ head -1 .history
1000
$ tail -1 .history
crash?

So now it does not crash, but item 1 is still None.


Trying again with history file with 1000 entries:

$ python3 make-history | head -1000 > .history

$ python3 history.py
current_history_length 1000
history_length -1
history_get_item(1) 
history_get_item(1000) 0999
looks fine!

$ wc -l .history
1000 .history

$ head -1 history
head: cannot open 'history' for reading: No such file or directory

$ head -1 .history
0001

$ tail -1 .history
looks fine!


Finally trying with 1001 items:

$ python3 make-history | head -1001 > .history

$ python3 history.py
current_history_length 1000
history_length -1
history_get_item(1) None
history_get_item(1000) 0999

And item 1 is wrong.


I got same results with python 2.7, 3.5 and master
on fedora 25.

The root cause seems to be a readline bug when history
file is bigger than the history-size in .inputrc,
but I could not find yet readline library documentation,
so  I don't know if the issues is incorrect usage of the
readline apis, or bug in readline.

--
components: Extension Modules
messages: 289865
nosy: nirs
priority: normal
severity: normal
status: open
title: Segfault when readline history is more then 2 * history size
versions: Python 2.7, Python 3.5, Python 3.7

___
Python tracker 

[issue25455] Some repr implementations don't check for self-referential structures

2017-03-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +642

___
Python tracker 

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



[issue29846] ImportError: Symbol not found: __PyCodecInfo_GetIncrementalDecoder when building 2.7.x on macOS

2017-03-19 Thread Adam Stewart

Adam Stewart added the comment:

I also tried building with a Homebrew-installed GCC 6.2.0 but that had the same 
result.

--

___
Python tracker 

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



[issue29846] ImportError: Symbol not found: __PyCodecInfo_GetIncrementalDecoder when building 2.7.x on macOS

2017-03-19 Thread Adam Stewart

Adam Stewart added the comment:

Made a mistake. Please see the new output of DYLD_PRINT_LIBRARIES. This time I 
actually ran a Python command to see which libraries were loaded.

--
Added file: http://bugs.python.org/file46745/dyld_print_libraries.txt

___
Python tracker 

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



[issue29846] ImportError: Symbol not found: __PyCodecInfo_GetIncrementalDecoder when building 2.7.x on macOS

2017-03-19 Thread Adam Stewart

Adam Stewart added the comment:

The output of DYLD_PRINT_LIBRARIES is attached as well.

--
Added file: http://bugs.python.org/file46744/dyld_print_libraries.txt

___
Python tracker 

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



[issue29846] ImportError: Symbol not found: __PyCodecInfo_GetIncrementalDecoder when building 2.7.x on macOS

2017-03-19 Thread Adam Stewart

Adam Stewart added the comment:

I agree, the `--enable-shared` fix is nice, but I would also love to squash 
this bug.

An interesting piece of information: When I provide the full path to the 
executable (not just relying on the hashed python location), I see:

$ 
/Users/Adam/spack/opt/spack/darwin-sierra-x86_64/clang-8.0.0-apple/python-2.7.13-tjqn5npfo573q2jw3dumzhzctfd2vvdv/bin/python
Python 2.7.10 (default, Jul 30 2016, 19:40:32) 
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print sys.version
2.7.10 (default, Jul 30 2016, 19:40:32) 
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)]
>>> print sys.path
['', 
'/Users/Adam/spack/opt/spack/darwin-sierra-x86_64/clang-8.0.0-apple/python-2.7.13-tjqn5npfo573q2jw3dumzhzctfd2vvdv/lib/python27.zip',
 
'/Users/Adam/spack/opt/spack/darwin-sierra-x86_64/clang-8.0.0-apple/python-2.7.13-tjqn5npfo573q2jw3dumzhzctfd2vvdv/lib/python2.7',
 
'/Users/Adam/spack/opt/spack/darwin-sierra-x86_64/clang-8.0.0-apple/python-2.7.13-tjqn5npfo573q2jw3dumzhzctfd2vvdv/lib/python2.7/plat-darwin',
 
'/Users/Adam/spack/opt/spack/darwin-sierra-x86_64/clang-8.0.0-apple/python-2.7.13-tjqn5npfo573q2jw3dumzhzctfd2vvdv/lib/python2.7/plat-mac',
 
'/Users/Adam/spack/opt/spack/darwin-sierra-x86_64/clang-8.0.0-apple/python-2.7.13-tjqn5npfo573q2jw3dumzhzctfd2vvdv/lib/python2.7/plat-mac/lib-scriptpackages',
 
'/Users/Adam/spack/opt/spack/darwin-sierra-x86_64/clang-8.0.0-apple/python-2.7.13-tjqn5npfo573q2jw3dumzhzctfd2vvdv/lib/python2.7/lib-tk',
 
'/Users/Adam/spack/opt/spack/darwin-sierra-x86_64/clang-8.0.0-apple/python-2.7.13-tjqn5npfo573q2jw3dumzhzctfd2vvdv/lib/python2.7/lib-old',
 '/Users/A
 
dam/spack/opt/spack/darwin-sierra-x86_64/clang-8.0.0-apple/python-2.7.13-tjqn5npfo573q2jw3dumzhzctfd2vvdv/lib/python2.7/lib-dynload',
 '/Users/Adam/.local/lib/python2.7/site-packages', 
'/Users/Adam/spack/opt/spack/darwin-sierra-x86_64/clang-8.0.0-apple/python-2.7.13-tjqn5npfo573q2jw3dumzhzctfd2vvdv/lib/python2.7/site-packages']

Note that I am building Python 2.7.13, not 2.7.10. Homebrew installs Python in 
/usr/local and that version is 2.7.12. My Ananconda installation is in 
~/anaconda2 and is 2.7.13. However, the system Python installed at /usr is 
2.7.10. Perhaps this is where it is picking up libraries from?

Here's some more debug information that could possibly be helpful. I have 
attached the output of:

$ 
/Users/Adam/spack/opt/spack/darwin-sierra-x86_64/clang-8.0.0-apple/python-2.7.13-tjqn5npfo573q2jw3dumzhzctfd2vvdv/bin/python
 -c 'from __future__ import print_function; import sysconfig; vars = 
sysconfig.get_config_vars(); [print(var, vars[var]) for var in vars]' > 
~/python-config-vars.txt

Nothing in there looks particularly suspicious to me, but maybe you can find 
something fishy. I'll try out DYLD_PRINT_LIBRARIES next.

--
Added file: http://bugs.python.org/file46743/python-config-vars.txt

___
Python tracker 

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



[issue29845] Mark tests that use _testcapi as CPython-only

2017-03-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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

___
Python tracker 

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



[issue29846] ImportError: Symbol not found: __PyCodecInfo_GetIncrementalDecoder when building 2.7.x on macOS

2017-03-19 Thread Ned Deily

Ned Deily added the comment:

Glad the --enable-shared workaround worked around.  If you feel like exploring 
the issue further, a couple of things that might be useful would be to set one 
or more of dyld's debugging environment variables, like DYLD_PRINT_LIBRARIES, 
to try to see exactly which shared library is being accessed by mistake and at 
what point, assuming that is the root cause; see man (1) dyld for more info.  
My guess is that you'll see a Homebrew or Anaconda Python library from 
/usr/local/lib or some such being dynamically loaded in error.  Another option 
might be to temporarily mv rename any such Python libraries under 
/usr/local/lib and see if that makes a difference.  As I said, it would be nice 
to finally put this issue to bed but, it's tough to do that without being to 
able to reliably reproduce it and, at this point, it doesn't seem to affect 
enough users to make it very high priority.

--
priority: normal -> low
stage:  -> test needed

___
Python tracker 

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



[issue29844] Windows Python installers not installing DLL to System32/SysWOW64

2017-03-19 Thread Decorater

Decorater added the comment:

tbh, I would rather have it default for all python files installed for all 
users to go in ``%SystemDrive%\Python{major}{minor}`` on windows and then work 
with then the environment variables like currently so that way none of the 
python dll's are outside of such folder in case someone installs for example 
3.6.0 in ``%SystemDrive%\Python360`` and then installs 3.6.1 in 
``%SystemDrive%\Python361`` without uninstalling 3.6.0.

--
nosy: +Decorater

___
Python tracker 

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



[issue29844] Windows Python installers not installing DLL to System32/SysWOW64

2017-03-19 Thread Steve Dower

Steve Dower added the comment:

Maybe I need to look through the history to see whether I actually intended the 
all-users install to be in System, but I don't think I did (despite writing the 
documentation linked - it may have been adapted from the old documentation).

Applications that need Python should look in the registry or embed the 
embeddable distro, depending on whether they are providing access to the user's 
own Python (e.g. an IDE) or it's an internal implementation detail (e.g. a tool 
that just happens to be implemented using Python). The former should really 
offer options for the user to specify a path to the install as well.

Reliably finding the required standard library for a copy of Python that is 
installed somewhere else is every bit as problematic as locating the install 
itself. When everyone follows PEP 514 properly it may be safe for a 
System32-DLL to use the registry again for finding its library, but as long as 
various distros want to overwrite the core registry keys, everyone is better 
off without it being a system component.

--

___
Python tracker 

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



[issue29845] Mark tests that use _testcapi as CPython-only

2017-03-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +641

___
Python tracker 

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



[issue29845] Mark tests that use _testcapi as CPython-only

2017-03-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +640

___
Python tracker 

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



[issue29116] Make str and bytes error messages on concatenation conform with other sequences

2017-03-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +639

___
Python tracker 

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



[issue29116] Make str and bytes error messages on concatenation conform with other sequences

2017-03-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +638

___
Python tracker 

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



[issue29748] Argument Clinic: slice index converter

2017-03-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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

___
Python tracker 

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



[issue25455] Some repr implementations don't check for self-referential structures

2017-03-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +637

___
Python tracker 

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



[issue29850] file access, other drives

2017-03-19 Thread Gabriel POTTER

Gabriel POTTER added the comment:

Thanks a lot, that resolved it.

--
resolution:  -> works for me
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



[issue13349] Non-informative error message in index() and remove() functions

2017-03-19 Thread Jim Fasarakis-Hilliard

Jim Fasarakis-Hilliard added the comment:

@Sean Ochoa, do you want to make this into a PR? The only tweak I would suggest 
would be to change all error messages to either be:

"object.method(repr(x)): element not in object" 

or:

"repr(x) not in object"

also, this probably needs to be changed to version 3.7 now.

--
nosy: +Jim Fasarakis-Hilliard

___
Python tracker 

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



[issue29853] Improve exception messages for remove and index methods

2017-03-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Non-informative error message in index() and remove() functions

___
Python tracker 

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



[issue29853] Improve exception messages for remove and index methods

2017-03-19 Thread Jim Fasarakis-Hilliard

Jim Fasarakis-Hilliard added the comment:

I'd be happy to supply a PR for this if the change seems reasonable.

--

___
Python tracker 

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



[issue29853] Improve exception messages for remove and index methods

2017-03-19 Thread Jim Fasarakis-Hilliard

New submission from Jim Fasarakis-Hilliard:

Currently, there's a discrepancy in the exception reporting for the `.index` 
and `.remove` methods of many objects:

For arrays:

array.remove(val) -> ValueError: array.remove(x): x not in list 
array.index(val)  -> ValueError: array.index(x): x not in list

not only is always printing `x` not in list not informative, it's wrong since 
it isn't a list.

For tuples:

tuple.index(val)  -> ValueError: tuple.index(x): x not in tuple

For lists:

list.remove(val)  -> ValueError: list.remove(x): x not in list

list.index(val) produces a more informative message: ValueError:  is not 
in list

For deques:

deque.remove(val) -> ValueError: deque.remove(x): x not in deque

similarly to lists, `deque.index(val)` prints the actual argument supplied.

I'm not sure if there's valid reasoning behind not providing the repr of the 
arguments in all `remove` methods but, if there isn't, I'd like to suggest 
changing all of them to use PyErr_Format and produce more informative messages:

array.remove(val) -> ValueError:  is not in array 
array.index(val)  -> ValueError:  is not in array
tuple.index(val)  -> ValueError:  is not in tuple
list.remove(val)  -> ValueError:  is not in list
deque.remove(val) -> ValueError:  is not in deque

--
messages: 289854
nosy: Jim Fasarakis-Hilliard
priority: normal
severity: normal
status: open
title: Improve exception messages for remove and index methods
type: enhancement
versions: Python 3.7

___
Python tracker 

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



[issue15988] Inconsistency in overflow error messages of integer argument

2017-03-19 Thread Oren Milman

Oren Milman added the comment:

ISTM that what's left is (except for my 7 sub-patches):
- making the error messages of long_rshift and long_lshift consistent 
(waits for #29816)
- deciding whether to open an issue for changing the type of errors 
PyLong_AsSize_t raises

--

___
Python tracker 

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



[issue15988] Inconsistency in overflow error messages of integer argument

2017-03-19 Thread Oren Milman

Oren Milman added the comment:

Here is a patch including only changes related to mmap, posix, socket and 
select.

(I ran the test module, and on my Windows 10, the same tests failed with
and without my patches. However, on my Ubuntu 16.04 VM, none of the tests
failed.)

--
Added file: 
http://bugs.python.org/file46742/mmap_posix_socket_select_patchVer1.diff

___
Python tracker 

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



[issue29842] Make Executor.map work with infinite/large inputs correctly

2017-03-19 Thread Josh Rosenberg

Changes by Josh Rosenberg :


--
title: Executor.map should not submit all futures prior to yielding any results 
-> Make Executor.map work with infinite/large inputs correctly

___
Python tracker 

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



[issue29850] file access, other drives

2017-03-19 Thread Paul Moore

Paul Moore added the comment:

As you see from the banner, your Python 3.6 is 32-bit but your Python 2.7 is 
64-bit.

I'd suggest you try 64-bit Python 3.6. This definitely looks like the SysWOW64 
issue Eryk described.

--

___
Python tracker 

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



[issue15988] Inconsistency in overflow error messages of integer argument

2017-03-19 Thread Oren Milman

Oren Milman added the comment:

Here is a patch including only changes related to curses, stat, callproc 
(ctypes) and sequence_repeat (abstract).

(I ran the test module, and on my Windows 10, the same tests failed with
and without my patches. However, on my Ubuntu 16.04 VM, none of the tests
failed.)

--
Added file: 
http://bugs.python.org/file46741/curses_stat_callproc_abstract_patchVer1.diff

___
Python tracker 

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



[issue29850] file access, other drives

2017-03-19 Thread Gabriel POTTER

Gabriel POTTER added the comment:

Thanks for your answers. I'll try to be as precise as possible.

The problem i have is really specific:
I have a custom file, that i added in C:/Windows/System32/

I have a Windows 10 x64 computer, with 2 versions of python installed:
- Python 2.7, in C:\Python27
- Python 3.6, in D:\Programms\Python3

I use a sample of code with the two different versions:

* With Python 2.7:

Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:24:40) [MSC v.1500 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.path.isfile(os.path.normpath("C:/Users/gpotter/Desktop/test.txt"))
True
>>> os.path.isfile(os.path.normpath("C:/Windows/System32/cmd.exe"))
True
>>> os.path.isfile(os.path.normpath("C:/Windows/System32/windump.exe"))
True
>>> os.path.isfile(os.path.normpath("C:/Windows/System32/do_not_exist.stg"))
False


* Now, with Python 3.6:

Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 07:18:10) [MSC v.1900 32 bit 
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.path.isfile(os.path.normpath("C:/Users/gpotter/Desktop/test.txt"))
True
>>> os.path.isfile(os.path.normpath("C:/Windows/System32/cmd.exe"))
True
>>> os.path.isfile(os.path.normpath("C:/Windows/System32/windump.exe"))
False
>>> os.path.isfile(os.path.normpath("C:/Windows/System32/do_not_exist.stg"))
False

As you can see, Python 2.7 acts normally for everything. Python 3.6 does detect 
cmd.exe as a correct file, but do not detects windump.exe, the file that I 
added manually.

--

___
Python tracker 

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



[issue14208] No way to recover original argv with python -m

2017-03-19 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue14208] No way to recover original argv with python -m

2017-03-19 Thread Jakub Wilk

Changes by Jakub Wilk :


--
nosy: +jwilk

___
Python tracker 

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



[issue29852] Argument Clinic: add common converter to Py_ssize_t that accepts None

2017-03-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +636

___
Python tracker 

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



[issue29819] Avoid raising OverflowError in truncate() if possible

2017-03-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Issue29852 is not strict dependency, but it may make the solution of this issue 
simpler.

--
dependencies: +Argument Clinic: add common converter to Py_ssize_t that accepts 
None

___
Python tracker 

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



[issue29852] Argument Clinic: add common converter to Py_ssize_t that accepts None

2017-03-19 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Many methods in the io module accept int and None and convert the argument to 
Py_ssize_t. Proposed patch adds common Argument Clinic converter for that case. 
The Py_ssize_t converter now takes the accept argument that can be {int} (the 
default) or {int, NoneType}. In the latter case None is acceptable value which 
means using the default value.

Similar converter was previously used locally in the io module, now it is used 
also in the mmap module.

Examples:

_io.BytesIO.read
size: Py_ssize_t(accept={int, NoneType}) = -1
/

_io.BytesIO.truncate
size: Py_ssize_t(accept={int, NoneType}, c_default="self->pos") = None
/

--
components: Argument Clinic, IO
messages: 289847
nosy: benjamin.peterson, larry, serhiy.storchaka, stutzbach
priority: normal
severity: normal
stage: patch review
status: open
title: Argument Clinic: add common converter to Py_ssize_t that accepts None
type: enhancement
versions: Python 3.7

___
Python tracker 

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



[issue15988] Inconsistency in overflow error messages of integer argument

2017-03-19 Thread Oren Milman

Oren Milman added the comment:

Here is a patch including only changes related to time and re.

(I ran the test module, and on my Windows 10, the same tests failed with
and without my patches. However, on my Ubuntu 16.04 VM, none of the tests
failed.)

--
Added file: http://bugs.python.org/file46740/time_and_re_patchVer1.diff

___
Python tracker 

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



[issue29830] pyexpat.errors doesn't have __spec__ and __loader__ set

2017-03-19 Thread Nick Coghlan

Nick Coghlan added the comment:

Right, there's a longstanding RFE to allow builtin packages and submodules: 
https://bugs.python.org/issue1644818

At the moment, modules like pyexpat are more like the os module than they are 
packages: they eagerly set other modules as attributes at import time (akin to 
os.path), rather than defining an actual package with submodules that can be 
optionally loaded via the import system.

Given the import system changes in recent 3.x releases, I'd expect it to be 
feasible (but not necessarily easy) to come up with a viable specification and 
implementation for builtin and extension packages that work similarly to 
traditional packages (perhaps based on the handling of frozen packages).

--

___
Python tracker 

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



[issue29736] Optimize builtin types constructor

2017-03-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

And include bytearray.

--

___
Python tracker 

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



[issue15988] Inconsistency in overflow error messages of integer argument

2017-03-19 Thread Oren Milman

Oren Milman added the comment:

Here is a patch including only changes related to hashlib, lzma and pickle.

(I ran the test module, and on my Windows 10, the same tests failed with
and without my patches. However, on my Ubuntu 16.04 VM, none of the tests
failed.)

--
Added file: http://bugs.python.org/file46739/hashlib_lzma_pickle_patchVer1.diff

___
Python tracker 

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



[issue15988] Inconsistency in overflow error messages of integer argument

2017-03-19 Thread Oren Milman

Oren Milman added the comment:

Here is a patch including only changes related to array.

(I ran the test module, and on my Windows 10, the same tests failed with
and without my patches. However, on my Ubuntu 16.04 VM, none of the tests
failed.)

--
Added file: http://bugs.python.org/file46738/array_patchVer1.diff

___
Python tracker 

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



[issue29736] Optimize builtin types constructor

2017-03-19 Thread STINNER Victor

STINNER Victor added the comment:

Ok, will do.

--

___
Python tracker 

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



[issue29793] Convert some builtin types constructors to Argument Clinic

2017-03-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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

___
Python tracker 

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



[issue29736] Optimize builtin types constructor

2017-03-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Victor, could you please rebase your PR? And maybe rerun benchmarks?

--

___
Python tracker 

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



[issue29776] Modernize properties

2017-03-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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

___
Python tracker 

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



[issue28749] Fixed the documentation of the mapping codec APIs

2017-03-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +635

___
Python tracker 

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



[issue28749] Fixed the documentation of the mapping codec APIs

2017-03-19 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +634

___
Python tracker 

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



[issue20087] Mismatch between glibc and X11 locale.alias

2017-03-19 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
pull_requests: +633

___
Python tracker 

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