[issue22236] Do not use _default_root in Tkinter tests

2014-08-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 32fdaf401e50 by Serhiy Storchaka in branch '2.7':
Issue #22236: Tkinter tests now don't reuse default root window.  New root
http://hg.python.org/cpython/rev/32fdaf401e50

New changeset dd1dffe6f0d2 by Serhiy Storchaka in branch '3.4':
Issue #22236: Tkinter tests now don't reuse default root window.  New root
http://hg.python.org/cpython/rev/dd1dffe6f0d2

New changeset 014060738f7f by Serhiy Storchaka in branch 'default':
Issue #22236: Tkinter tests now don't reuse default root window.  New root
http://hg.python.org/cpython/rev/014060738f7f

--
nosy: +python-dev

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



[issue22263] Add a resource for CLI tests

2014-08-24 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Some modules have command-line interface (not always documented and tested). 
Their tests run a lot of subprocesses and requires long time, often longer than 
other tests of corresponding module. However command-line interface itself is 
much less important than Python interface. In the face of addition of more CLI 
tests it would be good to introduce new resource (commandline or cli) which 
will control the run of such tests.

--
components: Tests
messages: 225796
nosy: ezio.melotti, michael.foord, pitrou, serhiy.storchaka, zach.ware
priority: normal
severity: normal
status: open
title: Add a resource for CLI tests
type: enhancement
versions: Python 2.7, Python 3.4, Python 3.5

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



[issue22236] Do not use _default_root in Tkinter tests

2014-08-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thanks Terry and Zachary for your reviews. I have committed the patch in haste 
because other issues depend on it.

--
assignee:  - serhiy.storchaka
resolution:  - fixed
stage: patch review - resolved
status: open - closed

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



[issue22260] Rearrange tkinter tests, use test discovery

2014-08-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Currently Tkinter tests are splitted on four tests: test_tcl, test_tk, 
test_ttk_textonly, test_ttk_guionly. Ttk tests are separated because ttk is 
optional on Tk 8.4 and because ttk is separate large part of Tkinter. test_tcl 
and test_ttk_textonly are separated because they don't require GUI. On headless 
computer test_tk and test_ttk_guionly are reported as skipped at all, but 
test_tcl and test_ttk_textonly should run. It would be good to preserve this 
splitting and even improve it (test_variables does not require GUI and can be 
moved to test_tcl package).

Tkinter tests are still incomplete and needs many test. To avoid obstacles for 
backporting new tests it is worth to apply these changes to all maintained 
branches.

--
versions: +Python 2.7, Python 3.4

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



[issue22258] Use FD_CLOEXEC in Python/fileutils.c

2014-08-24 Thread Igor Pashev

Igor Pashev added the comment:

errno is 25 (#define ENOTTY  25  /* Inappropriate ioctl for device   */)

It does not make sense to me to call unworkable ioctl() each time before other 
methods :-)

I would consider adding a configure check for working ioctl() (but it won't 
work for cross compilation).

--

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



[issue18814] Add tools for cleaning surrogate escaped strings

2014-08-24 Thread Ezio Melotti

Ezio Melotti added the comment:

I think similar functions should be added in the unicodedata module rather than 
the string module or as str methods.  If I'm not mistaken this was already 
proposed in another issue.
In C we already added macros like IS_{HIGH|LOW|}_SURROGATE and possibly others 
to help dealing with surrogates but AFAIK there's no Python equivalent yet.
As for the specific constants/functions/methods you propose, IMHO the name 
escaped_surrogates is not too clear.  If it's a string of lone surrogates I 
would just call it unicodedata.surrogates (and 
.high_surrogates/.low_surrogates).  These can also be used to build oneliner to 
check if a string contains surrogates and/or to remove them.
clean has a very generic name with no hints about surrogates, and its purpose 
is quite specific.
I'm also not a big fan of redecode.  The equivalent calls to encode/decode are 
not much longer and more explicit.  Also having to redecode often indicates 
that there's a bug before that should be fixed instead (if possible).

--

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



[issue18814] Add tools for cleaning surrogate escaped strings

2014-08-24 Thread Nick Coghlan

Nick Coghlan added the comment:

The purpose of these changes it to provide tools specifically for working with 
surrogate escaped data, not for working with arbitrary lone Unicode surrogates.

escaped_surrogates is not defined by the Unicode spec, it's defined by the 
behaviour of the surrogateescape error handler that lets us tunnel arbitrary 
bytes through str objects and reproduce them faithfully at the far end. On 
reflection, I think codecs would be a better home than string (as that's where 
the error handler is defined), but it doesn't belong in unicodedata.

I'd be OK with changing the name of the clean function to 
clean_escaped_surrogates.

Needing redecode is not a bug: it's baked into the WSGI spec in PEP . I 
would be OK with providing it in wsgiref rather than the codecs or string 
modules, but I think we should provide it somewhere.

--

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



[issue22261] Document how to use Concurrent Build when using MsBuild

2014-08-24 Thread sbspider

sbspider added the comment:

Ok, thank you. Just wanted to confirm this, as I plan to help out on the 
code/documentation as well (and hence want to understand the process 
beforehand). I look forward to working on Python in the future.

--

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



[issue17180] shutil copy* unsafe on POSIX - they preserve setuid/setgit bits

2014-08-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

See also issue15795. It would be good to make shutil, zipfile and tarfile 
interfaces consistent.

I think we need more graduated interface matching coretools.


  --preserve[=ATTR_LIST]
  preserve the specified attributes (default: 
mode,ownership,timestamps), if possible additional attributes: context, links, 
xattr, all

   --no-preserve=ATTR_LIST
  don't preserve the specified attributes


