[issue34008] Do we support calling Py_Main() after Py_Initialize()?

2018-06-29 Thread Nick Coghlan


New submission from Nick Coghlan :

In the current documentation, Py_Main is listed as a regular C API function: 
https://docs.python.org/3/c-api/veryhigh.html#c.Py_Main

We also didn't add Py_Main() to 
https://docs.python.org/3/c-api/init.html#before-python-initialization when we 
did the review for "Functions which are safe to call before Py_Initialize()".

If it truly is a regular C API function, then this suggests that Py_Main() 
should be called *after* Py_Initialize().

However, Py_Main() has historically called Py_Initialize() *itself*, and 
generally assumes it has total control over management of the current process - 
it doesn't expect to be sharing the current process with an embedding 
application.

In Python 3.7, Py_Main() was changed to call _Py_InitializeCore() and 
_Py_InitializeMainInterpreter() as separate steps, allowing it to detect cases 
where an embedding application had already called Py_Initialize(), meaning that 
Py_Main()'s config setting changes wouldn't be applied.

In effect, we've converted a silent failure (settings not read and applied as 
expected) into a noisy one (attempting to call Py_Main() in an already 
initialised interpreter).

(The test suite is silent on the matter, since the idea of an embedding 
application calling Py_Initialize() before calling Py_Main() never even 
occurred to us)

So the question is, what should we do about this for Python 3.7:

1. Treat it as a regression, try to replicate the old behaviour of partially 
(but not completely) ignoring the config settings read by Py_Main()
2. Treat it as a regression, but don't try to replicate the old 
config-settings-are-partially-applied behaviour - just ignore the settings read 
by Py_Main() completely
3. Treat it as a long standing documentation error, update the docs to make it 
clear that Py_Main() expects to handle calling Py_Initialize() itself, and 
update the Python 3.7 porting guide accordingly

--
messages: 320758
nosy: eric.snow, ncoghlan, vstinner
priority: normal
severity: normal
stage: test needed
status: open
title: Do we support calling Py_Main() after Py_Initialize()?
type: behavior
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue33974] _stringify handles quoted strings incorrectly

2018-06-29 Thread miss-islington


miss-islington  added the comment:


New changeset b2e88fcf63515f8a66759a6fdc75d08a0a440901 by Miss Islington (bot) 
in branch '3.6':
bpo-33974: Fix passing special characters to ttk widgets. (GH-7986)
https://github.com/python/cpython/commit/b2e88fcf63515f8a66759a6fdc75d08a0a440901


--

___
Python tracker 

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



[issue33974] _stringify handles quoted strings incorrectly

2018-06-29 Thread miss-islington


miss-islington  added the comment:


New changeset 42ea5226642c2a416b32278914fa4738093298ff by Miss Islington (bot) 
in branch '3.7':
bpo-33974: Fix passing special characters to ttk widgets. (GH-7986)
https://github.com/python/cpython/commit/42ea5226642c2a416b32278914fa4738093298ff


--
nosy: +miss-islington

___
Python tracker 

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



[issue33932] Calling Py_Initialize() twice now triggers a fatal error (Python 3.7)

2018-06-29 Thread Nick Coghlan


Nick Coghlan  added the comment:

Victor, could you file a separate issue for Py_Main(). It's a different 
problem, since Py_Main() is an entry point for an *application that embeds 
Python*. It's not a CPython API in the tradition sense.

--

___
Python tracker 

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



[issue33944] Deprecate and remove pth files

2018-06-29 Thread Nick Coghlan


Nick Coghlan  added the comment:

I think we also need to clearly separate two distinct aspects of .pth files:

1. "import ; " lines <--- Kill it 
with fire
2. "" lines <--- This is fine and good and 
perfectly sensible

It's point 2 that powers things like "pew add", and I don't see any 
particularly compelling reason to get rid of it.

