[issue24864] errors writing to stdout during interpreter exit exit with status 0

2015-08-14 Thread Robert Collins

Robert Collins added the comment:

Updating the title to reflect my deeper understanding: the only issue here is 
that we don't alter the exit code.

--
title: errors writing to stdout are uncatchable and exit with status 0 - 
errors writing to stdout during interpreter exit exit with status 0

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



[issue24859] ctypes.Structure bit order is reversed - counts from right

2015-08-14 Thread zeero

zeero added the comment:

Sorry for the inconvenience.

The format specification can be found in chapter 2.1 in 

http://vector.com/portal/medien/cmc/application_notes/AN-ION-1-3100_Introduction_to_J1939.pdf

So I would write down the field contents in that order

_fields_ = [('reserved',c_uint8,3),
('priority',c_uint8,3),
('extended_data_page',c_uint8,1),
('data_page',c_uint8,1)
...
]

I expect the first Byte to be 0x1C when I set priority to 7 but it came out as 
0x38, after tunneling it through the Union object.

Reversing the order of the bit fields makes it work like expected.

--

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



[issue24864] errors writing to stdout during interpreter exit exit with status 0

2015-08-14 Thread Martin Panter

Martin Panter added the comment:

I don’t know much about PDB, but if this is just about setting the exit code, 
it may be a dupe of Issue 5319. The fix proposed there is a new Py_FinalizeEx() 
API that returns an exit status, if I remember correctly.

--
nosy: +martin.panter

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



[issue18383] test_warnings modifies warnings.filters when running with -W default

2015-08-14 Thread Alex Shkop

Alex Shkop added the comment:

This is updated patch that doesn't alter warn_explicit behavior.

So the following:
simplefilter(ignore)
simplefilter(error, append=True)
simplefilter(ignore, append=True)

will ignore all warnings with this patch and no duplicates are inserted to 
warnings.filters. Also added a test for that case.

--
Added file: http://bugs.python.org/file40178/issue18383_34_2.diff

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



[issue24863] Incoherent bevavior with umlaut in regular expressions

2015-08-14 Thread Christian Klein

New submission from Christian Klein:

The Python 2.7 re module seems not to agree what to consider a word character:

import re
s = u'f\xfc'
print re.sub('\W', '*', s, re.UNICODE)
print re.findall('\w', s, re.UNICODE)

The application of re.sub removes the character u'ü' which implies it's 
considered a non word character (\W).
But then re.findall shows it as a word character (\w).

Python 3.4 and Python 3.5 are correct respectively coherent.
(But that's unfortunately not an option for Google App Engine)

--
components: Regular Expressions
messages: 248560
nosy: cklein, ezio.melotti, mrabarnett
priority: normal
severity: normal
status: open
title: Incoherent bevavior with umlaut in regular expressions
type: behavior
versions: Python 2.7

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



[issue24863] Incoherent bevavior with umlaut in regular expressions

2015-08-14 Thread eryksun

eryksun added the comment:

You're passing re.UNICODE (32) as the value of the count parameter, i.e. the 
function signature is re.sub(pattern, repl, string, count=0, flags=0).

--
nosy: +eryksun
resolution:  - not a bug
status: open - closed

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



[issue24863] Incoherent bevavior with umlaut in regular expressions

2015-08-14 Thread Christian Klein

Christian Klein added the comment:

Wow, that's very embarrassing. Thank you.
(I tried to get further help before but nobody recognized that stupid mistake)

--

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



[issue24865] IDLE crashes on entering diacritical mark (Alt-E) on Mac OS X

2015-08-14 Thread Ned Deily

Ned Deily added the comment:

This is due to an old Tk bug (http://sourceforge.net/p/tktoolkit/bugs/2722/) 
still present in the Apple-supplied versions of Tcl/Tk 8.5 on OS X.  See 
https://www.python.org/download/mac/tcltk/ and/or Issue22566. If you are using 
Python 3.4.x from a python.org installer, install a newer version of Tcl/Tk 8.5 
in /Library/Frameworks (not /System/Library/Frameworks) from ActiveState or 
build your own.

--
resolution:  - duplicate
stage:  - resolved
status: open - closed
superseder:  - International keyboard makes IDLE crash on OSX

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



[issue24801] right-mouse click in IDLE on Mac doesn't work

2015-08-14 Thread Mark Roseman

Mark Roseman added the comment:

There is no notion of middle button on Mac, hence right button is B2. It's 
documented. Current Tk 8.6 has even removed the PasteSelection binding from 
B2 on Aqua because of this (I've filed a Tk bug report to backport this to 
8.5). 8.6 also defines a ContextMenu virtual event, which on Mac is tied to 
B2.

Mac UI guidelines define use of 'right button' (when available) to be used for 
context menu clicks.

So yeah, we should change this. :-)

--

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



[issue21159] configparser.InterpolationMissingOptionError is not very intuitive

2015-08-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

You forgot to merge default with 3.5.

--
nosy: +serhiy.storchaka
status: closed - open

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



[issue21159] configparser.InterpolationMissingOptionError is not very intuitive

2015-08-14 Thread Robert Collins

Robert Collins added the comment:

anyhow fixed

--
status: open - closed

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



[issue24865] IDLE crashes on entering diacritical mark (Alt-E) on Mac OS X

2015-08-14 Thread Vlad Gumerov

New submission from Vlad Gumerov:

Mac OS X 10.10.3
IDLE 3.4.3, Python 3.4.3

Steps:
1)Open IDLE
2)Input diacritical mark ´ (Alt+E)