This means that we should add preserve_mode, preserve_ownership, preserve_time, 
etc parameters. preserve_ownership should control also copying of 
suid/sgid/sticky bits. copy()'s defaults will be preserve_mode=True, 
preserve_ownership=False, preserve_time=False, copy2()'s defaults 
(corresponding to cp -p behavior) will be preserve_mode=True, 
preserve_ownership=True, preserve_time=True.

--
nosy: +serhiy.storchaka
versions: +Python 3.5

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



[issue20912] [zipfile.py]: Make zip directory attributes more friendly for MS-Windows

2014-08-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Could shutil experts please comment this patch?

--
nosy: +christian.heimes, hynek, tarek

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



[issue22257] PEP 432: Redesign the interpreter startup sequence

2014-08-24 Thread sbspider

Changes by sbspider rajsho...@gmail.com:


--
nosy: +sbspider

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



[issue22194] access to cdecimal / libmpdec API

2014-08-24 Thread Stefan Krah

Stefan Krah added the comment:

Antoine Pitrou rep...@bugs.python.org wrote:
 Who are those people? #16745 was opened by you :-)

MvL, in #4555 (msg176486).

  Platform specific maybe, but no hack:  I was thinking about storing the DSO
  handle in the PyModuleObject struct and add functions to lookup symbols.
  I'm attaching a diff for Linux -- It has been a while, but I'm rather 
  certain
  that the corresponding scheme also worked on Windows (can't test now, my
  Windows VM is defunct).
 
 How does it work? I've tried to dlopen() and then dlsym() the _decimal 
 file manually, it wouldn't work for private (e.g. mpd) symbols.

Yes, the symbols would need to be public, see module_get_symbol.diff.

 
  That would leave the usual troublemakers AIX etc., which have sketchy 
  support
  anyway.
 
 That sounds rather worrying. How about OS X? Why would that whole scheme 
 be better than a capsule?

I'm not sure about OS X, but I would be surprised if it did not work.

To my limited knowledge, Capsules are slow, see also here (the penultimate
paragraph):

https://mail.python.org/pipermail/python-dev/2013-March/124481.html

Stefan (Behnel), could you comment on the strategy that you had in mind?
Is it similar to module_get_symbol.diff or entirely different?

--

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



[issue18814] Add tools for cleaning surrogate escaped strings

2014-08-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I agree with Ezio in all points. escaped_surrogates is inefficient for any 
purposes and incomplete. _match_surrogates can be created in more efficient 
way. clean() has too general and misleading name. redecode() looks just 
ridiculous, this cumbersome 4-argument function just combine two methods.

--

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



[issue22034] posixpath.join() and bytearray

2014-08-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d9607a71456e by Serhiy Storchaka in branch '3.4':
Issue #22034: Got rid of misleading error message for bytearray arguments in
http://hg.python.org/cpython/rev/d9607a71456e

New changeset db600c927b2b by Serhiy Storchaka in branch 'default':
Issue #22034: Improve handling of wrong argument types in posixpath.join().
http://hg.python.org/cpython/rev/db600c927b2b

--
nosy: +python-dev

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



[issue22034] posixpath.join() and bytearray

2014-08-24 Thread Serhiy Storchaka

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


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

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



[issue22207] Test for integer overflow on Py_ssize_t: explicitly cast to size_t

2014-08-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I think there are too many changes. Here is simpler patch which get rid of all 
warnings in Objects/unicodeobject.c on my computer (gcc 4.6.3, 32-bit Linux).

--
Added file: http://bugs.python.org/file36451/unicode_2.patch

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



[issue18814] Add tools for cleaning surrogate escaped strings

2014-08-24 Thread Nick Coghlan

Nick Coghlan added the comment:

Guys, you're Python 3 unicode experts, already thoroughly familiar with how 
surrogateescape works. These features are not for you.

The exact implementations don't matter. These need to exist, and they need to 
be documented with detailed explanations. People don't yet understand what the 
surrogateescape error handler is, and what it's for, or how to work with it.

People consider surrogate escaping this weird mysterious thing. It's not - it's 
a really simple mapping of the 128 bytes with the high order bit set to a 
different part of the Unicode code space. These functions make it obvious.

wsgiref.redecode is a natural consequence of the design of PEP  - it makes 
sense to offer it there, as a hint that frameworks are likely to need it.

We have a serious, serious, learnability problem around binary data handling in 
Python 3. It's nowhere near as bad as the learnability problem for text 
handling in Python 2, but it still needs more scaffolding to help people grow 
in understanding.

--

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



[issue22133] IDLE: Set correct WM_CLASS on X11

2014-08-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 Grepping idlelib for 'toplevel, there are about 10. Do all of the Toplevels 
 get put on the activity bar?  I would not expect that popups like calltip 
 would.

I don't know how dialogs and calltip popups behave on Gnome Shell. But I think 
we should do this at least for more or less long-lived windows such as stack 
viewer. On KDE when I added ``kw[class] = 'Idle3'`` to ListedToplevel 
constructor, console and editor windows are grouped on taskbar, and stack 
viewer is separated (without this line all three windows are in the same group).

 I expect that all ListedToplevels could be handled at once by adding the 
 following as the first line of ListedToplevel.__init__.

May be, but this is not so simple. To be robust we should handle both 'class' 
and 'class_' keywords (and may be even '-class').

 What is wrong with simply adding classname to the Tk() call, as Roger 
 suggested in #13553.

This affects only WM_CLASS of root window (which is withdrawn right after 
creation in IDLE).

 Does KDE display 2 windows without name='Idle' in the toplevel call?  Is this 
 a KDE or tk bug?

``tk = Tk(className='Idle3')`` creates first (root) window and ``top = 
Toplevel(tk, class_='Idle3')`` creates second window. The className argument 
affects root window (and some other things) and the class argument affects 
Toplevel window.