The "arbitrary code invocation for every single Python execution using that 
environment" aspect, on the other hand, is mostly a PITA, and used as a 
workaround for other features being missing (e.g. the PYTHONRUNFIRST proposal 
in https://bugs.python.org/issue14803).

--

___
Python tracker 

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



[issue33974] _stringify handles quoted strings incorrectly

2018-06-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7627

___
Python tracker 

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



[issue33974] _stringify handles quoted strings incorrectly

2018-06-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7626

___
Python tracker 

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



[issue33974] _stringify handles quoted strings incorrectly

2018-06-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 5bb5bbfca847524bab5f2368bdb48eedf5dba74f by Serhiy Storchaka in 
branch 'master':
bpo-33974: Fix passing special characters to ttk widgets. (GH-7986)
https://github.com/python/cpython/commit/5bb5bbfca847524bab5f2368bdb48eedf5dba74f


--

___
Python tracker 

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



[issue33989] ms.key_compare is not initialized in all pathes of list_sort_impl

2018-06-29 Thread Elliot Gorokhovsky


Elliot Gorokhovsky  added the comment:

You can always fall back on safe_object_compare. So unless there's an
obvious reason why your edge case can't be triggered, it would be worth
putting that in as a failsafe. The additional branch should be 100%
predictable, so there shouldn't be any performance penalty.

--

___
Python tracker 

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



[issue33989] ms.key_compare is not initialized in all pathes of list_sort_impl

2018-06-29 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +elliot.gorokhovsky

___
Python tracker 

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



[issue33989] ms.key_compare is not initialized in all pathes of list_sort_impl

2018-06-29 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Serhiy, do you want to take this one?

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



[issue33959] doc Remove time complexity mention from list Glossary entry

2018-06-29 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Let's leave this as-is.

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



[issue33989] ms.key_compare is not initialized in all pathes of list_sort_impl

2018-06-29 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Do you want to submit a patch?

--
nosy: +rhettinger

___
Python tracker 

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



[issue34003] csv.DictReader can return basic dict instead of OrderedDict

2018-06-29 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

This might need a deprecation before switching but it would be useful.  The 
DictReader can produced huge numbers of instances that would benefit from the 
smaller size.

--
nosy: +rhettinger

___
Python tracker 

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



[issue34007] test_gdb fails in s390x SLES buildbots

2018-06-29 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

test_gdb is currently failing on the following buildbots:

http://buildbot.python.org/all/#/builders/54/builds/465
http://buildbot.python.org/all/#/builders/66/builds/178
http://buildbot.python.org/all/#/builders/16/builds/1279
http://buildbot.python.org/all/#/builders/122/builds/481

Sample error lines:


==
FAIL: test_threads (test.test_gdb.PyBtTests)
Verify that "py-bt" indicates threads that are waiting for the GIL
--
Traceback (most recent call last):
  File 
"/home/dje/cpython-buildarea/3.7.edelsohn-sles-z/build/Lib/test/test_gdb.py", 
line 776, in test_threads
cmds_after_breakpoint=['thread apply all py-bt'])
  File 
"/home/dje/cpython-buildarea/3.7.edelsohn-sles-z/build/Lib/test/test_gdb.py", 
line 213, in get_stack_trace
self.assertEqual(unexpected_errlines, [])
AssertionError: Lists differ: ["Python Exception  PC [58 
chars]ved'] != []
First list contains 2 additional elements.
First extra element 0:
"Python Exception  PC not saved: "
+ []
- ["Python Exception  PC not saved: ",
-  'Error occurred in Python command: PC not saved']
--
Ran 46 tests in 19.888s
FAILED (failures=1)
1 test failed again:
test_gdb

--
components: Tests
messages: 320747
nosy: pablogsal
priority: normal
severity: normal
status: open
title: test_gdb fails in s390x SLES buildbots
type: behavior
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue34006] Windows HTML Help (chm) has fixed line length

2018-06-29 Thread Roel Schroeven


New submission from Roel Schroeven :

Since 3.7 (and possibly 3.6.6) the .chm Windows help file uses fixed line 
lenghts, instead of properly adapting to the window width. Please revert to the 
old behavior.

See screenshot: the empty space on the right is just silly.

--
components: Windows
files: python manual.PNG
messages: 320746
nosy: paul.moore, roelschroeven, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Windows HTML Help (chm) has fixed line length
type: enhancement
versions: Python 3.7
Added file: https://bugs.python.org/file47660/python manual.PNG

___
Python tracker 

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



[issue34005] Replace inspect.formatargspec by inspect.signature in xmlrpc module

2018-06-29 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Indeed, it is the exact same patch. Sorry about the duplicate.

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



[issue28411] Eliminate PyInterpreterState.modules.

2018-06-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7625

___
Python tracker 

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



[issue34005] Replace inspect.formatargspec by inspect.signature in xmlrpc module

2018-06-29 Thread Zackery Spytz


Zackery Spytz  added the comment:

This is a duplicate of #33911 (which already has a PR).

--
nosy: +ZackerySpytz

___
Python tracker 

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



[issue34005] Replace inspect.formatargspec by inspect.signature in xmlrpc module

2018-06-29 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
components: +Library (Lib), XML
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



[issue34005] Replace inspect.formatargspec by inspect.signature in xmlrpc module

2018-06-29 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


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

___
Python tracker 

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



[issue34005] Replace inspect.formatargspec by inspect.signature in xmlrpc module

2018-06-29 Thread Rémi Lapeyre

New submission from Rémi Lapeyre :

xmlrpc still makes use of formatargspec which is deprecated since Python 3.5 
and raises a deprecation warning:

DeprecationWarning: `formatargspec` is deprecated since Python 3.5. Use 
`signature` and the `Signature` object directly

The proposed patch replace both uses of inspect.formatargspec by 
inspect.signature as the documentation suggest in 
https://docs.python.org/3/library/inspect.html#inspect.formatargspec.

--
messages: 320743
nosy: remi.lapeyre
priority: normal
severity: normal
status: open
title: Replace inspect.formatargspec by inspect.signature in xmlrpc module

___
Python tracker 

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



[issue34004] Acquiring locks not interrupted by signals on musl libc

2018-06-29 Thread Joseph Sible


New submission from Joseph Sible :

When Python is built on Alpine Linux or in any other configuration that uses 
musl libc, calls to Lock.acquire() can't be interrupted by signals. This bug is 
caught by test_lock_acquire_interruption and test_rlock_acquire_interruption in 
3.6/Lib/test/test_threadsignals.py, both of which fail when Python is built on 
musl.