Result:
IDLE crashes

--
components: IDLE
messages: 248572
nosy: Vlad Gumerov
priority: normal
severity: normal
status: open
title: IDLE crashes on entering diacritical mark (Alt-E) on Mac OS X
type: crash
versions: Python 3.4

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



[issue21159] configparser.InterpolationMissingOptionError is not very intuitive

2015-08-14 Thread Robert Collins

Robert Collins added the comment:

Huh? I definitely did. I can see there's a extra head now, but I did the merge 
up per protocol locally.

--

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



[issue21159] configparser.InterpolationMissingOptionError is not very intuitive

2015-08-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7191910aeb45 by Robert Collins in branch 'default':
Issue #21159: Improve message in configparser.InterpolationMissingOptionError.
https://hg.python.org/cpython/rev/7191910aeb45

--

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



[issue24750] IDLE: Cosmetic improvements for main window

2015-08-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Oh, I were wrong. 8.4 still is supported in 3.5. The support of 8.3 was dropped.

--

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



[issue24851] infinite loop in faulthandler._stack_overflow

2015-08-14 Thread Ronald Oussoren

Ronald Oussoren added the comment:

GCC has a pragma and function attributes for changing the optimisation flags, 
that could be used to disable the tail call optimazation here.

Something like the following (using a pragma):

#pragma GCC push_options
#pragma GCC optimize (-fno-optimize-sibling-calls)
functions go here
#pragma GCC pop_options

Note: completely untested, and would need preprocessor guards to avoid warnings 
with some other compilers.

--
nosy: +ronaldoussoren

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



[issue24801] right-mouse click in IDLE on Mac doesn't work

2015-08-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Looks as right button on Mac corresponds to middle button on X Window (paste 
selection and scroll if moved). This behavior is standard for all Tk 
applications. I don't think we should break this.

--
nosy: +serhiy.storchaka

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



[issue24864] errors writing to stdout are uncatchable and exit with status 0

2015-08-14 Thread Robert Collins

New submission from Robert Collins:

I was trying to demonstrate how testing some code is hard, and I stumbled upon 
this.

The following code should be debuggable when run with a bad stdout - e.g.

python foo.py  /dev/full

---
import sys
import traceback

import pdb;pdb.Pdb(stdout=sys.stderr).set_trace()
try:
print(What... is your quest?)
except:
sys.stderr.write(Exception in program.\n)
traceback.print_exc(file=sys.stderr)
---

Here is a transcript of a session with it:
---
$ python ./02.py  /dev/full 
 /home/robertc/work/Presentations/reveal.js/effectsnippets/02.py(5)module()
- try:
(Pdb) n
 /home/robertc/work/Presentations/reveal.js/effectsnippets/02.py(6)module()
- print(What... is your quest?)
(Pdb) n
--Return--
 /home/robertc/work/Presentations/reveal.js/effectsnippets/02.py(6)module()-None
- print(What... is your quest?)
(Pdb) n
Exception ignored in: _io.TextIOWrapper name='stdout' mode='w' 
encoding='UTF-8'
OSError: [Errno 28] No space left on device
$ echo $?
0
---

The same thing done on stderr exits with an exit code of 0 as well.

--
messages: 248570
nosy: rbcollins
priority: normal
severity: normal
status: open
title: errors writing to stdout are uncatchable and exit with status 0
versions: Python 3.6

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



[issue24865] IDLE crashes on entering diacritical mark (Alt-E) on Mac OS X

2015-08-14 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
nosy: +ned.deily, ronaldoussoren, terry.reedy

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



[issue24864] errors writing to stdout are uncatchable and exit with status 0

2015-08-14 Thread Robert Collins

Robert Collins added the comment:

Oh, and for added joy sys.last_value is not set here, so I've yet to manage to 
poke at what is being executed - clearly pdb is still managing to single-step, 
ish.

--

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



[issue24864] errors writing to stdout are uncatchable and exit with status 0

2015-08-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

See also issue11380.

--
nosy: +serhiy.storchaka

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



[issue24801] right-mouse click in IDLE on Mac doesn't work

2015-08-14 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
stage:  - patch review

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



[issue24801] right-mouse click in IDLE on Mac doesn't work