Another example:

 from tkinter import *
 tk = Tk(className='Firefox')
 top = Toplevel(tk, class_='Chromium-browser')

Created two windows: one with title firefox and Firefox icon, and other with 
title firefox and Chromium icon.

I argue that we should add className=Idle3 to every Tk constructor and 
class_=Idle3 to most (iv not every) Toplevel constructor. On Python 2 it 
should be Idle2 or Idle (not sure).

--

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



[issue18814] Add tools for cleaning surrogate escaped strings

2014-08-24 Thread Ezio Melotti

Ezio Melotti added the comment:

That's why I think a function like redecode is a bad idea.
With Python 2 I've seen lot of people blindingly trying .decode when .encode 
failed (and the other way around) whenever they were getting an UnicodeError 
(and the fact that decoding Unicode results in an encode error didn't help).
I'm afraid that confused developers will try to (mis)use redecode as a 
workaround to attempt to fix something that shouldn't be broken in the first 
place, without actually understanding what the real problem is.
There's really no excuse for developers not to know Unicode nowadays (Joel 
Spolsky said the same thing more than 10 years ago).
IME people also tend to overestimate how difficult it is to understand Unicode. 
 While it is true that you can go pretty deep down the rabbit hole, the basic 
concepts necessary for everyday use are pretty simple and straightforward.

--

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



[issue17896] Move Windows external libs from src\..\ to src\externals

2014-08-24 Thread Mark Lawrence

Mark Lawrence added the comment:

I see that this has also been raised on #22262.  As nobody has objected can't 
we just get on with it?

--

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



[issue22258] Use FD_CLOEXEC in Python/fileutils.c

2014-08-24 Thread STINNER Victor

STINNER Victor added the comment:

I propose to only call ioctl() once, and then remember (in a static
variable) that it doesn't work and then always call fcntl().

I can work on a patch.

--

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



[issue22264] Add wsgiref.fix_encoding

2014-08-24 Thread Nick Coghlan

New submission from Nick Coghlan:

The WSGI 1.1 standard mandates that binary data be decoded as latin-1 text: 
http://www.python.org/dev/peps/pep-/#unicode-issues

This means that many WSGI headers will in fact contain *improperly encoded 
data*. Developers working directly with WSGI (rather than using a WSGI 
framework like Django, Flask or Pyramid) need to convert those strings back to 
bytes and decode them properly before passing them on to user applications.

I suggest adding a simple fix_encoding function to wsgiref that covers this:

def fix_encoding(data, encoding, errors=surrogateescape):
return data.encode(latin-1).decode(encoding, errors)

The primary intended benefit is to WSGI related code more self-documenting. 
Compare the proposal with the status quo:

data = wsgiref.fix_encoding(data, utf-8)
data = data.encode(latin-1).decode(utf-8, surrogateescape)

The proposal hides the mechanical details of what is going on in order to 
emphasise *why* the change is needed, and provides you with a name to go look 
up if you want to learn more.

The latter just looks nonsensical unless you're already familiar with this 
particular corner of the WSGI specification.

--
messages: 225814
nosy: ncoghlan
priority: normal
severity: normal
status: open
title: Add wsgiref.fix_encoding
type: enhancement
versions: Python 3.5

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



[issue22264] Add wsgiref.util.fix_encoding

2014-08-24 Thread Nick Coghlan

Nick Coghlan added the comment:

This would be a better fit for the util submodule rather than the top level 
package.

--
title: Add wsgiref.fix_encoding - Add wsgiref.util.fix_encoding

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



[issue22264] Add wsgiref.util.fix_decoding

2014-08-24 Thread Nick Coghlan

Nick Coghlan added the comment:

Last tweak, since the purpose is to fix the original incorrect decoding to 
latin-1, this should be defined as a decoding operation:

def fix_decoding(data, encoding, errors=surrogateescape):
return data.encode(latin-1).decode(encoding, errors)

--
title: Add wsgiref.util.fix_encoding - Add wsgiref.util.fix_decoding

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



[issue18814] Add tools for cleaning surrogate escaped strings

2014-08-24 Thread Nick Coghlan

Nick Coghlan added the comment:

The redecode thing is a distraction from my core concern here, so I've split 
that out to issue #22264, a separate RFE for a wsgiref.fix_encoding function.

For this issue, my main concern is the function to *clean* a string of escaped 
binary data, so it can be displayed easily, or otherwise purged of the escaped 
characters. Preserving the data by default is good, but you have to know a 
*lot* about how Python 3 works in order to be able figure out how to clean it 
out.