POSIX explicitly says that sem_timedwait ever failing with EINTR is optional:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/sem_timedwait.html#tag_16_508_05

And musl deliberately chooses not to support it:
http://www.openwall.com/lists/musl/2018/02/24/3
http://git.musl-libc.org/cgit/musl/commit/?id=c0ed5a201b2bdb6d1896064bec0020c9973db0a1

However, we incorrectly rely on it for correct operation. Our documentation 
https://docs.python.org/3.6/library/threading.html#threading.Lock.acquire just 
says that "Lock acquires can now be interrupted by signals on POSIX", not that 
any optional POSIX features are required for it.

A similar bug was #11223, which was the same problem but with 
pthread_cond_timedwait, which is used when semaphores aren't available.

--
components: Extension Modules
messages: 320742
nosy: Joseph Sible
priority: normal
severity: normal
status: open
title: Acquiring locks not interrupted by signals on musl libc
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



[issue34003] csv.DictReader can return basic dict instead of OrderedDict

2018-06-29 Thread Michael Selik


Michael Selik  added the comment:

I searched for previously submitted issues, but somehow didn't spot #32339.

I'll do some searching for whether anyone uses ``move_to_end`` on DictReader 
rows and respond to the mailing list with a report.

--

___
Python tracker 

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



[issue28657] cmd.Cmd.get_help() implementation can't see do_*() methods added dynamically by setattr()

2018-06-29 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Hi Błażej Michalik, can you confirm the attached patch fixed the issue for you?

--
nosy: +remi.lapeyre

___
Python tracker 

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



[issue28657] cmd.Cmd.get_help() implementation can't see do_*() methods added dynamically by setattr()

2018-06-29 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


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

___
Python tracker 

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



[issue34003] csv.DictReader can return basic dict instead of OrderedDict

2018-06-29 Thread Eric V. Smith


Eric V. Smith  added the comment:

The dict and OrderedDict APIs are slightly different, although I'm not sure 
anyone cares. See #32339. In that PR 
https://github.com/python/cpython/pull/4904, Guido said to not make this 
change. See also the python-dev discussion at 
https://mail.python.org/pipermail/python-dev/2017-December/151351.html

If you feel strongly about this, I suggest discussing it on python-dev first.

--
nosy: +eric.smith

___
Python tracker 

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



[issue33977] [Windows] test_compileall fails randomly with PermissionError: [WinError 5] Access is denied: (...).pyc

2018-06-29 Thread STINNER Victor


STINNER Victor  added the comment:

While the issue is rare, I am sure that there is a race condition. The bug
maybe happens when other tests run in parallel.

The test should work in its own temporary directory to no be bothered by
other tests.

--

___
Python tracker 

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



[issue25862] TextIOWrapper assertion failure after read() and SEEK_CUR

2018-06-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 0464de0f9a226cfa32b803e0326c12b2432aba26 by Serhiy Storchaka 
(Zackery Spytz) in branch '2.7':
[2.7] bpo-25862: Fix assertion failures in io.TextIOWrapper.tell(). (GH-3918). 
(GH-8013)
https://github.com/python/cpython/commit/0464de0f9a226cfa32b803e0326c12b2432aba26


--

___
Python tracker 

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



[issue33700] [doc] Old version picker don't understand language tags in URL

2018-06-29 Thread Larry Hastings


Larry Hastings  added the comment:

Doc fixes are generally okay in security-fixes-only branches.  Obviously I'd 
want to review it before it went in; it sounds like a simple change (one line 
change to an RE?), so you can send me a PR or just post it here if you want a 
pre-review.

--

___
Python tracker 

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



[issue34003] csv.DictReader can return basic dict instead of OrderedDict

2018-06-29 Thread Michael Selik


Change by Michael Selik :


--
components: +Library (Lib)

___
Python tracker 

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



[issue34003] csv.DictReader can return basic dict instead of OrderedDict

2018-06-29 Thread Michael Selik


Change by Michael Selik :


--
type:  -> performance

___
Python tracker 

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



[issue34003] csv.DictReader can return basic dict instead of OrderedDict

2018-06-29 Thread Michael Selik


Michael Selik  added the comment:

Pull request.

https://github.com/python/cpython/pull/8014

--

___
Python tracker 

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



[issue34003] csv.DictReader can return basic dict instead of OrderedDict

2018-06-29 Thread Michael Selik


Change by Michael Selik :


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

___
Python tracker 

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



[issue34003] csv.DictReader can return basic dict instead of OrderedDict

2018-06-29 Thread Michael Selik


New submission from Michael Selik :

Since dicts are now keeping insertion order as of 3.7, we can switch to the 
more efficient construction of dict rather than OrderedDict for each row in the 
CSV file.

--
messages: 320734
nosy: selik
priority: normal
severity: normal
status: open
title: csv.DictReader can return basic dict instead of OrderedDict
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



[issue25862] TextIOWrapper assertion failure after read() and SEEK_CUR

2018-06-29 Thread Zackery Spytz


Change by Zackery Spytz :


--
pull_requests: +7621

___
Python tracker 

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