2015-08-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Ah, so this is a workaround of 8.5- bug. Then looks reasonable to me.

Added comments on Rietveld.

--

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



[issue24844] Python 3.5rc1 compilation error with Apple clang 4.2 included with Xcode 4

2015-08-14 Thread Ronald Oussoren

Changes by Ronald Oussoren ronaldousso...@mac.com:


--
nosy: +ronaldoussoren

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



[issue24867] Asyncio get_frame fails with native coroutines

2015-08-14 Thread David Griffin

New submission from David Griffin:

I've been playing around with native coroutines and asyncio, and came across an 
issue with retrieving exceptions from tasks: The get_frame method on a Task in 
asyncio fails with an AttibuteError because it assumes that gi_frame as the 
attribute containing the stack frame; with native coroutines it's cr_frame.

I've attached a quick patch that just uses hasattr to see if gi_frame is 
present, and if not try cr_frame. This may not be the most elegant solution, 
but it does fix the issue. If there's any other stuff I can provide to help 
with this (within reason), just say the word.

--
components: asyncio
files: fix_asyncio_task_get_frame.diff
keywords: patch
messages: 248589
nosy: David Griffin, gvanrossum, haypo, yselivanov
priority: normal
severity: normal
status: open
title: Asyncio get_frame fails with native coroutines
versions: Python 3.5
Added file: http://bugs.python.org/file40179/fix_asyncio_task_get_frame.diff

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



[issue24862] subprocess.Popen behaves incorrect when moved in process tree

2015-08-14 Thread Andre Merzky

Andre Merzky added the comment:

As mentioned in the PS, I understand that the approach might be questionable.  
But (a) the attached test shows the problem also for watcher *processes*, not 
threads, and (b) an error should be raised in unsupported uses, not a silent, 
unexpected behavior which mimics success.

--

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



[issue24867] Asyncio Task.get_stack fails with native coroutines

2015-08-14 Thread David Griffin

David Griffin added the comment:

It should be noted that when I said get_frame in the original comment, I 
actually meant get_stack

--
title: Asyncio get_frame fails with native coroutines - Asyncio Task.get_stack 
fails with native coroutines

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



[issue24851] infinite loop in faulthandler._stack_overflow

2015-08-14 Thread Paul Murphy

Paul Murphy added the comment:

...
#pragma GCC optimize (no-optimize-sibling-calls)
...

Does preserve the desired behavior under -O2 and -O3, probably a bit nicer than 
using O0.

--

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



[issue24866] Boolean representation of Q/queue objects does not fit behaviour of lists etc.

2015-08-14 Thread Raymond Hettinger

Changes by Raymond Hettinger raymond.hettin...@gmail.com:


--
assignee:  - rhettinger
nosy: +rhettinger

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



[issue24847] Can't import tkinter in Python 3.5.0rc1

2015-08-14 Thread Zachary Ware

Zachary Ware added the comment:

I'll try to get a proper review done before Wednesday.  From a cursory glance, 
this looks fine, but unpalatable.  The solution I'd really like would be to 
create proper .vcxprojs for Tcl/Tk/Tix (partly because that would also fix an 
issue with building with ICC), but that's a *lot* of extra work.

--

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



[issue24766] Subclass of property doesn't preserve instance __doc__ when using doc= argument

2015-08-14 Thread Erik Bray

Erik Bray added the comment:

Sorry for the hold up.  Attached is another diff providing a test.  I think 
this is all that's really needed (since this is just a special case of the 
issue already tested for in this particular test class.

--
Added file: http://bugs.python.org/file40181/property-doc-test.patch

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



[issue24867] Asyncio Task.get_stack fails with native coroutines

2015-08-14 Thread Yury Selivanov

Yury Selivanov added the comment:

Looks like we didn't have unittests for Task.get_stack()/Task.print_stack().

Anyways, it's now fixed, I'll make a PR for Larry to get this in 3.5.0rc2.

--
assignee:  - yselivanov
nosy: +larry
priority: normal - release blocker
resolution:  - fixed
stage:  - resolved
status: open - closed

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



[issue24849] Add __len__ to map, everything in itertools

2015-08-14 Thread Raymond Hettinger

Raymond Hettinger added the comment:

[flying sheep]
 that’s probably the end of this :(

Yes, I think so.

--
resolution:  - rejected
status: open - closed

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



[issue17570] Improve devguide Windows instructions

2015-08-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 49be7fba3568 by Zachary Ware in branch 'default':
Closes #17570: Improve instructions for Windows.
https://hg.python.org/devguide/rev/49be7fba3568

--
nosy: +python-dev
resolution:  - fixed
stage: commit review - resolved
status: open - closed

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



[issue24305] The new import system makes it impossible to correctly issue a deprecation warning for a module

2015-08-14 Thread Brett Cannon

Brett Cannon added the comment:

Will that be thread-safe? Plus storing that value in a way that _warnings and 
warnings can read will require something like a single-item list that can be 
mutated in-place.

The other option is to teach warnings to skip anything coming from 
importlib/_bootstrap* unless stacklevel==1 and that frame happens to be in the 
importlib code.

--

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



[issue24305] The new import system makes it impossible to correctly issue a deprecation warning for a module

2015-08-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Frames can be skipped only for warnings issued by imported module code, not for 
warnings issued by import machinery itself.

I propose following algorithm:

Before executing module code push the current frame and the number of frames to 
skip in global stack in the warnings module, and pop it after execution (public 
context manager can help). In warnings.warn() skip stacklevel frames and if 
saved frame was skipped, skip corresponding additional number of frames. Repeat 
for all saved frames.

--

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



[issue24766] Subclass of property doesn't preserve instance __doc__ when using doc= argument

2015-08-14 Thread Ethan Furman

Ethan Furman added the comment:

Larry, can we get this into 3.5?  I'll create a pull-request in a couple days.

--
nosy: +larry

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



[issue24305] The new import system makes it impossible to correctly issue a deprecation warning for a module

2015-08-14 Thread Nathaniel Smith

Nathaniel Smith added the comment:

For 3.4/3.5 purposes, I propose a simpler algorithm: first, define a function 
which takes a module name and returns true if it is part of the internal 
warning machinery and false otherwise. This is easy because we know what import 
machinery we ship.

Then, to walk the stack in warnings.py, do something like:

frame = sys._get frame(1)
if is_import_machinery(frame.module_name):
  skip_frame = lambda modname: False
else:
  skip_frame = is_import_machinery
def next_unskipped_frame(f):
  new = f
  while new is f or skip_frame(new.module_name):
new = new.caller
for i in range(stacklevel - 1):
  frame = next_unskipped_frame(frame)

This produces reasonable behavior for warnings issued by both regular user code 
and by warnings issued from inside the warning machinery, and it avoids having 
to explicitly keep track of call depths.

Then we can worry about coming up with an all-singing all-dancing generalized 
version for 3.6.

--

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



[issue24852] Python 3.5.0rc1 HOWTO Use Python in the web needs fix

2015-08-14 Thread Raymond Hettinger

Raymond Hettinger added the comment:

 It's probably better to remove the document for now

I concur.

 Although, this topic sees lot of change regularly, 
 so it is probably not a good one for the standard
 documentation after all.

This makes sense.  We typically use wiki pages for
this kind of material.  For example, see the debugging
tools page at:
https://wiki.python.org/moin/PythonDebuggingTools

--
nosy: +rhettinger

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



[issue24867] Asyncio Task.get_stack fails with native coroutines

2015-08-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 53d2a7c023bc by Yury Selivanov in branch '3.4':
Issue #24867: Fix Task.get_stack() for 'async def' coroutines
https://hg.python.org/cpython/rev/53d2a7c023bc

New changeset d25022765186 by Yury Selivanov in branch '3.5':
Merge 3.4 (Issue #24867)
https://hg.python.org/cpython/rev/d25022765186

New changeset c0b7829e3074 by Yury Selivanov in branch 'default':
Merge 3.5 (issue #24867)
https://hg.python.org/cpython/rev/c0b7829e3074

--
nosy: +python-dev

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



[issue17570] Improve devguide Windows instructions

2015-08-14 Thread Zachary Ware

Zachary Ware added the comment:

Made a couple of other fixes while fixing the point I'd already raised:

- Changed all instances of `...` to *...*
- Changed from PCbuild\python.exe to python.bat
- Wrapped a couple long lines

Thanks for the patch!

--

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



[issue24847] Can't import tkinter in Python 3.5.0rc1

2015-08-14 Thread Zachary Ware

Zachary Ware added the comment:

To expand on 'unpalatable': I'd rather we not have to carry any patches against 
the Tcl/Tk sources (Tix I care less about, since we seem to be the de facto 
maintainers of it).

--

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



[issue24863] Incoherent bevavior with umlaut in regular expressions

2015-08-14 Thread Zachary Ware

Changes by Zachary Ware zachary.w...@gmail.com:


--
stage:  - resolved

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



[issue23810] Suboptimal stacklevel of deprecation warnings for formatter and imp modules

2015-08-14 Thread Brett Cannon

Brett Cannon added the comment:

Merging with the other issue so there is a single place to track this

--
superseder:  - Suboptimal stacklevel of deprecation warnings for formatter and 
imp modules

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



[issue23810] Suboptimal stacklevel of deprecation warnings for formatter and imp modules

2015-08-14 Thread Brett Cannon

Changes by Brett Cannon br...@python.org:


--
resolution:  - duplicate
status: open - closed

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



[issue17570] Improve devguide Windows instructions

2015-08-14 Thread Carol Willing

Carol Willing added the comment:

Zach, Steve, Ezio: The latest patch is ready to be committed. Thanks.

--
stage: patch review - commit review

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



[issue17570] Improve devguide Windows instructions

2015-08-14 Thread Zachary Ware

Zachary Ware added the comment:

The part of the patch that I pointed out in my previous message hasn't changed, 
and is wrong.

--

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



[issue17570] Improve devguide Windows instructions

2015-08-14 Thread Zachary Ware

Changes by Zachary Ware zachary.w...@gmail.com:


--
stage: commit review - needs patch

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



[issue24492] using custom objects as modules: AttributeErrors new in 3.5

2015-08-14 Thread Brett Cannon

Brett Cannon added the comment:

I have merged my 3.5.0 patch into 3.5 and default, so that should fix the issue 
Armin and CFFI was having.

--
assignee: larry - brett.cannon
resolution:  - fixed
stage: commit review - resolved
status: open - closed

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



[issue23810] Suboptimal stacklevel of deprecation warnings for formatter and imp modules

2015-08-14 Thread Brett Cannon

Changes by Brett Cannon br...@python.org:


--
superseder: Suboptimal stacklevel of deprecation warnings for formatter and imp 
modules - The new import system makes it impossible to correctly issue a 
deprecation warning for a module

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



[issue17570] Improve devguide Windows instructions

2015-08-14 Thread Zachary Ware

Zachary Ware added the comment:

Sorry, I don't think we're on the same page yet :).  My issue was with a 
different hunk further down.

Looking at it again, the fix I want is simple enough I'll just do it at commit; 
I'll get it later today.

--
assignee: willingc - zach.ware
stage: needs patch - commit review

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



[issue17570] Improve devguide Windows instructions

2015-08-14 Thread Carol Willing

Carol Willing added the comment:

Zach, Sorry for not comprehending your comment re: latest patch correctly.

Since Rietveld isn't available on devguide, which makes comparison of patches 
difficult (at least for me), here's some proposed wording to see if I am 
understanding your comment correctly. If so, I will submit a new patch. Thanks.


Suggested wording for:

Minimal Configuration
-
To use Mercurial as a committer (both of your and others’ patches),
you should set up some basic options in your configuration file.
On all platforms, you must edit ~/.hgrc. On Windows, TortoiseHg has a
graphical settings dialog for most options, meaning you don’t need to edit
the file directly if you find a graphical interface more helpful.

--

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



[issue24869] shlex lineno inaccurate with certain inputs

2015-08-14 Thread Robert Escriva

New submission from Robert Escriva:

The newlines calculated by the shlex module are inaccurate for certain inputs 
with comments inline.  I've attached a simple script that illustrates the 
problem.

My assumption here is that the lineno is supposed to match a line related to 
the current token.  I'm trying to use changes in the lineno to aggregate tokens 
into commands.  This may not be an intended use case.

--
components: Library (Lib)
files: badlex.py
messages: 248596
nosy: rescrv
priority: normal
severity: normal
status: open
title: shlex lineno inaccurate with certain inputs
versions: Python 3.4
Added file: http://bugs.python.org/file40180/badlex.py

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



[issue24492] using custom objects as modules: AttributeErrors new in 3.5

2015-08-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset cf3a62a8d786 by Brett Cannon in branch '3.5':
Issue #24492: make sure that ``from ... import ...` raises an
https://hg.python.org/cpython/rev/cf3a62a8d786

New changeset bbe6b215df5d by Brett Cannon in branch '3.5':
Merge from 3.5.0 for issue #24492
https://hg.python.org/cpython/rev/bbe6b215df5d

New changeset b0a6bba16b9c by Brett Cannon in branch 'default':
Merge from 3.5 for issue #24492
https://hg.python.org/cpython/rev/b0a6bba16b9c

--
nosy: +python-dev

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



[issue24305] The new import system makes it impossible to correctly issue a deprecation warning for a module

2015-08-14 Thread Brett Cannon

Changes by Brett Cannon br...@python.org:


--
assignee:  - larry
nosy: +larry

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



[issue24305] The new import system makes it impossible to correctly issue a deprecation warning for a module

2015-08-14 Thread Brett Cannon

Brett Cannon added the comment:

I have merged over issue #23810 because they are aiming to solve the same 
problem and the conversation is split too much.

Just thinking out loud, this situation is compounded by the fact that importlib 
itself has some warnings and so automatically stripping out stack frames might 
make those warnings look odd.

Still not sure if Larry considers this a release blocker for 3.5.0. And any 
solution will need to be solved in warnings.py and _warnings.c.

Some days I really hate our warnings system.

--
dependencies:  -Suboptimal stacklevel of deprecation warnings for formatter and 
imp modules
keywords: +3.2regression
priority: normal - release blocker
versions: +Python 3.5, Python 3.6

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



[issue24833] IDLE tabnanny check fails

2015-08-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 724d9b589cfc by Terry Jan Reedy in branch '2.7':
Issue #24833: Add attribute reference needed for 3.x, but optional for 2.7,
https://hg.python.org/cpython/rev/724d9b589cfc

New changeset cce226356477 by Terry Jan Reedy in branch '3.4':
Issue #24833: Add attribute reference needed for 3.x.
https://hg.python.org/cpython/rev/cce226356477

--
nosy: +python-dev

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



[issue24833] IDLE tabnanny check fails

2015-08-14 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I fixed the Idle part but would really like to see the cause of the tokenize 
error.

--
type:  - behavior
versions: +Python 2.7, Python 3.5, Python 3.6

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



[issue23749] asyncio missing wrap_socket (starttls)

2015-08-14 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy:  -pitrou

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



[issue24305] The new import system makes it impossible to correctly issue a deprecation warning for a module

2015-08-14 Thread Brett Cannon

Brett Cannon added the comment:

Nathaniel's solution is basically what I came up with in issue #23810 except I 
simply skipped subtracting from the stack level if it was found to be an 
internal import frame instead of swapping in and out a callable.

--

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



[issue24833] IDLE tabnanny check fails

2015-08-14 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I think there are two issues here.

1. tabnanny is run on the editor file every time Check Module Alt-X or Run 
Module F5 is used. However, Tabnanny is only rum after the file has been 
compiled as syntactically correct.  I don't think that the tokenize module 
should fail on a file that compiles. Please cut your file to the minimum needed 
to raise an error.  Then upload the complete traceback.

2. When a TokenError does occur, Idle executes
except tokenize.TokenError as msg:
msgtxt, (lineno, start) = msg
This must be the line that failed (the traceback would have said).  It is line 
74 in 3.4.3.  (Which version are you using?)  The fix is to add '.args' at the 
end.

--
nosy: +terry.reedy

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



[issue24769] Interpreter doesn't start when dynamic loading is disabled

2015-08-14 Thread Mikhail Terekhov

Changes by Mikhail Terekhov ter...@gmail.com:


--
nosy: +termim

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



[issue17570] Improve devguide Windows instructions

2015-08-14 Thread Carol Willing

Carol Willing added the comment:

Thanks Zach :D Makes more sense now ;)

--

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



[issue24798] _msvccompiler.py doesn't properly support manifests

2015-08-14 Thread Christoph Gohlke

Christoph Gohlke added the comment:

It seems the switch to '/MT' was consciously intended as Python 3.5 itself is 
now compiled with '/MT'. 
For now I have patched _msvccompiler.py to use '/MD' and continue to link 
libraries built with '/MD'.

--

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



[issue11380] Improve reporting of broken stdout pipe during interpreter shutdown

2015-08-14 Thread Robert Collins

Robert Collins added the comment:

Oh, just saw your comment Martin; yes, this does look like a dupe.

--

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



[issue24864] errors writing to stdout during interpreter exit exit with status 0

2015-08-14 Thread Robert Collins

Robert Collins added the comment:

This patch is a minimal stab at the issue.

We should do this change because as it stands genuine user affecting errors can 
be masked both in pipelines and non-pipeline cases.

A more comprehensive patch would also change e.g. Py_Exit, and the various 
other users of Py_Finalize like freeze.

I'm not sure where to add an automated test for this; it does sane things under 
my manual testing.

--

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



[issue24864] errors writing to stdout during interpreter exit exit with status 0

2015-08-14 Thread Robert Collins

Robert Collins added the comment:

Oh, just saw your comment Martin; yes, this does look like a dupe.

--

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



[issue24798] _msvccompiler.py doesn't properly support manifests

2015-08-14 Thread Steve Dower

Steve Dower added the comment:

Those libraries will depend on vcruntime140.dll which is not installed with 
CPython right now. In order for packages built with future compilers to work we 
need to statically link that dependency but not ucrt, which there are linker 
options for.

I'm thinking hard to come up with better approaches, but most of them require 
predicting the future. Create a new issue if you like or I'll make one when I 
have something to propose.

--

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



[issue24847] Can't import tkinter in Python 3.5.0rc1

2015-08-14 Thread Steve Dower

Steve Dower added the comment:

I'll submit them upstream if we decide they're what we want, as I've done with 
other patches for them. Or if we want to figure out reliable builds with 
avcxproj I'm okay with that too.

The fix that needs testing now is already checked in for 3.5.1. We just need 
confirmation that it works to merge it into 3.5.0.

--

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



[issue11380] Improve reporting of broken stdout pipe during interpreter shutdown

2015-08-14 Thread Robert Collins

Robert Collins added the comment:

Bah, wrong issue. Sorry.

--

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



[issue5319] stdout error at interpreter shutdown fails to return OS error status

2015-08-14 Thread Robert Collins

Robert Collins added the comment:

I think you need to make the following changes:

 - Py_Exit with a non-zero status code should probably preserve the code rather 
than replacing it with 1.
 - Ditto in Py_Main.
 - Add a defs entry for Py_FinalizeEx - should be a copy of the Py_Finalize 
entry with the return type modified.

--
nosy: +rbcollins

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



[issue24868] Python start

2015-08-14 Thread Terry J. Reedy

Terry J. Reedy added the comment:

For 3.4.3, run 'python -m idlelib' in the command window and you should see 
some error message.  But first run 'python' and at the  prompt, 'import 
tkinter' to see if tkinter is working properly.

--
nosy: +terry.reedy

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



[issue24864] errors writing to stdout during interpreter exit exit with status 0

2015-08-14 Thread Robert Collins

Changes by Robert Collins robe...@robertcollins.net:


--
resolution:  - duplicate
status: open - closed

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



[issue24870] surrogateescape is too slow

2015-08-14 Thread INADA Naoki

New submission from INADA Naoki:

surrogateescape is recommended way to mix binary data in string protocol.
But surrogateescape is too slow and it cause usability problem.

One actual problem is: https://github.com/PyMySQL/PyMySQL/issues/366

surrogateescape is slow because errorhandler is called with UnicodeError object.
bs.decode('utf-8', 'surrogateescape') may produce len(bs)/2 error objects 
internally when bs is random bytes.

surrogateescape is used with ASCII and UTF-8 encoding in ordinal.
Specialized implementation can make it faster.

I want to Python 3.4 and Python 3.5 solve this issue since it's critical problem
for some people.

--
components: Unicode
messages: 248631
nosy: ezio.melotti, haypo, naoki
priority: normal
severity: normal
status: open
title: surrogateescape is too slow
type: performance
versions: Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6

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



[issue24871] freeze.py doesn't work on x86_64 Linux out of the box

2015-08-14 Thread Mikhail Terekhov

New submission from Mikhail Terekhov:

On 64-bit Linux freeze.py uses lib instead of lib64 when constructing
path to Makefile etc. Using sysconfig fixes this issue.


Without encodings.ascii resulting program fails with the following error:

Fatal Python error: Py_Initialize: Unable to get the locale encoding
LookupError: unknown encoding: ANSI_X3.4-1968
Aborted

Attached patch fixes both issues.

--
components: Demos and Tools
files: freeze-lib64.diff
keywords: patch
messages: 248633
nosy: termim
priority: normal
severity: normal
status: open
title: freeze.py doesn't work on x86_64 Linux out of the box
versions: Python 3.2, Python 3.3, Python 3.4, Python 3.5
Added file: http://bugs.python.org/file40182/freeze-lib64.diff

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



[issue13224] Change str(x) to return only the qualname for some types

2015-08-14 Thread Robert Collins

Robert Collins added the comment:

Ok, so needs more work. Moving back to patch review.

--
stage: commit review - patch review

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



[issue24870] surrogateescape is too slow

2015-08-14 Thread INADA Naoki

INADA Naoki added the comment:

On MacBook Pro (Core i5 2.6GHz), surrogateescape 1MB data takes 250ms.

In [1]: bs = bytes(range(256)) * (4 * 1024)

In [2]: len(bs)
Out[2]: 1048576

In [3]: %timeit x = bs.decode('ascii', 'surrogateescape')
1 loops, best of 3: 249 ms per loop

--

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



[issue24866] Boolean representation of Q/queue objects does not fit behaviour of lists etc.

2015-08-14 Thread Raymond Hettinger

Raymond Hettinger added the comment:

RDM is correct.  Queues having qsize() instead of __len__() was an intentional 
part of the design.  Code relying on the boolean value would be fragile.   

FWIW, this code is very old (originally designed by Guido when dinosaurs roamed 
the earth) and it is far too late to alter its API.

--
resolution:  - rejected
status: open - closed

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



[issue24868] Python start

2015-08-14 Thread jack

New submission from jack:

I just installed Python 3.4.3 on a 32-bit machine, 2 GB memory, Win XP SP3. 
When I try to start IDLE, pythonw.exe appears briefly in the Windows Task 
Manager, then disappears, and nothing else happens. If I run just python.exe in 
a command window, that runs OK. The same behavior happens after installing 
version 2.7.10. This happens for both of these versions, regardless of whether 
the other one is installed or not. The same also happened for version 3.1.2.

On the other hand, version 2.5 runs just fine. I tried all this also in Windows 
Safe Mode, where there were only about half a dozen core Windows processes in 
the task manager, with the same result.

--
components: IDLE
messages: 248593
nosy: jack
priority: normal
severity: normal
status: open
title: Python start
type: crash
versions: Python 2.7, Python 3.4

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



[issue24864] errors writing to stdout are uncatchable and exit with status 0

2015-08-14 Thread Robert Collins

Robert Collins added the comment:

Oh, one nuance - the reason my except isn't triggering is that the write is 
happening in interpreter shutdown - in flush_std_files.

Adding a a flush there allows that to work, but its fugly:

---
import sys

try:
print(What... is your quest?)
# Workaround bug 24864: force the write to be immediate
sys.stdout.flush()
except:
sys.stderr.write(Exception in program.\n)
e = sys.exc_info()[1]
try:
# Workaround bug 24864 close the file so flush_std_files doesn't run
# during interpreter cleanup.
sys.stdout.close()
finally:
raise e from None

---

--

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



[issue11380] Improve reporting of broken stdout pipe during interpreter shutdown

2015-08-14 Thread Robert Collins

Robert Collins added the comment:

@zzeeek

For Python 3 pipeline tools you need something like this:

try:
   all your stuff
finally:
   try:
   sys.stdout.flush()
   finally:
   try:
   sys.stdout.close()
   finally:  
   try:
   sys.stderr.flush()
   finally:
   sys.stderr.close()

This will:
 - capture any exceptions *you've* raised as the context for the errors raised 
in this handler
 - expose any exceptions generated during this thing itself
 - prevent the interpreter dying during shutdown in flush_std_files by closing 
the files (you can't easily wipe out the pending writes that have failed)

You could alternatively reopen stdout and stderr on the same fds, giving you 
new buffers with no pending writes. Anyhow - the key thing is:

- ensure that at shutdown, there are no pending writes for the interpreter 
lifecycle to flush, and you won't hit this bug.

--

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



[issue24862] subprocess.Popen behaves incorrect when moved in process tree

2015-08-14 Thread R. David Murray

R. David Murray added the comment:

I'll let someone else analyze this in detail if they want to, but I'll just 
note that mixing multiprocessing and threads is not a good idea and will lead 
to all sorts of strangeness.  Especially if you are using the unix default of 
fork for multiprocessing.

--
nosy: +r.david.murray

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



[issue24866] Boolean representation of Q/queue objects does not fit behaviour of lists etc.

2015-08-14 Thread R. David Murray

R. David Murray added the comment:

I believe this is intentional; see the documentation of the empty' method for 
the motivation.  The reason for not just reflecting the result of an empty call 
in __bool__ is that not doing so forces you to use empty, which gives you an 
opportunity to learn about the lack of guarantees.  And every time you use it, 
or read it in someone else's code, you are reminded that a Queue is *different* 
from a list in this very important way.

--
nosy: +r.david.murray

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



[issue24863] Incoherent bevavior with umlaut in regular expressions

2015-08-14 Thread R. David Murray

R. David Murray added the comment:

Don't be embarrassed; a report like this turns up on this tracker about every 
three or four months.  Unfortunately there's nothing we can do to make the 
situation better because of backward compatibility concerns.

--
nosy: +r.david.murray

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



[issue24864] errors writing to stdout are uncatchable and exit with status 0

2015-08-14 Thread Robert Collins

Robert Collins added the comment:

FWIW Python 2.7.8 behaves the same way (different message, same behaviour).

--

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



[issue24838] tarfile.py: fix GNU and USTAR formats to properly handle paths with special characters that are encoded with more than one byte each

2015-08-14 Thread Lars Gustäbel

Lars Gustäbel added the comment:

Thanks for the detailed report and the patch. I haven't checked yet, but I 
suppose that the entire 3.x branch is affected. The first thing I have to do 
now is to come up with a comprehensive testcase.

--
assignee:  - lars.gustaebel
components: +Library (Lib)
nosy: +lars.gustaebel
stage:  - test needed
versions: +Python 3.2, Python 3.3, Python 3.4, Python 3.6

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



[issue24866] Boolean representation of Q/queue objects does not fit behaviour of lists etc.

2015-08-14 Thread Frunit

New submission from Frunit:

Usually, list-like objects return False when they are empty and True when at 
least one element is in the list. However, Queue (Python 2) resp. queue (Python 
3) objects always return True. I am aware of that objects should always return 
True unless otherwise stated, but as queues are (at least in my perception) 
related to lists, they should behave similarly in this case.

Python3 (similar in Python2):
 import queue
 q = queue.Queue()
 bool(q)
True
(Should be False, in my opinion; the same for PriorityQueue and LifoQueue)

I searched for reasons for returning True in empty Queues, but I could not find 
any in the net or in the Python docs.

--
messages: 248577
nosy: Frunit
priority: normal
severity: normal
status: open
title: Boolean representation of Q/queue objects does not fit behaviour of 
lists etc.
type: behavior
versions: Python 2.7, Python 3.4

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



[issue11380] Improve reporting of broken stdout pipe during interpreter shutdown

2015-08-14 Thread Robert Collins

Robert Collins added the comment:

See also issue24864 which is not *quite* a dupe, I also found that it exits 0, 
unreasonably so.

The reporting thing is interesting, but the main thing I care about is that we 
can catch it and do something reasonable with it... and that if not caught it 
signals an error :)

--
nosy: +rbcollins

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