For that, not knowing Unicode in general isn't the problem: it's not knowing 
PEP 383. If we forget the idea of exposing the constant with the escaped values 
(I agree that's not very useful), it suggests codecs.clean_surrogate_escapes 
as a possible name:


# Helper to ensure a string contains no escaped surrogates
# This allows it to be safely encoded without surrogateescape
_extended_ascii = bytes(range(128, 256))
_escaped_surrogates = _extended_ascii.decode('ascii',
errors='surrogateescape')
_match_escaped = re.compile('[{}]'.format(_escaped_surrogates))
def clean_surrogate_escapes(s, repl='\ufffd'):
return _match_escaped.sub(repl, s)

A more efficient implementation in C would also be fine, this is just an easy 
way to define the exact semantics.

(I also just noticed that unlike other error handlers, surrogateespace and 
surrogatepass do not have corresponding codecs.surrogateescape_errors and 
codecs.surrogatepass_errors functions)

--

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



[issue18814] Add tools for cleaning surrogate escaped strings

2014-08-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What problem is purposed to solve clean_surrogate_escapes()? Could you please 
provide user scenario or two?

Possible alternative implementation is:

def clean_surrogate_escapes(s):
return s.encode('utf-8', 'surrogatepass').decode('utf-8', 'replace')

It can be faster for some data (for mostly ASCII with rare surrogates it is 
superfast). For other data 'utf-16' can be better choice.

--

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



[issue22264] Add wsgiref.util.fix_decoding

2014-08-24 Thread Serhiy Storchaka

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


--
components: +Library (Lib), Unicode
nosy: +benjamin.peterson, ezio.melotti, haypo, lemburg, pitrou, serhiy.storchaka

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



[issue22264] Add wsgiref.util.fix_decoding

2014-08-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Could you please provide an example how this helper will improve stdlib or user 
code?

--

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



[issue22264] Add wsgiref.util.fix_decoding

2014-08-24 Thread Serhiy Storchaka

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


--
nosy: +pje

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



[issue22259] fdopen of directory causes segmentation fault

2014-08-24 Thread Brian Kearns

Brian Kearns added the comment:

Updated to use assertEqual

--
Added file: http://bugs.python.org/file36452/fdopen-directory.patch

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



[issue22259] fdopen of directory causes segmentation fault

2014-08-24 Thread Brian Kearns

Changes by Brian Kearns bdkea...@gmail.com:


Removed file: http://bugs.python.org/file36450/fdopen-directory.patch

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



[issue22194] access to cdecimal / libmpdec API

2014-08-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Le 24/08/2014 04:56, Stefan Krah a écrit :

 I'm not sure about OS X, but I would be surprised if it did not work.

 To my limited knowledge, Capsules are slow, see also here (the penultimate
 paragraph):

They are slow if you have to lookup and unwrap a capsule every time you 
use it. But the way it would work for _decimal (and the way it already 
works for _datetime), AFAIK, would be different: you would look up the 
capsule API structure once and then simply dereference function 
pointers from that structure.

You can actually take a look at Include/datetime.h and see if the 
approach would work. See especially:

/* Define global variable for the C API and a macro for setting it. */
static PyDateTime_CAPI *PyDateTimeAPI = NULL;

#define PyDateTime_IMPORT \
 PyDateTimeAPI = (PyDateTime_CAPI 
*)PyCapsule_Import(PyDateTime_CAPSULE_NAME, 0)

which encourages a once-in-a-process-lifetime API lookup pattern.
I don't think a hand-coded dlsym()-based approach can be any 
significantly faster.

--

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



[issue18814] Add tools for cleaning surrogate escaped strings

2014-08-24 Thread Nick Coghlan

Nick Coghlan added the comment:

My main use case is for passing data to other applications that *don't* have 
their Unicode handling in order - I want to be able to use Python to do the 
data scrubbing, but at the moment it requires intimate knowledge of the codec 
error handling system to do it. (I had never even heard of surrogatepass until 
this evening)

Situation:

What I have: data decoded with surrogateescape
What I want: that same data with all the surrogates gone, replaced with either 
the Unicode replacement character or an ASCII question mark (which I want will 
depend on the exact situation)

Assume I am largely clueless about the codec system. I know nothing beyond the 
fact that Python 3 strings may have smuggled bytes in them and I want to get 
rid of them because they confuse the application I'm passing them to.

The concrete example that got me thinking about this again was the task of 
writing filenames into a UTF-8 encoded email, and wanting to scrub the output 
from os.listdir before writing the list into the email (s/email/web page/ also 
works).

For issue #22016 I actually suggested doing this as *another* codec error 
handler (surrogatereplace), but Stephen Turnbull convinced me this original 
idea was better: it should just be a pure data transformation pass on the 
string, clearing the surrogates out, and leaving me with data that is identical 
to that I would have had if surrogatereplace had been used instead of 
surrogateescape in the first place.

As errors='replace' already covers the ASCII ? replacement case, that means 
your proposed redecode based solution would cover the rest of my use case.

--

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



[issue16808] inspect.stack() should return list of named tuples

2014-08-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

It seems like this patch had been overlooked. I refreshed it for 3.5, added a 
couple tests, and pushed it. Thank you, Daniel!

--
assignee: meador.inge - 
nosy: +pitrou
resolution:  - fixed
stage: commit review - resolved
status: open - closed

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



[issue16808] inspect.stack() should return list of named tuples

2014-08-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d03730abd2f6 by Antoine Pitrou in branch 'default':
Issue #16808: inspect.stack() now returns a named tuple instead of a tuple.
http://hg.python.org/cpython/rev/d03730abd2f6

--
nosy: +python-dev

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



[issue22194] access to cdecimal / libmpdec API

2014-08-24 Thread Stefan Krah

Stefan Krah added the comment:

Ah yes, the array of function pointers is directly accessible. I did not look
close enough -- reading the word spam 100x in the docs always makes me skim
the text. ;)

--

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



[issue22194] access to cdecimal / libmpdec API

2014-08-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 MvL, in #4555 (msg176486).

Ok, I'm cc'ing Martin then :-)
Note RTLD_LOCAL seems to be the default with dlopen(). Now I don't know how 
that behaves when you have a chained library loading, e.g.:

  Apache -- dlopen(Python dll) -- dlopen(_decimal dll)

_decimal is an interesting case, since AFAIK with other C extensions it isn't 
really interesting to access the underlying C library, but with _decimal not 
being able to access libmpdec would force _decimal to duplicate a large part of 
the libmpdec API with a PyDec prefix added in front of it.