[issue33977] [Windows] test_compileall fails randomly with PermissionError: [WinError 5] Access is denied: (...).pyc

2018-06-29 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

#20760 reported failures on Linux.  I think one of these two issues should be 
closed.  FWIW, I ran
f:\dev\3x>python -m test -R 3:10 -m CommandLineTests test_compileall
twice with no failures.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue25862] TextIOWrapper assertion failure after read() and SEEK_CUR

2018-06-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset d6a283b37b66ecd2d0ff43602ddc8e91b54a51c5 by Serhiy Storchaka 
(Zackery Spytz) in branch '3.6':
[3.6] bpo-25862: Fix assertion failures in io.TextIOWrapper.tell(). (GH-3918). 
(GH-8012)
https://github.com/python/cpython/commit/d6a283b37b66ecd2d0ff43602ddc8e91b54a51c5


--

___
Python tracker 

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



[issue33998] random.randrange completely ignores the step argument when stop is None

2018-06-29 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

My vote is for "that's just the way it is, it works fine for just about 
everyone most of the time".  

In pure Python code, it is expensive to try to handle or defend against all 
possible input variations.

--
assignee:  -> tim.peters
nosy: +tim.peters

___
Python tracker 

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



[issue34002] minor efficiency and clarity improvements in email package

2018-06-29 Thread Michael Selik


Change by Michael Selik :


--
components: +email
nosy: +barry, r.david.murray
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



[issue34002] minor efficiency and clarity improvements in email package

2018-06-29 Thread Michael Selik


Change by Michael Selik :


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

___
Python tracker 

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



[issue34002] minor efficiency and clarity improvements in email package

2018-06-29 Thread Michael Selik


New submission from Michael Selik :

The primary motivation for these improvements was avoiding a while/pop pattern 
for looping. A for-loop is a big improvement over copying a list, then 
repeatedly popping the 0th element.

A lesser improvement is the use of ``a.intersection(b)`` instead of ``c = 
set(b); len(c) > len(c - a)``. The check for intersection is more clear, and it 
avoids an unnecessary set construction.

https://github.com/python/cpython/pull/7999/

--
messages: 320730
nosy: selik
priority: normal
severity: normal
status: open
title: minor efficiency and clarity improvements in email package

___
Python tracker 

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



[issue25862] TextIOWrapper assertion failure after read() and SEEK_CUR

2018-06-29 Thread Zackery Spytz


Change by Zackery Spytz :


--
pull_requests: +7619

___
Python tracker 

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



[issue33927] Allow json.tool to have identical infile and outfile

2018-06-29 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Hi Pablo, I added two tests to confirm that file descriptors do not link 
anymore.

The tests are rather ugly but I'm not sure if it's possible to do better.

Is this patch ok for you?

--

___
Python tracker 

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



[issue33949] tests: allow to select tests using loadTestsFromName

2018-06-29 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I have used test -m, but a point in favor of this proposal, for other people, 
is consistency with running unittest

f:\dev\3x>python -m unittest 
idlelib.idle_test.test_autocomplete.AutoCompleteTest.test_init
Running Debug|Win32 interpreter...
.
--
Ran 1 test in 0.176s

However, the current patch appears to be useless for test modules, like 
test_idle, that use load_tests to discover tests, as none of the test modules 
or classes discovered are attributes of the main test module.  The following 
both fail.

python -m test test_idle.test_autocomplete
python -m test test_idle.AutoCompleteTest

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

___
Python tracker 

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



[issue33980] SSL Error when uploading package to your own pypi

2018-06-29 Thread Éric Araujo

Éric Araujo  added the comment:

I don’t think there is an option (see the --help command), but on localhost you 
could use http instead of https.  Otherwise it’s strongly recommended to use 
twine to upload.

--

___
Python tracker 

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



[issue33997] multiprocessing Pool hangs in terminate()

2018-06-29 Thread Erik Wolf


Erik Wolf  added the comment:

To help get an idea of the racing condition I created a trace with several 
additional debug outputs in pool.py and connection.py

"=== Creating new pool ===" marks a new start of a pool using the 
Pool.imap() function. The iteration is terminated at some time and a new pool 
is created with a new call to imap(). The last log entry shows the location of 
the last call which currently hangs endlessly.

I am not a multithreading/winapi expert so I could not fix the actual issue 
with _winapi.WaitForMultipleObjects but the fix in the PR actually ignores 
preceding issues when polling more data than actually needed for the two 
sentinels.

Remark: I have also seen this issue in linux with the same application but was 
not able to debug it so far.

--
Added file: https://bugs.python.org/file47659/debug.trace

___
Python tracker 

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



[issue33932] Calling Py_Initialize() twice now triggers a fatal error (Python 3.7)

2018-06-29 Thread Eric Snow


Eric Snow  added the comment:

> I looked quickly at _Py_InitializeCore() and I'm not sure
> that it's designed to replace an existing configuration.
> ...
> So maybe for this specific case, _Py_InitializeCore() should
> always set Py_HashRandomizationFlag.

+1

At the same time, the use of Py_*Flag variables is a little unclear in the PEP 
432 world.  Under the PEP I'd expect code in CPython to use the core config 
from the current PyInterpreterState (or even _PyRuntimeState), rather than the 
global flag variables.  So presumably (the PEP doesn't talk about it) the 
intent of keeping them is to help folks that currently make use of the flags.  
However, they shouldn't be modifying them after initialization, and under PEP 
432 they don't need to set them beforehand (they set values on the config), 
right?

Part of the problem here is that Py_Main() results in all the flag variables 
getting set (before runtime initialization).  However, with the current PEP 432 
[internal] implementation those variables are (mostly) never getting set, 
right?  Shouldn't we set all of them, but only at the end of 
_Py_InitializeCore() (for the sake of extensions/embedders that use them)?  In 
that case we'd need to replace our internal use of Py_HashRandomizationFlag 
with field on the config struct on _PyRuntimeState.

> But it was just one example to show that right now,
> _Py_InitializeCore() doesn't seem to support to be called
> twice with two different configurations.

Are there other things (than how we set that flag) that break in that case?  
Regardless, what would ensure that it works properly?

--
nosy: +emilyemorehouse

___
Python tracker 

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



[issue33944] Deprecate and remove pth files

2018-06-29 Thread Ivan Pozdeev


Ivan Pozdeev  added the comment:

I *think* we need to ask maintainers of packages who use .pth -- at least, Mark 
Hammond (pywin32) -- to find out the impact and if everything can be done with 
other means.

AFAICS it at least allows pywin32 to have many top-level modules without 
cluttering `site-packages'.

pywin32 e.g. also copies some files to %windir%\system32 for some reason. And 
last time I checked, distutils had no functionality that involved symlinks, 
regardless of the OS.

--
nosy: +Ivan.Pozdeev, mhammond
type:  -> enhancement

___
Python tracker 

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



[issue25457] json dump fails for mixed-type keys when sort_keys is specified

2018-06-29 Thread James Edwards


Change by James Edwards :


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

___
Python tracker 

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



[issue34001] LibreSSL does not tolerate setting minimum_version greater than maximum_version

2018-06-29 Thread Alan Huang


New submission from Alan Huang :

LibreSSL has a function called `ssl_clamp_version_range` that is called before 
attempting to set the minimum and maximum protocol versions in 
`ssl_version_set_{min,max}`. The function disallows setting ranges that are 
invalid (i.e., where minimum_version > maximum_version). OpenSSL does not 
disallow this behavior.

As a result, attempting to set a minimum_version greater than a maximum_version 
results in a ValueError when Python is built with LibreSSL.

There are two things that might need fixing here:
1. Replace the ValueError "Unsupported protocol version 0x%x" message with a 
more generic one. The assumption that the only way the operation can fail is if 
the underlying library does not support the protocol version is incorrect.
   This can be done by either making the message more generic or by introducing 
another error message to handle this case.
2. Change test_min_max_version lines 3575-3576 to set the maximum_version 
before the minimum_version.

Here's some Python code to reproduce the above-mentioned error:
```
import ssl

ctx = ssl.SSLContext()
ctx.maximum_version = ssl.TLSVersion.TLSv1_1
ctx.minimum_version = ssl.TLSVersion.TLSv1_2

Traceback (most recent call last):
  File "", line 1, in 
  File "/home/alan/src/cpython/Lib/ssl.py", line 491, in minimum_version
super(SSLContext, SSLContext).minimum_version.__set__(self, value)
ValueError: Unsupported protocol version 0x303
```

Here's some example C code:
```
#include 
#include 
#include 

int main(){
SSL_CTX *ctx = NULL;
ctx = SSL_CTX_new(TLS_method());

printf("setting max to TLSv1.1: ");
if(SSL_CTX_set_max_proto_version(ctx, TLS1_1_VERSION)){
printf("success\n");
}   
else{
printf("failure\n");
}   
printf("setting min to TLSv1.2: ");
if(SSL_CTX_set_min_proto_version(ctx, TLS1_2_VERSION)){
printf("success\n");
}   
else{
printf("failure\n");
}   

printf("min ver: %d\n", SSL_CTX_get_min_proto_version(ctx));
printf("max ver: %d\n", SSL_CTX_get_max_proto_version(ctx));
return 0;
}
```

Under LibreSSL 2.7.4, this produces:
```
setting max to TLSv1.1: success
setting min to TLSv1.2: failure
min ver: 769
max ver: 770
```

Under OpenSSL 1.1.0g, this produces:
```
setting max to TLSv1.1: success
setting min to TLSv1.2: success
min ver: 771
max ver: 770
```

The test that failed:
==
ERROR: test_min_max_version (test.test_ssl.ThreadedTests)
--
Traceback (most recent call last):
  File "/home/alan/src/cpython/Lib/test/test_ssl.py", line 3575, in 
test_min_max_version
server_context.minimum_version = ssl.TLSVersion.TLSv1_2
  File "/home/alan/src/cpython/Lib/ssl.py", line 491, in minimum_version
super(SSLContext, SSLContext).minimum_version.__set__(self, value)
ValueError: Unsupported protocol version 0x303

--
assignee: christian.heimes
components: SSL, Tests
messages: 320722
nosy: Alan.Huang, alex, christian.heimes, dstufft, janssen
priority: normal
severity: normal
status: open
title: LibreSSL does not tolerate setting minimum_version greater than 
maximum_version
type: behavior
versions: Python 3.7, Python 3.8

___
Python tracker 

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



[issue34000] Document when compile returns a code object v. AST

2018-06-29 Thread Geoffrey Sneddon

New submission from Geoffrey Sneddon :

The compile built-in documentation says:

> Compile the source into a code or AST object.

It doesn't however go on to say when it returns each!

It does however note:

> If you want to parse Python code into its AST representation, see ast.parse().

So compile can compile the source into an AST object, but if I want to parse 
Python code into an AST I should use ast.parse?

As far as I can tell, this goes back to Python 2.5: 
https://docs.python.org/2/whatsnew/2.5.html#build-and-c-api-changes

>From the What's New page:

> It’s possible for Python code to obtain AST objects by using the compile() 
> built-in and specifying _ast.PyCF_ONLY_AST as the value of the flags parameter

So that would seem to be the case when compile returns an AST!

Interestingly, the implementation of ast.parse *literally just calls compile* 
(https://github.com/python/cpython/blob/58ed7307ea0b5c5aa052291ebc3030f314f938d8/Lib/ast.py#L30-L35).

Note, however, this means a further part of the compile documentation is wrong:

> The optional arguments flags and dont_inherit control which future statements 
> (see PEP 236) affect the compilation of source.

flags is therefore something more general than just controlling which future 
statements affect the source, given it also controls the output type of the 
function.

In short, we should:

 * document the flags argument can take _ast.PyCF_ONLY_AST *or* change the 
documentation to say it returns a code object (and not an AST object)

--
assignee: docs@python
components: Documentation
messages: 320721
nosy: docs@python, gsnedders
priority: normal
severity: normal
status: open
title: Document when compile returns a code object v. AST
versions: Python 2.7, Python 3.7

___
Python tracker 

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



[issue33999] `pip3 install past` does not work

2018-06-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

This is a tracker for bugs in the Python interpreter. Use appropriate tracker 
for reporting bugs in a third-party project.

--
nosy: +serhiy.storchaka
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



[issue33999] `pip3 install past` does not work

2018-06-29 Thread Peter


New submission from Peter :

When trying to install the `past` module using pip 10.0.1 using python 3.6.5 I 
get:

$ pip3 install past --no-compile
Collecting past
  Could not find a version that satisfies the requirement past (from versions: )
No matching distribution found for past


Confirming package exists with pip search:

$ pip3 search past | grep past
past (0.11.1)- [Experimental] Run Python 2 code 
from Python 3


--
components: 2to3 (2.x to 3.x conversion tool)
messages: 320719
nosy: PeterGhimself
priority: normal
severity: normal
status: open
title: `pip3 install past` does not work
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



[issue33998] random.randrange completely ignores the step argument when stop is None

2018-06-29 Thread Dan Snider


Change by Dan Snider :


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

___
Python tracker 

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



[issue33998] random.randrange completely ignores the step argument when stop is None

2018-06-29 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

"I have a really hard time believing that [...] others haven't noticed this 
rather glaring flaw in the code."

*shrug* Easy or hard for you to believe, nevertheless this same quote-unquote 
"flaw" goes back to Python 1.5 or older. Whether that makes it a flaw, a bug or 
a feature, I don't know.

The documentation does say:

"Keyword arguments should not be used because the 
function may use them in unexpected ways."

https://docs.python.org/3/library/random.html#random.randrange

so I'd suggest that the behaviour of randrange(10, seed=2) is currently 
considered undefined.

--
nosy: +rhettinger, steven.daprano

___
Python tracker 

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



[issue33998] random.randrange completely ignores the step argument when stop is None

2018-06-29 Thread Dan Snider


New submission from Dan Snider :

This "bug" is present even in 2.7. I have a really hard time believing that, 
even if it would be incredibly rare for someone to stumble upon this, may 
others haven't noticed this rather glaring flaw in the code. I couldn't find 
any similar issues though. 

My idea of how conservative a standard library function should be may be skewed 
too far to right. So perhaps I'm mistaken that it's reasonable to assume 
`random.randrange(10, step=2)` should either:

* raise an error warning users that providing an alternate `step` value has no 
effect unless  `stop` is also provided;

* go ahead and allow it to work. Logically, the above function call is no 
different than `random.randrange(0, 10, 2)`.

While I have created a patch that allows alternate (positive) `step` values 
even if `stop` is `None`, I still think my first instinct is to say that it 
really should just behave like `range` by raising an error when `stop is None 
and step != 1`. In that way it emulates the fact `range` only takes positional 
arguments while keeping the performance boost the current signature has over an 
`*args` implementation.

I'll try to attach a PR to this after posting but I've never done this before. 
The patch also includes a simple but effective optimization which at the very 
least speeds the 1 argument form by 8.5% despite the extra `step==1` check, 
with the only "cost" of (rightfully, imo) ensuring that only integers are used.

--
components: Library (Lib)
messages: 320717
nosy: bup
priority: normal
severity: normal
status: open
title: random.randrange completely ignores the step argument when stop is None
versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue33996] Crash in gen_send_ex(): _PyErr_GetTopmostException() returns freed memory

2018-06-29 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



[issue33997] multiprocessing Pool hangs in terminate()

2018-06-29 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +vstinner

___
Python tracker 

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



[issue33914] test_gdb fails for Python 2.7.15

2018-06-29 Thread STINNER Victor


STINNER Victor  added the comment:

> Thanks STINNER for your help.The issue has been resolved.It was related to 
> gdb itself and not Python.

Oh good! Happy to see that you solved your issue!

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



[issue33914] test_gdb fails for Python 2.7.15

2018-06-29 Thread STINNER Victor


Change by STINNER Victor :


--
resolution: fixed -> not a bug

___
Python tracker 

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



[issue25612] nested try..excepts don't work correctly for generators

2018-06-29 Thread STINNER Victor


STINNER Victor  added the comment:

It seems like this issue introduced a regression in Python 3.7.0: bpo-33996 
"Crash in gen_send_ex(): _PyErr_GetTopmostException() returns freed memory".

--

___
Python tracker 

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



[issue33996] Crash in gen_send_ex(): _PyErr_GetTopmostException() returns freed memory

2018-06-29 Thread STINNER Victor


STINNER Victor  added the comment:

> I suspected that the bug is caused by the new exc_info attribute of 
> PyThreadState: commit ae3087c6382011c47db82fea4d05f8bbf514265d.

The change comes from bpo-25612.

--

___
Python tracker 

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



[issue33978] logging.config.dictConfig with file handler leaks resources

2018-06-29 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
pull_requests: +7613
stage:  -> patch review

___
Python tracker 

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



[issue33996] Crash in gen_send_ex(): _PyErr_GetTopmostException() returns freed memory

2018-06-29 Thread STINNER Victor


New submission from STINNER Victor :

Attached dagpool_test.py script triggers a crash on Python 3.7, but works well 
on Python 3.6. The script is a highly simplified code of tests/dagpool_tests.py 
of eventlet.

To reproduce the crash, you only need a single dependency: greenlet. Example 
using a venv:

python3.7 -m venv ENV
ENV/bin/python -m pip install greenlet

Then run the script:

$ test_venv/bin/python dagpool_test.py 
Segmentation fault (core dumped)

eventlet bug report:
https://github.com/eventlet/eventlet/issues/475


I suspected that the bug is caused by the new exc_info attribute of 
PyThreadState: commit ae3087c6382011c47db82fea4d05f8bbf514265d.

$ gdb -args test_venv/bin/python -X faulthandler dagpool_test.py
(gdb) run

Program received signal SIGSEGV, Segmentation fault.
0x0056c9d2 in PyErr_SetObject (exception=, 
value=0x0) at Python/errors.c:101
101 Py_INCREF(exc_value);
(gdb) where
#0  0x0056c9d2 in PyErr_SetObject (exception=, 
value=0x0) at Python/errors.c:101
#1  0x0056cd4e in PyErr_SetNone (exception=) 
at Python/errors.c:162
#2  0x0067cb0c in gen_send_ex (gen=0x7fffea651d78, arg=0x0, exc=0, 
closing=0) at Objects/genobject.c:241
#3  0x0067dd86 in gen_iternext (gen=0x7fffea651d78) at 
Objects/genobject.c:542
#4  0x005461b1 in _PyEval_EvalFrameDefault (...)
...

(gdb) p tstate
$1 = (PyThreadState *) 0xa132a0

(gdb) p tstate->exc_info
$2 = (_PyErr_StackItem *) 0x7fffea651930

(gdb) p *tstate->exc_info
$3 = {
  exc_type = 0x0, 
  exc_value = 0x0, 
  exc_traceback = 0x0, 
  previous_item = 0x7fffea651d20
}

(gdb) p *tstate->exc_info->previous_item
$4 = {
  exc_type = , 
  exc_value = , 
  exc_traceback = , 
  previous_item = 0xdbdbdbdbdbdbdbdb
}

--
components: Interpreter Core
files: dagpool_test.py
keywords: 3.7regression
messages: 320712
nosy: Mark.Shannon, ned.deily, vstinner, yselivanov
priority: release blocker
severity: normal
status: open
title: Crash in gen_send_ex(): _PyErr_GetTopmostException() returns freed memory
versions: Python 3.7, Python 3.8
Added file: https://bugs.python.org/file47658/dagpool_test.py

___
Python tracker 

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



[issue33997] multiprocessing Pool hangs in terminate()

2018-06-29 Thread Roundup Robot


Change by Roundup Robot :


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

___
Python tracker 

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



[issue33978] logging.config.dictConfig with file handler leaks resources

2018-06-29 Thread Xiang Zhang


Change by Xiang Zhang :


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue33997] multiprocessing Pool hangs in terminate()

2018-06-29 Thread Erik Wolf


New submission from Erik Wolf :

The terminate() method of multiprocessing.Pool hangs sporadically.
I could track this issue down to the fact that _handle_results() hangs in the 
outqueue-cleanup. poll() returned True but get() actually hangs endlessly never 
returning any data.

--
components: Windows
messages: 320713
nosy: Erik Wolf, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: multiprocessing Pool hangs in terminate()
type: behavior
versions: Python 3.6, Python 3.7

___
Python tracker 

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



[issue33990] CPPFLAGS during ./configure are not passed-through in sysconfig.customize_compiler

2018-06-29 Thread László Kiss Kollár

Change by László Kiss Kollár :


--
nosy: +lkollar

___
Python tracker 

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



[issue33991] lib2to3 should parse f-strings

2018-06-29 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

> @Steven lib2to3 is no longer specifically for python 2 code, it also 
> parses python 3 code

Ah, all good then. Thanks.

--

___
Python tracker 

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



[issue25862] TextIOWrapper assertion failure after read() and SEEK_CUR

2018-06-29 Thread miss-islington


miss-islington  added the comment:


New changeset eabebbb54c2604fd8d08e8019ea1be634aed8c2f by Miss Islington (bot) 
in branch '3.7':
bpo-25862: Fix assertion failures in io.TextIOWrapper.tell(). (GH-3918)
https://github.com/python/cpython/commit/eabebbb54c2604fd8d08e8019ea1be634aed8c2f


--
nosy: +miss-islington

___
Python tracker 

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



[issue33959] doc Remove time complexity mention from list Glossary entry

2018-06-29 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue25862] TextIOWrapper assertion failure after read() and SEEK_CUR

2018-06-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7612

___
Python tracker 

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



[issue25862] TextIOWrapper assertion failure after read() and SEEK_CUR

2018-06-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 23db935bcf258657682e66464bf8512def8af830 by Serhiy Storchaka 
(Zackery Spytz) in branch 'master':
bpo-25862: Fix assertion failures in io.TextIOWrapper.tell(). (GH-3918)
https://github.com/python/cpython/commit/23db935bcf258657682e66464bf8512def8af830


--

___
Python tracker 

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



[issue32732] LoggingAdapter ignores extra kwargs of Logger#log()

2018-06-29 Thread Steffen Schuldenzucker


Steffen Schuldenzucker  added the comment:

To give you a data point, I just hit this problem. Based on the docs and common 
sense, I didn't expect LoggerAdapter to throw away the other extra arguments. I 
strongly feel that this is a bug. I cannot see how it could be desired behavior 
over the one proposed by mcoolive.

My use case is as follows: I'm using python with pandas to clean up a large 
amount of messy data and I'm using the logging framework to keep track of data 
consistency issues. Most of these are not critical errors, but I still need to 
be aware of them. I'm using 'extra' to add contextual information at different 
layers, like the filename when a file is read in and the column/field name when 
that particular column is processed. I store that data in a structured format 
so that I can come back to it later if needed.

I'm currently monkey patching LoggerAdapter.record to achieve the behavior 
mcoolive described. Specifically:

def _LoggerAdapter_process_fixed(self: logging.LoggerAdapter, msg, kwargs):
extra = self.extra.copy()
extra.update(kwargs.get('extra', dict()))
kwargs['extra'] = extra
return msg, kwargs
logging.LoggerAdapter.process = _LoggerAdapter_process_fixed

--
nosy: +srs

___
Python tracker 

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



[issue33991] lib2to3 should parse f-strings

2018-06-29 Thread skreft


skreft  added the comment:

@Steven lib2to3 is no longer specifically for python 2 code, it also parses 
python 3 code and is the building block of tools like YAPF.

See Eli's comment on this https://bugs.python.org/issue23894: "AFAIK lib2to3 
has been repurposed to parse Python 3 as well - it has certainly gained quite a 
bit of support for that".

I added the versions 3.6-3.8 as previous ones are not able to parse f-strings.

--
versions: +Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue25457] json dump fails for mixed-type keys when sort_keys is specified

2018-06-29 Thread James Edwards


James Edwards  added the comment:

This came up in a StackOverflow question[1] today, so I took a stab at 
addressing the error.  The changes don't restore the 2.x behavior, but just do 
as R. David Murray suggested and coerce the keys to strings prior to sorting to 
prevent the error.

The changes in _json.c and json.decoder are handled slightly differently in the 
case of skipkeys.

Both create a list of (coerced_key, value) pairs, sorts it (when specified), 
and uses that in place of the PyDict_Items / .items().

When skipkeys=True and invalid (uncoercible) keys are found, the c code will 
just not append that item to the coerced_items list while the python code uses 
None to signal that item should be filtered out.

(That being said, I'm not a huge fan of the approach I used in the Python code 
and may rewrite using .append instead of a generator.

The c code could definitely use a review when it comes to reference counts.

Fork commit: 
https://github.com/jheiv/cpython/commit/8d3612f56a137da0d26b83d00507ff2f11bca9bb

[1] 
https://stackoverflow.com/questions/51093268/why-am-i-getting-typeerror-unorderable-types-str-int-in-this-code

--
nosy: +jedwards

___
Python tracker 

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



[issue33914] test_gdb fails for Python 2.7.15

2018-06-29 Thread Vibhuti


Vibhuti  added the comment:

Thanks STINNER for your help.The issue has been resolved.It was related to gdb 
itself and not Python.

--

___
Python tracker 

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