(which means that, perhaps, the answer is to make the mpd_ prefix configurable 
with a #define?)

--
nosy: +loewis

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



[issue22194] access to cdecimal / libmpdec API

2014-08-24 Thread Stefan Krah

Stefan Krah added the comment:

Antoine Pitrou rep...@bugs.python.org wrote:
 (which means that, perhaps, the answer is to make the mpd_ prefix 
 configurable with a #define?)

I don't know 100% what you have in mind, but Debian and Arch already ship
--with-system-libmpdec, so only the mpd_* functions would be available.

--

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



[issue22194] access to cdecimal / libmpdec API

2014-08-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Le 24/08/2014 11:11, Stefan Krah a écrit :

 Antoine Pitrou rep...@bugs.python.org wrote:
 (which means that, perhaps, the answer is to make the mpd_ prefix 
 configurable with a #define?)

 I don't know 100% what you have in mind, but Debian and Arch already ship
 --with-system-libmpdec, so only the mpd_* functions would be available.

Ah... that probably kills the idea then. I was thinking in the context 
of a private-built libmpdec and had forgotten about that possibility.

--

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



[issue22264] Add wsgiref.util.fix_decoding

2014-08-24 Thread Nick Coghlan

Nick Coghlan added the comment:

Current cryptic incantation that requires deep knowledge of the encoding system 
to follow:

data = data.encode(latin-1).decode(utf-8, surrogateescape)

Replacement that is not only more self-documenting, but also gives you 
something specific to look up in order to learn more:

data = wsgiref.util.fix_encoding(data, utf-8)

As a WSGI server, the standard library code mostly does this in the other 
direction, converting data from its original web server provided encoding *to* 
latin-1.

--

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



[issue22259] fdopen of directory causes segmentation fault

2014-08-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6e67a0394957 by Benjamin Peterson in branch '2.7':
don't segfault when trying to fdopen() a fd for a dir (closes #22259)
http://hg.python.org/cpython/rev/6e67a0394957

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

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



[issue22240] argparse support for python -m module in help

2014-08-24 Thread Miki Tebeka

Miki Tebeka added the comment:

New patch with handling of zip files.

--
Added file: http://bugs.python.org/file36453/prog2.diff

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



[issue22234] urllib.parse.urlparse accepts any falsy value as an url

2014-08-24 Thread Antti Haapala

Antti Haapala added the comment:

On Python 2.7 urlparse.urlparse, parsing None, () or 0 will throw 
AttributeError because these classes do not have any 'find' method. [] has the 
find method, but will fail with TypeError, because the built-in caching 
requires that the input be hashable.

--

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



[issue9205] Parent process hanging in multiprocessing if children terminate unexpectedly

2014-08-24 Thread Dan O'Reilly

Dan O'Reilly added the comment:

 So, concurrent.futures is fixed now. Unless someone wants to patch 
 multiprocessing.Pool, I am closing this issue.

I realize I'm 3 years late on this, but I've put together a patch for 
multiprocessing.Pool. Should a process in a Pool unexpectedly exit (meaning, 
*not* because of hitting the maxtasksperchild limit), the Pool will be 
closed/terminated and all cached/running tasks will return a BrokenProcessPool. 
These changes also prevent the Pool from going into a bad state if the 
initializer function raises an exception (previously, the pool would end up 
infinitely starting new processes, which would immediately die because of the 
exception).

One concern with the patch: The way timings are altered with these changes, the 
Pool seems to be particularly susceptible to issue6721 in certain cases. If 
processes in the Pool are being restarted due to maxtasksperchild just as the 
worker is being closed or joined, there is a chance the worker will be forked 
while some of the debug logging inside of Pool is running (and holding locks on 
either sys.stdout or sys.stderr). When this happens, the worker deadlocks on 
startup, which will hang the whole program. I believe the current 
implementation is susceptible to this as well, but I could reproduce it much 
more consistently with this patch. I think its rare enough in practice that it 
shouldn't prevent the patch from being accepted, but thought I should point it 
out. 

(I do think issue6721 should be addressed, or at the very least internal  I/O 
locks should always reset after forking.)

--
nosy: +dan.oreilly
Added file: http://bugs.python.org/file36454/multiproc_broken_pool.diff

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



[issue22240] argparse support for python -m module in help

2014-08-24 Thread paul j3

paul j3 added the comment:

The patch tests assume the test is being run in a particular way:

python -m unittest ...

But I often use

python3 -m unittest ...

or

python3 test_argparse.py

both of which fail these tests.

Testing this change might be more difficult than implementing it.

--

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



[issue22265] fix reliance on refcounting in test_itertools

2014-08-24 Thread Brian Kearns

New submission from Brian Kearns:

The test fails on Python implementations with non-refcounted GCs without this 
line.

--
files: test_itertools.patch
keywords: patch
messages: 225835
nosy: bdkearns
priority: normal
severity: normal
status: open
title: fix reliance on refcounting in test_itertools
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file36455/test_itertools.patch

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



[issue22266] fix reliance on refcounting in tarfile.gzopen

2014-08-24 Thread Brian Kearns

New submission from Brian Kearns:

tarfile.gzopen relies on refcounting to close the fileobj when the fileobj is 
created during the call to gzopen (when it is not passed in). Since the fileobj 
is created outside of GzipFile, GzipFile does not take responsibility for 
closing the fileobj (so no one does, aside from the GC, which leads to 
unexpected behavior when using a non-refcounted GC).

This is fixed by having GzipFile open the fileobj itself, so it does take 
responsibility for closing it when necessary. The same approach is taken in 
tarfile.py in py3k branch.

--
files: tarfile.patch
keywords: patch
messages: 225836
nosy: bdkearns
priority: normal
severity: normal
status: open
title: fix reliance on refcounting in tarfile.gzopen
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file36456/tarfile.patch

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



[issue22265] fix reliance on refcounting in test_itertools

2014-08-24 Thread Brian Kearns

Brian Kearns added the comment:

Should go on py3k branches too...

--

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



[issue22265] fix reliance on refcounting in test_itertools

2014-08-24 Thread Alex Gaynor

Changes by Alex Gaynor alex.gay...@gmail.com:


--
nosy: +alex

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



[issue22266] fix reliance on refcounting in tarfile.gzopen

2014-08-24 Thread Alex Gaynor

Changes by Alex Gaynor alex.gay...@gmail.com:


--
nosy: +alex

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



[issue22265] fix reliance on refcounting in test_itertools

2014-08-24 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
nosy: +rhettinger

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



[issue22240] argparse support for python -m module in help

2014-08-24 Thread paul j3

paul j3 added the comment:

What if the package is run without `-m`?

--

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



[issue22267] fix reliance on refcounting in test_weakref

2014-08-24 Thread Brian Kearns

New submission from Brian Kearns:

The test fails on Python implementations with non-refcounted GCs without these 
lines. Should go on py3k branches also.

--
files: test_weakref.patch
keywords: patch
messages: 225839
nosy: bdkearns
priority: normal
severity: normal
status: open
title: fix reliance on refcounting in test_weakref
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file36457/test_weakref.patch

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



[issue22267] fix reliance on refcounting in test_weakref

2014-08-24 Thread Alex Gaynor

Alex Gaynor added the comment:

Perhaps these should use the gc_collect function in test_support?

--
nosy: +alex

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



[issue22267] fix reliance on refcounting in test_weakref

2014-08-24 Thread Brian Kearns

Brian Kearns added the comment:

Possibly. But if so then one would argue there are plenty of other instances 
where gc_collect should be used, both within test_weakref and the rest of the 
test suite. Chose gc.collect here as it was used all over test_weakref.py, 
gc_collect never being used, and it fixed the test on PyPy.

--

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



[issue22268] mrohasattr and mrogetattr

2014-08-24 Thread Gregory Salvan

New submission from Gregory Salvan:

It's a small refactoring.

Lurking at collections.abc I found a lot of: 
 any(attr in B.__dict__ for B in C.__mro__)

also repeated in typing.py of mypy:
https://github.com/JukkaL/mypy/blob/master/lib-typing/3.2/typing.py#L117

It seems to be a common operation to check or get an attribute from mro in abc, 
so I thought it could help to have dedicated functions to enhance readability.
(see patch e.g. Hash.__subclasshook__ takes 1 line intead of 7...)

--
components: Library (Lib)
files: mroattr.patch
keywords: patch
messages: 225842
nosy: Gregory.Salvan
priority: normal
severity: normal
status: open
title: mrohasattr and mrogetattr
type: enhancement
versions: Python 3.5
Added file: http://bugs.python.org/file36458/mroattr.patch

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



[issue22269] Resolve distutils option conflicts with priorities

2014-08-24 Thread Min RK

New submission from Min RK:

Background:

Some Python distros (OS X, Debian, Homebrew, others) want the default 
installation prefix for packages to differ from sys.prefix. OS X and Debian 
accomplish this by patching distutils itself, with special cases like `if 
sys.prefix == '/System/Library/...': actually_do_something_else()`. Homebrew 
accomplishes this by writing a `distutils.cfg` with:

[install]
prefix = /usr/local

The distutils.cfg approach is certainly simpler than shipping a patch, but has 
its own problems, because distutils doesn't differentiate the *source* of 
configuration options when resolving conflicts. That means that you can't do 
`python setup.py install --user` because it fails with the error can't combine 
user with prefix, ... without also specifying `--prefix=''` to eliminate the 
conflict.

Proposal:

I've included a patch for discussion, which uses the fact that the option_dict 
tracks the source of each option, and keeps track of the load order of each. In 
the case of an option conflict, the option that came from the lower priority 
source is unset back to None. If they come from the same source, then the same 
conflict error message is displayed as before.

Even if this patch is rejected as madness, as I expect it might be, official  
recommendations on how to address the root question of `sys.prefix != 
install_prefix` would be appreciated.

--
components: Distutils
files: distutils_conflict.patch
keywords: patch
messages: 225843
nosy: dstufft, eric.araujo, minrk
priority: normal
severity: normal
status: open
title: Resolve distutils option conflicts with priorities
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5
Added file: http://bugs.python.org/file36459/distutils_conflict.patch

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



[issue21480] A build now requires...

2014-08-24 Thread paul j3

paul j3 added the comment:

I ran into a (possibly) related compiling problem (for 'default', 3.5 branch) 
in `asdl.py`:

class Module(AST):
def __init__(self, name, dfns):
...
self.types = {type.name: type.value for type in dfns}

The dictionary comprehension syntax means this can only be run with Python3.

With an older Ubuntu installation, python2.6 is my default 'python'.

I had to make a local `python3` link to an earlier development python3.4 to get 
around this.

--
nosy: +paul.j3

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



[issue22267] fix reliance on refcounting in test_weakref

2014-08-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b63b8c5628da by Benjamin Peterson in branch '2.7':
fix some test_weakref tests to not rely on ref-counting (closes #22267)
http://hg.python.org/cpython/rev/b63b8c5628da

New changeset b1c82ef96862 by Benjamin Peterson in branch '3.4':
fix some test_weakref tests to not rely on ref-counting (closes #22267)
http://hg.python.org/cpython/rev/b1c82ef96862

New changeset 294b598afbb6 by Benjamin Peterson in branch 'default':
merge 3.4 (#22267)
http://hg.python.org/cpython/rev/294b598afbb6

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

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



[issue22265] fix reliance on refcounting in test_itertools

2014-08-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a91f8766f755 by Benjamin Peterson in branch '2.7':
allow test to work on implementations not using ref-counting (closes #22265)
http://hg.python.org/cpython/rev/a91f8766f755

New changeset e6bb59b6b85c by Benjamin Peterson in branch '3.4':
allow test to work on implementations not using ref-counting (closes #22265)
http://hg.python.org/cpython/rev/e6bb59b6b85c

New changeset ed4ffd602f4e by Benjamin Peterson in branch 'default':
merge 3.4 (#22265)
http://hg.python.org/cpython/rev/ed4ffd602f4e

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

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



[issue9205] Parent process hanging in multiprocessing if children terminate unexpectedly

2014-08-24 Thread Ned Deily

Changes by Ned Deily n...@acm.org:


--
nosy: +sbt

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



[issue22270] cache version selection for documentation

2014-08-24 Thread Jonas Jelten

New submission from Jonas Jelten:

The Python version selection for the documentation should be cached.
It's very annoying having to select the preferred version each time one follows 
a link, e.g. search result, irc post, etc.

I'd like to see caching the preferred version in a cookie and automatically 
switching to this python version when opening doc pages.

--
assignee: docs@python
components: Documentation
messages: 225847
nosy: docs@python, thejj
priority: normal
severity: normal
status: open
title: cache version selection for documentation
type: enhancement
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5

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



[issue22266] fix reliance on refcounting in tarfile.gzopen

2014-08-24 Thread Benjamin Peterson

Benjamin Peterson added the comment:

I think technically this changes semantics, since the construction of the 
GzipFile is no longer in the main try-except. You should probably backport the 
full 3.x behavior.

--
nosy: +benjamin.peterson

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



[issue22270] cache version selection for documentation

2014-08-24 Thread Benjamin Peterson

Benjamin Peterson added the comment:

I don't think that makes much sense. People often link to a particular version 
of the documentation and making the version sticky to a particular user could 
be confusing.

--
nosy: +benjamin.peterson

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



[issue22270] cache version selection for documentation

2014-08-24 Thread Jonas Jelten

Jonas Jelten added the comment:

it should rather be a opt-in feature. and when the redirection triggered, one 
should be able do click (you know it from wikipedia) back to page where one was 
redireced from.

--

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



[issue22270] cache version selection for documentation

2014-08-24 Thread Benjamin Peterson

Benjamin Peterson added the comment:

On Sun, Aug 24, 2014, at 16:39, Jonas Jelten wrote:
 
 Jonas Jelten added the comment:
 
 it should rather be a opt-in feature. and when the redirection triggered,
 one should be able do click (you know it from wikipedia) back to page
 where one was redireced from.

That would interact poorly with linking to particular sections with a #.

--

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



[issue22264] Add wsgiref.util.fix_decoding

2014-08-24 Thread Graham Dumpleton

Graham Dumpleton added the comment:

Is actually WSGI 1.0.1 and not 1.1. :-)

--
nosy: +grahamd

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



[issue22264] Add wsgiref.util.fix_decoding

2014-08-24 Thread STINNER Victor

STINNER Victor added the comment:

I don't like fix in the name fix_encoding. It is negative. Why not decode 
or decode_wsgi?

--

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



[issue22264] Add wsgiref.util.fix_decoding

2014-08-24 Thread Graham Dumpleton

Graham Dumpleton added the comment:

From memory, the term sometimes used on the WEB-SIG when discussed was 
transcode.

I find the idea that it needs 'fixing' or is 'incorrect', as in 'fix the 
original incorrect decoding to latin-1' is a bit misleading as well. It was the 
only practical way of doing things that didn't cause a lot of other problems 
and was a deliberate decision. It wasn't a mistake.

--

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



[issue22258] set_inheritable(): ioctl(FIOCLEX) is available but fails with ENOTTY on Illumos

2014-08-24 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@gmail.com:


--
title: Use FD_CLOEXEC in Python/fileutils.c - set_inheritable(): 
ioctl(FIOCLEX) is available but fails with ENOTTY on Illumos

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



[issue22258] set_inheritable(): ioctl(FIOCLEX) is available but fails with ENOTTY on Illumos

2014-08-24 Thread STINNER Victor

STINNER Victor added the comment:

@Igor: Here is a patch. Can you please apply it and run ./python -m test -v 
test_os on your OS? I tried it manually on Linux by forcing the errno to 
ENOTTY.

--
Added file: http://bugs.python.org/file36460/ioctl_works.patch

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



[issue22264] Add wsgiref.util.fix_decoding

2014-08-24 Thread STINNER Victor

STINNER Victor added the comment:

I don't think that applications are prepared to handle surrogate characters, so 
I'm not sure that the default encoding should be surrogateescape. In my 
experience, text is later encoded to UTF-8 (or latin1 or ascii) and you then 
you an error from the encoder.

Just one example: issue #11186.

--

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



[issue22264] Add wsgiref.util.fix_decoding

2014-08-24 Thread STINNER Victor

STINNER Victor added the comment:

Oh, I forgot to mention that I'm not convinced that we should add such function 
to the Python stdlib.

--

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



[issue18814] Add tools for cleaning surrogate escaped strings

2014-08-24 Thread STINNER Victor

STINNER Victor added the comment:

Your clean() function looses information. If a filename contains almost only 
undecodable characters, it will looks like .txt. It's not very useful. I 
would prefer to escape the byte. Mac OS X (HFS+ filesystem) uses for example 
%HH format: \udc80 would be replaced with %80 for example.

This format is also used in URLs. For example, a\xe9b.txt (latin-1, whereas 
my locale encoding is UTF-8) is displayed a�b.txt in Firefox (when listing a 
local directory), but Firefox uses the URL file://.../a%E9b.txt (hexadecimal 
in uppercase).

In the Gnome file browser (Nautilus), a\xe9b.txt (latin-1, whereas my locale 
encoding is UTF-8) is displayed a�b.txt (invalid encoding).

--

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



[issue22207] Test for integer overflow on Py_ssize_t: explicitly cast to size_t

2014-08-24 Thread STINNER Victor

STINNER Victor added the comment:

 I think there are too many changes. Here is simpler patch which get rid of 
 all warnings in Objects/unicodeobject.c on my computer (gcc 4.6.3, 32-bit 
 Linux).

The purpose of my patch is not to make the compiler quiet, but to ensure that 
negative lengths are handled correctly: Python must raise an error if a length 
is negative.

For example, _PyUnicode_DecodeUnicodeInternal() doesn't check currently if the 
size is negative. I don't know exactly what happens if you pass a negative size.

--

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



[issue22271] Deprecate PyUnicode_AsUnicode(): emit a DeprecationWarning

2014-08-24 Thread STINNER Victor

New submission from STINNER Victor:

With the PEP 393 implemented in Python 3.3, PyUnicode_AsUnicode() and all 
similar functions have to convert the compact string to a heavy wchar_t* string 
(UCS-4 on Linux: 4 bytes per character, UTF-16 on Windows: 2 or 4 bytes per 
character) which is stored in the string. The heavy Py_UNICODE* storage is 
kept until the string is destroyed, which may only occur at Python exit.

To reduce the memory footprint, it would be nice to promote the usage of the 
PEP 393 and start to emit a DeprecationWarning warning. The Py_UNICODE type and 
all related functions are already deprecated in the documentation.

The deprecate PyUnicode_AsUnicode(), we should stop using it in Python itself. 
For example, PyUnicode_AsWideCharString() can be used to encode filenames on 
Windows, it doesn't store the encoded string in the Python object. See for 
example path_converter() in posixmodule.c.

--
messages: 225860
nosy: haypo, loewis
priority: normal
severity: normal
status: open
title: Deprecate PyUnicode_AsUnicode(): emit a DeprecationWarning
versions: Python 3.5

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



[issue22117] Rewrite pytime.h to work on nanoseconds

2014-08-24 Thread STINNER Victor

STINNER Victor added the comment:

Instead of a complex structure, we can use a 64-bit signed integer to store a 
number of nanoseconds. For a UNIX epoch, nanoseconds since January 1st 1970, 
the min/max are:
1677-09-21 00:12:43.145224
2262-04-11 23:47:16.854776

The Linux kernel is going to use 64-bit integer even on 32-bit CPU to store 
timestamps, to simplify the code (to avoid the structure).

--

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



[issue22240] argparse support for python -m module in help

2014-08-24 Thread Miki Tebeka

Miki Tebeka added the comment:

How can you run a package without -m?

--

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



[issue22240] argparse support for python -m module in help

2014-08-24 Thread Miki Tebeka

Miki Tebeka added the comment:

Made the test more robust by using sys.executable in the comparison.

--
Added file: http://bugs.python.org/file36461/prog3.diff

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



[issue9205] Parent process hanging in multiprocessing if children terminate unexpectedly

2014-08-24 Thread Brian Curtin

Changes by Brian Curtin br...@python.org:


--
nosy:  -brian.curtin

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



[issue22266] fix reliance on refcounting in tarfile.gzopen

2014-08-24 Thread Brian Kearns

Changes by Brian Kearns bdkea...@gmail.com:


Removed file: http://bugs.python.org/file36456/tarfile.patch

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



[issue22266] fix reliance on refcounting in tarfile.gzopen

2014-08-24 Thread Brian Kearns

Brian Kearns added the comment:

Yes, I guess that makes sense (though this behavior is undocumented and 
untested...)

--
Added file: http://bugs.python.org/file36462/tarfile.patch

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



[issue22240] argparse support for python -m module in help

2014-08-24 Thread paul j3

paul j3 added the comment:

Package might be the wrong term.  How about a directory with a `__main__.py` 
file, and no local imports (relative or not)?  In my tests it runs with and 
without the -m.

--

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



[issue22260] Rearrange tkinter tests, use test discovery

2014-08-24 Thread Zachary Ware

Zachary Ware added the comment:

Here's a new version of the patch, post-#22236.  Serhiy, since you want this in 
2.7 and 3.4, this version doesn't move any files around (except 
Lib/test/test_tcl.py), which should make backporting easier.

I like this patch much better than the original, it's a much smaller diff and 
doesn't have to mess around with a 'setUpGUIModule' function.

The desegregation of test_tcl, test_tk, test_ttk_guionly and test_ttk_textonly 
is intentional: with the patch, all of the tests that require the gui are 
properly guarded by test.support.requires('gui'), and the ttk gui tests are 
additionally guarded by the new 'tkinter.test.support.check_ttk_availability' 
function (which I still have yet to test against Tk 8.4, but plan to shortly).  
This means that by doing 'python -m test test_tkinter', all gui-less tests are 
run (namely, the current test_tcl and test_ttk_textonly, and also 
test_variables) and all the gui tests are reported as skipped.  Meanwhile, 
doing 'python -m test -uall test_tkinter' or 'python -m tkinter.test', all 935 
tkinter tests are run (if a gui is in fact available).  Currently, the shortest 
invocation for running all of the tkinter tests that I know of is 'python -m 
test -uall test_tcl test_tk test_ttk_guionly test_ttk_textonly', which is quite 
a handful to type every time :).  If you really want the old subsets, they'
 re still available as 'python -m 
tkinter.test.test_(tcl|tkinter|ttk|ttk.test_functions)' (though 
'tkinter.test.test_ttk' will also run the 'ttk_textonly' tests).

--
Added file: http://bugs.python.org/file36463/test_tkinter.v2.diff

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