[issue16459] sys.stdout.write printing length of string

2012-11-11 Thread Ezio Melotti

Changes by Ezio Melotti :


--
components:  -None
stage:  -> committed/rejected
type:  -> behavior

___
Python tracker 

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



[issue16451] Remove duplication between slice_indices and compute_slice_indices

2012-11-11 Thread Mark Dickinson

Changes by Mark Dickinson :


--
assignee:  -> mark.dickinson

___
Python tracker 

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



[issue16459] sys.stdout.write printing length of string

2012-11-11 Thread Firat Ozgul

Firat Ozgul added the comment:

Thank you for the explanation, kushaldas.

--

___
Python tracker 

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



[issue16459] sys.stdout.write printing length of string

2012-11-11 Thread Kushal Das

Kushal Das added the comment:

sys.stdout.write returns the length of the string it printed. 
try these:

x = sys.stdout.write("abc")
print x

or from console
python -c 'import sys ; sys.stdout.write("abc")'

--
nosy: +kushaldas

___
Python tracker 

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



[issue16459] sys.stdout.write printing length of string

2012-11-11 Thread Firat Ozgul

Changes by Firat Ozgul :


--
status: open -> closed

___
Python tracker 

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



[issue16459] sys.stdout.write printing length of string

2012-11-11 Thread Firat Ozgul

Firat Ozgul added the comment:

Although I do not know the reason for change, it seems that this is expected 
behavior as of Python 3.0 in interactive shell. Closing the record as 'invalid'.

--
resolution:  -> invalid

___
Python tracker 

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



[issue16459] sys.stdout.write printing length of string

2012-11-11 Thread Firat Ozgul

New submission from Firat Ozgul:

On Python 3.3 under Windows and GNU/Linux, sys.stdout.write prints the length 
of string along with the string itself:

>>> sys.stdout.write("a_string")

a_string8

Note the '8' at the end of 'a_string'.

Is it expected behavior?

--
components: None
messages: 175419
nosy: firatozgul
priority: normal
severity: normal
status: open
title: sys.stdout.write printing length of string
versions: Python 3.3

___
Python tracker 

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



[issue12082] Python/import.c still references fstat even with DONT_HAVE_FSTAT/!HAVE_FSTAT

2012-11-11 Thread Petri Lehtinen

Petri Lehtinen added the comment:

Should the defines be removed then, because they're kind of false promises for 
the user.

--

___
Python tracker 

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



[issue16267] order of decorators @abstractmethod and @classmethod is significant (is not documented to be in @abstractclassmethod which advises their combined use)

2012-11-11 Thread Nick Coghlan

Nick Coghlan added the comment:

It took me a while to get my brain back up to speed with the full rationale 
behind the current design (mostly by rereading the multitude of comment on 
#11610).

As Darren says, the main advantage of the current scheme is that the wrapper 
descriptors deliberately *don't* have any concept of abstract/non-abstract 
independent of the methods that make them up. So I think the main thing to do 
is change the documentation of the affected descriptors to be more explicit 
about the required order of the replacement decorators. Otherwise people are 
likely to map "abstractXmethod" to "@abstractmethod + @Xmethod" and write them 
in that order (which won't work).

--

___
Python tracker 

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



[issue16458] subprocess.py throw "The handle is invalid" error on duplicating the STD_INPUT_HANDLE

2012-11-11 Thread Karthk Rajagopalan

New submission from Karthk Rajagopalan:

Please download subprocess.zip and extract the archive. Run - 

perl test.pl

you will notice 'invalid handle' error on duplicating STD_INPUT_HANDLE in 
python. This is observed in Windows XP SP3. Vista SP2 and higher platforms 
doesn't show this failure when I checked.

"test.pl" spawn a python process "test.py" using CREATE_NEW_PROCESS_GROUP flag. 
Before it does, it close STDIN and create a listening socket. Perl under the 
hood, convert the socket handle to file descriptor using open_osfhandle(..) 
call. When it does this, the C runtime set the standard input handle to this 
descriptor  for console app. [ See msvcr* osfinfo.c code - SetStdHandle( 
STD_INPUT_HANDLE, (HANDLE)value )  ]. As a result, when you get the 
STD_INPUT_HANDLE, you will get the new one. Duplicating this handle, hence 
throw the invalid handle error in Windows XP SP3. 

When I looked at MSDN for DuplicateHandle(..), it is mentioned not to duplicate 
socket handle using this call. So I suspect something going wrong in XP 
platform. To fix this issue, I have come up with a patch - python-2143_patch. 
Please take a look and let me know your comments.

-Karthik

--
components: Windows
files: subprocess.zip
messages: 175416
nosy: kartlee05
priority: normal
severity: normal
status: open
title: subprocess.py throw "The handle is invalid" error on duplicating the 
STD_INPUT_HANDLE
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file27966/subprocess.zip

___
Python tracker 

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



[issue16457] Allow operator 'getter' methods to take a list and return a tuple

2012-11-11 Thread Nick Coghlan

Nick Coghlan added the comment:

Lists can't be dictionary keys, but they can appear in other mappings (e.g. an 
id-keyed mapping). So, while you could add this capability to attrgetter 
without breaking backwards compatibility, it's not possible for itemgetter.

--
nosy: +ncoghlan

___
Python tracker 

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



[issue16218] Python launcher does not support unicode characters

2012-11-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6017f09ead53 by Victor Stinner in branch '3.3':
Issue #16218, #16444: Backport improvment on tests for non-ASCII characters
http://hg.python.org/cpython/rev/6017f09ead53

--

___
Python tracker 

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



[issue16444] Use support.TESTFN_UNDECODABLE on UNIX

2012-11-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6017f09ead53 by Victor Stinner in branch '3.3':
Issue #16218, #16444: Backport improvment on tests for non-ASCII characters
http://hg.python.org/cpython/rev/6017f09ead53

--

___
Python tracker 

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



[issue16457] Allow operator 'getter' methods to take a list and return a tuple

2012-11-11 Thread R. David Murray

New submission from R. David Murray:

Consider this code snippet, simplified from a real application:

def display(self, *columns)
getter = attrgetter(*columns)
toprint = [[str(x) for x in getter(row)] for row in self._rows]

This works great...as long as there are two or more columns to print.
If there is only one column, it bombs because the getter returns a value
instead of a tuple.

This would not be a problem in and of itself, but there is no way to
tell attrgetter that I want a tuple even if there is only one value.

I believe it would be backward compatible to allow:

attrgetter(['a'])
itemgetter(['a', 'b'])

to return a tuple, since a list cannot be an attribute name.  The same
would apply to itemgetter, since a list cannot be a dictionary key.

--
components: Library (Lib)
messages: 175412
nosy: r.david.murray
priority: normal
severity: normal
stage: needs patch
status: open
title: Allow operator 'getter' methods to take a list and return a tuple
type: enhancement
versions: Python 3.4

___
Python tracker 

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



[issue16454] Mostly for discussion: _winapi as builtin for bootstrapping distutils.

2012-11-11 Thread Richard Oudkerk

Changes by Richard Oudkerk :


--
status: open -> closed

___
Python tracker 

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



[issue16456] UnicodeDecodeError thrown for 'encode' operation on string

2012-11-11 Thread STINNER Victor

STINNER Victor added the comment:

'AB\xff'.encode('ascii') raises a UnicodeDecodeError because the byte string 
'AB\xff' is decoded from the default encoding (sys.getdefaultencoding(), which 
is 'ASCII' in most cases), before  the .encode() method is called.

This is not a Python bug, but it is surprising. You should try Python 3 which 
does not have implicit conversion from/to bytes/unicode.

--
nosy: +haypo
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue16455] sys.getfilesystemencoding() is not the locale encoding on FreeBSD and OpenSolaris when the locale is not set

2012-11-11 Thread STINNER Victor

STINNER Victor added the comment:

Some tests are failing with the patch:

==
FAIL: test_undecodable_env (test.test_subprocess.POSIXProcessTestCase)
--
Traceback (most recent call last):
  File "/usr/home/haypo/prog/python/default/Lib/test/test_subprocess.py", line 
1606, in test_undecodable_env
self.assertEqual(stdout.decode('ascii'), ascii(value))
AssertionError: "'abc\\xff'" != "'abc\\udcff'"
- 'abc\xff'
?  ^
+ 'abc\udcff'
?  ^^^

==
FAIL: test_strcoll_with_diacritic (test.test_locale.TestEnUSCollation)
--
Traceback (most recent call last):
  File "/usr/home/haypo/prog/python/default/Lib/test/test_locale.py", line 364, 
in test_strcoll_with_diacritic
self.assertLess(locale.strcoll('\xe0', 'b'), 0)
AssertionError: 126 not less than 0

==
FAIL: test_strxfrm_with_diacritic (test.test_locale.TestEnUSCollation)
--
Traceback (most recent call last):
  File "/usr/home/haypo/prog/python/default/Lib/test/test_locale.py", line 367, 
in test_strxfrm_with_diacritic
self.assertLess(locale.strxfrm('\xe0'), locale.strxfrm('b'))
AssertionError: '\xe0' not less than 'b'

--

___
Python tracker 

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



[issue8865] select.poll is not thread safe

2012-11-11 Thread Christian Schubert

Christian Schubert added the comment:

> How about raising an error on concurrent modification, instead of trying to 
> make it thread-safe?

That's totally fine with me.

--

___
Python tracker 

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




[issue16455] sys.getfilesystemencoding() is not the locale encoding on FreeBSD and OpenSolaris when the locale is not set

2012-11-11 Thread STINNER Victor

STINNER Victor added the comment:

Attached patch works around the CODESET issue on OpenIndiana and FreeBSD. If 
the LC_CTYPE locale is "C" and nl_langinfo(CODESET) returns ASCII (or an alias 
of this encoding), b"\xE9" is decoded from the locale encoding: if the result 
is U+00E9, the patch Python uses ISO-8859-1. (If decoding fails, the locale 
encoding is really ASCII, the workaround is not used.)

If the result is different (b'\xe9' is not decoded from the locale encoding to 
U+00E9), a ValueError is raised. I wrote this test to detect bugs. I hope that 
our buildbots will validate the code. We may choose a different behaviour (ex: 
keep ASCII).

Example on FreeBSD 8.2, original Python 3.4:

$ ./python
>>> import sys, locale
>>> sys.getfilesystemencoding()
'ascii'
>>> locale.getpreferredencoding()
'US-ASCII'

Example on FreeBSD 8.2, patched Python 3.4:

$ ./python 
>>> import sys, locale
>>> sys.getfilesystemencoding()
'iso8859-1'
>>> locale.getpreferredencoding()
'iso8859-1'

--
keywords: +patch
Added file: http://bugs.python.org/file27965/workaround_codeset.patch

___
Python tracker 

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



[issue16454] Mostly for discussion: _winapi as builtin for bootstrapping distutils.

2012-11-11 Thread Ray Donnelly

Ray Donnelly added the comment:

I should have checked the situation better, it is indeed towards the back end 
of a series of patches to enable MinGW compilation, so the issue is irrelevant 
without the preceding patches.

Sorry for the noise.

--
resolution:  -> invalid

___
Python tracker 

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



[issue16444] Use support.TESTFN_UNDECODABLE on UNIX

2012-11-11 Thread STINNER Victor

STINNER Victor added the comment:

> These encodings used not only on Windows.

You can uses cpXXX encodings explictly to read or write a file, but these 
encodings are not used for sys.getfilesystemencoding() (or sys.stdout.encoding).

--

___
Python tracker 

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



[issue16454] Mostly for discussion: _winapi as builtin for bootstrapping distutils.

2012-11-11 Thread Richard Oudkerk

Richard Oudkerk added the comment:

The patch does not apply correctly against vanilla Python 3.3.  I would guess 
that you are using a version of Python which has been patched to add mingw 
support.  Where did you get it from?

(In vanilla Python 3.3, setup.py does not contain any mention of _winapi.c.)

--

___
Python tracker 

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



[issue16456] UnicodeDecodeError thrown for 'encode' operation on string

2012-11-11 Thread Wojtek Szymilowski

New submission from Wojtek Szymilowski:

UnicodeDecodeError exception is reported for encode operation on strings.
This issue does not surface for the same operation on unicode string 
(UnicodeEncodeError exception is correctly reported).

 string:
>>> 'AB\xff'.encode('ascii')

Traceback (most recent call last):
  File "", line 1, in 
'AB\xff'.encode('ascii')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xff in position 2: ordinal 
not in range(128)

 unicode string:
>>> u'AB\xff'.encode('ascii')

Traceback (most recent call last):
  File "", line 1, in 
u'AB\xff'.encode('ascii')
UnicodeEncodeError: 'ascii' codec can't encode character u'\xff' in position 2: 
ordinal not in range(128)

--
components: Unicode
messages: 175404
nosy: Wojtek.Szymilowski, ezio.melotti
priority: normal
severity: normal
status: open
title: UnicodeDecodeError thrown for 'encode' operation on string
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue15667] PEP 3121, 384 refactoring applied to pickle module

2012-11-11 Thread Andreas Stührk

Andreas Stührk added the comment:

See also issue #11349.

--
nosy: +Trundle

___
Python tracker 

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



[issue16444] Use support.TESTFN_UNDECODABLE on UNIX

2012-11-11 Thread STINNER Victor

STINNER Victor added the comment:

> I suppose you noticed you broke a bunch of buildbots :)

Failures occur on FreeBSD, OpenIndiana and some other buildbots which don't set 
a locale and so use the "C" locale. main() decodes command line arguments from 
the locale encoding using _Py_char2wchar(). On these OSes, the "C" locale uses 
the ISO-8859-1 encoding, but the problem is that nl_langinfo(CODESET) announces 
ASCII :-/ test_cmd_line.test_undecodable_code() handles this case. Extract of a 
comment:

# _Py_char2wchar() decoded b'\xff' as '\xff' even if the locale is  
# C and the locale encoding is ASCII. It occurs on FreeBSD, Solaris 
# and Mac OS X. 

Mac OS X is now using UTF-8 to decode the command line arguments.

I just created the issue #16455 to fix FreeBSD and OpenIndiana.

I propose to close this issue because I consider it as fixed (#16455 will 
reenable TESTFN_UNDECODABLE in test_cmd_line_script).

--

___
Python tracker 

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



[issue16455] sys.getfilesystemencoding() is not the locale encoding on FreeBSD and OpenSolaris when the locale is not set

2012-11-11 Thread STINNER Victor

New submission from STINNER Victor:

On FreeBSD and OpenIndiana, sys.getfilesystemencoding() is 'ascii' when the 
locale is not set, whereas the locale encoding is ISO-8859-1.

This inconsistency causes different issue. For example, 
os.fsencode(sys.argv[1]) fails if the argument is not ASCII because sys.argv 
are decoded from the locale encoding (by _Py_char2wchar()).

sys.getfilesystemencoding() is 'ascii' because nl_langinfo(CODESET) is used to 
to get the locale encoding and nl_langinfo(CODESET) announces ASCII (or an 
alias of this encoding).

Python should detect this case and set sys.getfilesystemencoding() to 
'iso8859-1' if the locale encoding is 'iso8859-1' whereas nl_langinfo(CODESET) 
announces ASCII. We can for example decode b'\xe9' with mbstowcs() and check if 
it fails or if the result is U+00E9.

--
components: Unicode
messages: 175401
nosy: ezio.melotti, haypo
priority: normal
severity: normal
status: open
title: sys.getfilesystemencoding() is not the locale encoding on FreeBSD and 
OpenSolaris when the locale is not set
versions: Python 3.4

___
Python tracker 

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



[issue8865] select.poll is not thread safe

2012-11-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> it strikes me that this should not be a very common problem.  how many 
> applications are going to share the same poll object _across_ multiple 
> threads?

Indeed that doesn't sound very likely. How about raising an error on concurrent 
modification, instead of trying to make it thread-safe?

--

___
Python tracker 

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



[issue16444] Use support.TESTFN_UNDECODABLE on UNIX

2012-11-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

These encodings used not only on Windows.

--

___
Python tracker 

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



[issue11981] dupe self.fp.tell() in zipfile.ZipFile.writestr

2012-11-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM.

--
stage:  -> commit review
versions: +Python 3.4

___
Python tracker 

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



[issue8865] select.poll is not thread safe

2012-11-11 Thread Gregory P. Smith

Gregory P. Smith added the comment:

our patches are similar.  i updated it to use long long and Py_ssize_t and 
Py_CLEAR and Py_RETURN_NONE in a few places and added comments.

getting rid of the CLEAR_UFDS macro as you did is a good idea.

--

___
Python tracker 

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



[issue16444] Use support.TESTFN_UNDECODABLE on UNIX

2012-11-11 Thread STINNER Victor

STINNER Victor added the comment:

> TESTFN_UNDECODABLE is not detected for cp1250, cp1251, cp1252, cp1254, cp1257 
> and cp1258.

The Python encoding and the real codec used by Windows are different: Python 
fails to decode bytes 0x80-0x9f, but Windows does decode them. I prefer to 
avoid these bytes to not rely too much on the Python codec.

--

___
Python tracker 

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



[issue8865] select.poll is not thread safe

2012-11-11 Thread Gregory P. Smith

Gregory P. Smith added the comment:

here's an updated patch.

it strikes me that this should not be a very common problem.  how many 
applications are going to share the same poll object _across_ multiple threads?

if they do and the file descriptor they'll be spending a lot of time mallocing 
and freeing new pollfd ufds arrays in each thread as a result as they all fight 
for ownership of the pollObject's ufds.

--
Added file: 
http://bugs.python.org/file27964/issue8865-poll-multithread-gps01.diff

___
Python tracker 

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



[issue8865] select.poll is not thread safe

2012-11-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

In general the patch looks good to me.  I only get rid of non-needed macros.

--
stage:  -> test needed
Added file: http://bugs.python.org/file27963/select_concurrent_poll.patch

___
Python tracker 

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



[issue16454] Mostly for discussion: _winapi as builtin for bootstrapping distutils.

2012-11-11 Thread Ray Donnelly

New submission from Ray Donnelly:

I'm submitting this patch as it was suggested I do so by Antoine Pitrou on 
#python-dev. As such, it's more a point of discussion than a patch I'm trying 
to get merged (for one thing, my build is a MinGW GCC compiled and I've not 
considered the MSVC Windows build).

I ran into a problem with a customisation I made to cygwinccompiler.py where I 
wanted to use Popen to ask gcc where it's ld is:

out = Popen(gcc+' --print-prog-name ld', shell=True, stdout=PIPE).stdout

This has worked fine before on 2.7.3, but with 3.3.0, subprocess can't be 
imported as _winapi isn't builtin, instead, it's built by setup.py as a module.

So is this the right thing to do? Or is distutils not supposed to use 
subprocess during bootstrapping?

--
files: _winapi_as_builtin_for_distutils_bootstrap.patch
keywords: patch
messages: 175393
nosy: Ray.Donnelly, pitrou, sbt
priority: normal
severity: normal
status: open
title: Mostly for discussion: _winapi as builtin for bootstrapping distutils.
type: behavior
versions: Python 3.4
Added file: 
http://bugs.python.org/file27962/_winapi_as_builtin_for_distutils_bootstrap.patch

___
Python tracker 

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



[issue14631] Instance methods and WeakRefs don't mix.

2012-11-11 Thread Simon Feltman

Simon Feltman added the comment:

Some more complex examples from various libraries:

https://github.com/django/django/blob/master/django/dispatch/saferef.py
https://github.com/11craft/louie/blob/master/louie/saferef.py

I think both of these originated in pydispatcher.

--

___
Python tracker 

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



[issue14631] Instance methods and WeakRefs don't mix.

2012-11-11 Thread Simon Feltman

Simon Feltman added the comment:

The WeakCallableRef that was attached seemed to support regular functions (or 
anything callable) which is nice. The naming also leaves room for a 
WeakCallableProxy.

--

___
Python tracker 

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



[issue8865] select.poll is not thread safe

2012-11-11 Thread Gregory P. Smith

Gregory P. Smith added the comment:

Christian Schubert (apexo) - Would you please submit a PSF contributor 
agreement form?

http://www.python.org/psf/contrib/
http://www.python.org/psf/contrib/contrib-form-python/

thanks!

--

___
Python tracker 

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



[issue14631] Instance methods and WeakRefs don't mix.

2012-11-11 Thread Daniel Urban

Changes by Daniel Urban :


--
nosy: +daniel.urban

___
Python tracker 

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



[issue8865] select.poll is not thread safe

2012-11-11 Thread Gregory P. Smith

Gregory P. Smith added the comment:

i'm looking at getting this in.

--
assignee:  -> gregory.p.smith

___
Python tracker 

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



[issue16418] argparse with many choices can generate absurdly long usage message

2012-11-11 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I am arguing that (x)range *should* be usable for large numbers of options 
*because* the containment test is O(1). What happens is you *do* use xrange 
instead of range in 2.7 or 3.x instead of 2.7?

In 2.x, range(n) *is* a list so that is a bad choice for large n, regardless of 
the display issue, which could be fixed separately as is being done on other 
issues.

--

___
Python tracker 

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



[issue8865] select.poll is not thread safe

2012-11-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I was unable to apply the patch automatically, so I had to do it manually.  
Here is an updated patch for review.  I did not consider it in detail yet, but 
it seems to correct these errors.

--
type: behavior -> crash
versions: +Python 3.3, Python 3.4 -Python 2.6, Python 3.1
Added file: http://bugs.python.org/file27961/select_concurrent_poll.patch

___
Python tracker 

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



[issue16418] argparse with many choices can generate absurdly long usage message

2012-11-11 Thread Juraj Variny

Juraj Variny added the comment:

It was Python 2.7 . But if range shouldn't be used for large number of options, 
arguing whether it's O(1) is splitting hairs, no?

I'll remove the choices from my code. Adding new type for port is overkill, 
users should know what legal TCP port numbers are.

--

___
Python tracker 

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



[issue16427] Faster hash implementation

2012-11-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 797de1864fd9 by Antoine Pitrou in branch '3.3':
Add a test for hashing of unaligned memory buffers (from issue #16427).
http://hg.python.org/cpython/rev/797de1864fd9

New changeset 9cb1366b251b by Antoine Pitrou in branch 'default':
Add a test for hashing of unaligned memory buffers (from issue #16427).
http://hg.python.org/cpython/rev/9cb1366b251b

--
nosy: +python-dev

___
Python tracker 

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



[issue14631] Instance methods and WeakRefs don't mix.

2012-11-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Here is a patch adding a WeakMethod class. It still lacks docs, I'll add some 
if people agree on the principle.

--
keywords: +patch
Added file: http://bugs.python.org/file27960/weakmethod.patch

___
Python tracker 

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



[issue1160] Medium size regexp crashes python

2012-11-11 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
stage: test needed -> patch review
Added file: http://bugs.python.org/file27959/sre_code_ucs4_test.patch

___
Python tracker 

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



[issue16453] Inconsistent dead weakref equality

2012-11-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Now fixed.

--
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue1160] Medium size regexp crashes python

2012-11-11 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Added file: http://bugs.python.org/file27958/sre_code_ucs4-3.2.patch

___
Python tracker 

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



[issue1160] Medium size regexp crashes python

2012-11-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

If we will considered it's important enough to fix, here are patches.

--
keywords: +patch
Added file: http://bugs.python.org/file27957/sre_code_ucs4-2.7.patch

___
Python tracker 

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



[issue16453] Inconsistent dead weakref equality

2012-11-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 13b74c0b040c by Antoine Pitrou in branch '2.7':
Issue #16453: Fix equality testing of dead weakref objects.
http://hg.python.org/cpython/rev/13b74c0b040c

--

___
Python tracker 

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



[issue16453] Inconsistent dead weakref equality

2012-11-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 590f1b55abea by Antoine Pitrou in branch '3.2':
Issue #16453: Fix equality testing of dead weakref objects.
http://hg.python.org/cpython/rev/590f1b55abea

New changeset c00e2c1cb3a7 by Antoine Pitrou in branch '3.3':
Issue #16453: Fix equality testing of dead weakref objects.
http://hg.python.org/cpython/rev/c00e2c1cb3a7

New changeset 9e80ea48ff39 by Antoine Pitrou in branch 'default':
Issue #16453: Fix equality testing of dead weakref objects.
http://hg.python.org/cpython/rev/9e80ea48ff39

--
nosy: +python-dev

___
Python tracker 

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



[issue16397] UserString doesn't combine nicely with strings

2012-11-11 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
resolution:  -> works for me
stage:  -> committed/rejected

___
Python tracker 

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



[issue16453] Inconsistent dead weakref equality

2012-11-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Aha, it is even worse:

>>> o = O()
>>> q = weakref.ref(o)
>>> r = weakref.ref(o)
>>> del o
>>> q() is None
True
>>> q == r
True
>>> q != r
True

--

___
Python tracker 

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



[issue16453] Inconsistent dead weakref equality

2012-11-11 Thread Antoine Pitrou

New submission from Antoine Pitrou:

Dead weakrefs to a given object happen to be equal if they don't have a 
callback, but unequal if they do. However, they are always equal when alive:

>>> class O: pass
... 
>>> o = O()
>>> def cb(_): pass
... 
>>> q = weakref.ref(o)
>>> r = weakref.ref(o)
>>> s = weakref.ref(o, cb)
>>> t = weakref.ref(o, cb)
>>> q == r
True
>>> s == t
True
>>> del o
>>> q() is None
True
>>> q == r
True
>>> s == t
False

This may be related to the following optimization (?):

>>> q is r
True
>>> s is t
False

--
components: Library (Lib)
messages: 175378
nosy: fdrake, pitrou, tim_one
priority: normal
severity: normal
status: open
title: Inconsistent dead weakref equality
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue16418] argparse with many choices can generate absurdly long usage message

2012-11-11 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Juraj: Is the example behavior from Py2 or Py3? The meaning of 'range' changed. 
In Py2, xrange would be the correct choice for 'choice'.

Does argparse actually convert (x)range objects to a list or set (the help 
indicates the latter) for internal use? That would be foolish as 'n in ' 
is an O(1) operation. (I don't remember is that works for xrange.) For 
instance, range(0, 1000, 2) is a nice way to say 'even count less than 1000'.

If it is not so converted, converting for display is also foolish.
'range(0, 1000, 2)' is clearer than an explicit sequence.

--
nosy: +bethard, terry.reedy

___
Python tracker 

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



[issue16140] subprocess.Popen the os.close calls in _execute_child can raise an EBADF exception

2012-11-11 Thread Gregory P. Smith

Gregory P. Smith added the comment:

That test is gross... it creates a nasty cycle of an instance back to itself 
via a stubbed out nested function's enclosing scope.

I'm sanitizing it now to simplify the code and not have any cycles.

--

___
Python tracker 

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



[issue16397] UserString doesn't combine nicely with strings

2012-11-11 Thread Jorge Cardona

Jorge Cardona added the comment:

Hi, this can be closed. 

Thanks.

--
status: open -> closed

___
Python tracker 

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



[issue16405] Explain how to set up the whitespace commit hook locally

2012-11-11 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I would be helped by such an explanation in the devguide.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue16397] UserString doesn't combine nicely with strings

2012-11-11 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Jorge, can we close this or do you still have a specific suggestion.
Also, if you reply by mail, please snip previous messages as they are already 
posted.

--
nosy: +terry.reedy
type: behavior -> enhancement

___
Python tracker 

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



[issue16396] Importing ctypes.wintypes on Linux gives a traceback

2012-11-11 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
nosy: +amaury.forgeotdarc, belopolsky, meador.inge
versions:  -Python 3.1

___
Python tracker 

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



[issue14631] Instance methods and WeakRefs don't mix.

2012-11-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

WeakMethod sounds like a good name to me. However, instead of acting as a 
proxy, I think it should act as a regular weakref (i.e. you have to call it to 
get the actual method object).

--
nosy: +pitrou

___
Python tracker 

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



[issue8865] select.poll is not thread safe

2012-11-11 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue16449] RotatingFileHandler rollover doesn't work on QNX shmem filesystems

2012-11-11 Thread Vinay Sajip

Vinay Sajip added the comment:

> Doesn't the "rotator" attribute break atomicity?

Which rotator do you mean? The default rotator is None, which leads to 
os.rename being called. If you're referring to the example in the documentation 
(cookbook) - it was intended purely as an example, and the paragraph under the 
snippet does say it's only intended for illustrative purposes.

--

___
Python tracker 

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



[issue15861] ttk.Treeview "unmatched open brace in list"

2012-11-11 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
stage: needs patch -> patch review

___
Python tracker 

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



[issue14215] http://www.python.org/dev/peps/ title is python.org

2012-11-11 Thread Georg Brandl

Georg Brandl added the comment:

@ Nick/Ezio: the catch was that the /dev/peps/ directory is handled in addition 
to /dev/peps/pep-/, which always had a nice title.

For all PEPs, four files are generated (although it seems sufficient to have 
two), while for /dev/peps/, only body.html was copied over to its directory.

--

___
Python tracker 

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



[issue14215] http://www.python.org/dev/peps/ title is python.org

2012-11-11 Thread Georg Brandl

Georg Brandl added the comment:

Fixed with commit 11779150cf87 in the peps repo.  May need a PEP addition or 
PEP title change to trigger, but it's too minor to force that right now.

--
nosy: +georg.brandl
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue16124] fcntl_ioctl still not 100% sane with unsigned longs

2012-11-11 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +skrah, trent

___
Python tracker 

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



[issue16449] RotatingFileHandler rollover doesn't work on QNX shmem filesystems

2012-11-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Doesn't the "rotator" attribute break atomicity?  A careful rotator should 
first rename the source to the temporary file, process the data and save it to 
other temporary file, and then rename the result to the destination and remove 
the first temporary file.

--

___
Python tracker 

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



[issue16427] Faster hash implementation

2012-11-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Stefan, thank you for the suggestion.  The test showed that, in fact, at least 
under some x86 there is no performance decrease when using memcpy on nonaligned 
data.  This is good news.  The code can left simple and even some doubtful 
potential undefined behavior was removed.

Additional microbenchmarks:

$ ./python -m timeit -n 1 -s "t = memview(b'a' * 10**8)"  "hash(t)"
$ ./python -m timeit -n 1 -s "t = memview(b'a' * 10**8)[1:]"  "hash(t)"
$ ./python -m timeit -n 1 -s "t = memview(b'a' * 10**8)[8:]"  "hash(t)"

   original  patchedspeedup

bytes  181 msec  46 msec3.9x
UCS1   429 msec  46.2 msec  9.3x
UCS2   179 msec  91.9 msec  1.9x
UCS4   183 msec  184 msec   1x
memview()  362 msec  91.7 msec  3.9x
memview()[1:]  362 msec  93.2 msec  3.9x
memview()[8:]  362 msec  92.4 msec  3.9x

I don't know how it will be on other platforms.

--
Added file: http://bugs.python.org/file27956/fast_hash_3.patch

___
Python tracker 

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



[issue16449] RotatingFileHandler rollover doesn't work on QNX shmem filesystems

2012-11-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> I've updated the type to enhancement (it seems like a grey area to me
> - it's a behavioural fix for a niche use case).
> 
> I suggested a patch rather than simply subclassing RotatingFileHandler
> since:
>   - The subclass would just have a copy of RotatingFileHandler's
> doRollover method with a one-line change.
>   - The proposed fix is functionally equivalent to the current code
> for all currently working uses.

You may just as well monkeypatch os.rename() to fallback on
shutil.move() if the filenames are on a /dev/shm filesystem (or you
could bug QNX to fix their broken filesystem...).

>From a code quality and readability standpoint, os.rename() conveys the
intended semantics clearly, while shutil.move() doesn't, so switching to
shutil.move() in the stdlib would be a regression. Also, doing this in
logging would open the door to doing the same thing in other modules.
Even a critical piece of infrastructure such as importlib relies on
os.rename() working properly.

--

___
Python tracker 

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



[issue16449] RotatingFileHandler rollover doesn't work on QNX shmem filesystems

2012-11-11 Thread Phil Connell

Phil Connell added the comment:

I've updated the type to enhancement (it seems like a grey area to me - it's a 
behavioural fix for a niche use case).

I suggested a patch rather than simply subclassing RotatingFileHandler since:
  - The subclass would just have a copy of RotatingFileHandler's doRollover 
method with a one-line change.
  - The proposed fix is functionally equivalent to the current code for all 
currently working uses.


Thanks for the offer of having an extension linked from your blog. I don't 
think it's appropriate for this case (since it's just a slightly modified copy 
of the stdlib code - I'll probably just keep the patch along with a few other 
compatibility hacks we have) although I may have something for you in future 
(we do have a subclass that compresses old logs).

--
type: behavior -> enhancement

___
Python tracker 

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



[issue15677] Gzip/zlib allows for compression level=0

2012-11-11 Thread Nadeem Vawda

Nadeem Vawda added the comment:

Committed. Thanks for the patch!

--
resolution:  -> fixed
stage: commit review -> committed/rejected
status: open -> closed
type:  -> enhancement

___
Python tracker 

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



[issue15677] Gzip/zlib allows for compression level=0

2012-11-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 735ef27fa231 by Nadeem Vawda in branch '2.7':
Issue #15677: Document that zlib and gzip accept a compression level of 0 to 
mean 'no compression'.
http://hg.python.org/cpython/rev/735ef27fa231

New changeset f6c4c178da56 by Nadeem Vawda in branch '2.7':
Issue #15677: Also fix docstrings in zlib module.
http://hg.python.org/cpython/rev/f6c4c178da56

New changeset 9dde30690f44 by Nadeem Vawda in branch '3.2':
Issue #15677: Document that zlib and gzip accept a compression level of 0 to 
mean 'no compression'.
http://hg.python.org/cpython/rev/9dde30690f44

New changeset 0e48bf45313c by Nadeem Vawda in branch '3.3':
Issue #15677: Document that zlib and gzip accept a compression level of 0 to 
mean 'no compression'.
http://hg.python.org/cpython/rev/0e48bf45313c

New changeset 21335c9fcec0 by Nadeem Vawda in branch 'default':
Issue #15677: Document that zlib and gzip accept a compression level of 0 to 
mean 'no compression'.
http://hg.python.org/cpython/rev/21335c9fcec0

--
nosy: +python-dev

___
Python tracker 

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



[issue16449] RotatingFileHandler rollover doesn't work on QNX shmem filesystems

2012-11-11 Thread Vinay Sajip

Vinay Sajip added the comment:

The current implementation was written with an expectation of working rename 
functionality in the stdlib. As such, while this issue might be categorised as 
being of type "enhancement", I don't see how you can categorise it as being of 
type "behaviour".

What's the problem with subclassing the relevant handlers to implement your own 
doRollover() method? You only need to do that once for all the projects in your 
QNX environment. Given that it's not a mainstream environment, that's not IMO 
an unreasonable suggestion.

If you publish such a handler, I'll mention it on

http://plumberjack.blogspot.co.uk/p/handlers-for-logging.html

which has a whole bunch of handlers written by people for specific requirements 
which don't warrant adding functionality directly in the stdlib.

--

___
Python tracker 

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



[issue16427] Faster hash implementation

2012-11-11 Thread Stefan Krah

Stefan Krah added the comment:

> The code can be identical, but the time will differ significantly for
> aligned and non-aligned data.

Of course, but in most cases the data *is* aligned, so only code that does
something quite special pays the performance penalty.

--

___
Python tracker 

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



[issue16449] RotatingFileHandler rollover doesn't work on QNX shmem filesystems

2012-11-11 Thread Phil Connell

Phil Connell added the comment:

Serhiy, there are also calls to os.rename in RotatingFileHandler.doRollover

--

___
Python tracker 

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



[issue16449] RotatingFileHandler rollover doesn't work on QNX shmem filesystems

2012-11-11 Thread Phil Connell

Phil Connell added the comment:

I'm not convinced that it matters whether the rename or move is atomic. Can 
anyone come up with a quick concrete example?


I see two scenarios:

1. The process crashes during a copy in shutils.move(). In this case, some logs 
will be duplicated across the files involved in the copy.

2. Other threads emit logs during the rollover. Given that the IO lock is 
acquired in Handler.handle() before calling emit(), this is fine.


While the first case isn't ideal, I don't think there can be any loss of logs.

--

___
Python tracker 

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



[issue16124] fcntl_ioctl still not 100% sane with unsigned longs

2012-11-11 Thread Garrett Cooper

Garrett Cooper added the comment:

... g'night.

--
Added file: http://bugs.python.org/file27955/python-issue16124.patch

___
Python tracker 

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



[issue16124] fcntl_ioctl still not 100% sane with unsigned longs

2012-11-11 Thread Garrett Cooper

Garrett Cooper added the comment:

Grr... Let's try again.

--
Added file: http://bugs.python.org/file27954/python-issue16124.patch

___
Python tracker 

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



[issue16124] fcntl_ioctl still not 100% sane with unsigned longs

2012-11-11 Thread Garrett Cooper

Changes by Garrett Cooper :


Removed file: http://bugs.python.org/file27953/python-issue16124.patch

___
Python tracker 

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



[issue16124] fcntl_ioctl still not 100% sane with unsigned longs

2012-11-11 Thread Garrett Cooper

Garrett Cooper added the comment:

And I missed the int -> unsigned int part. Resubmitting one last time for 
tonight..

--
Added file: http://bugs.python.org/file27953/python-issue16124.patch

___
Python tracker 

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



[issue16124] fcntl_ioctl still not 100% sane with unsigned longs

2012-11-11 Thread Garrett Cooper

Changes by Garrett Cooper :


Removed file: http://bugs.python.org/file27951/python-issue13500-test.patch

___
Python tracker 

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



[issue16124] fcntl_ioctl still not 100% sane with unsigned longs

2012-11-11 Thread Garrett Cooper

Garrett Cooper added the comment:

Sorry; previous patch is not applicable to this issue. This one is.

--
Added file: http://bugs.python.org/file27952/python-issue16124.patch

___
Python tracker 

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



[issue16124] fcntl_ioctl still not 100% sane with unsigned longs

2012-11-11 Thread Garrett Cooper

Garrett Cooper added the comment:

$ uname -a
FreeBSD bayonetta.local 9.1-PRERELEASE FreeBSD 9.1-PRERELEASE #0 r240836M: Sat 
Sep 22 12:30:11 PDT 2012 
gcooper@bayonetta.local:/usr/obj/store/freebsd/stable/9/sys/BAYONETTA  amd64
$ ./configure --prefix=/scratch/python-bin/3k/
...
$ make all; make install
...
$ /scratch/python-bin/3k/bin/python3 Lib/test/test_ioctl.py
test_ioctl (__main__.IoctlTests) ... ok
test_ioctl_mutate (__main__.IoctlTests) ... ok
test_ioctl_mutate_1024 (__main__.IoctlTests) ... ok
test_ioctl_mutate_2048 (__main__.IoctlTests) ... ok
test_ioctl_signed_unsigned_code_param (__main__.IoctlTests) ... ok

--
Ran 5 tests in 0.003s

OK

--
keywords: +patch
versions: +Python 2.6, Python 3.1, Python 3.2, Python 3.5
Added file: http://bugs.python.org/file27951/python-issue13500-test.patch

___
Python tracker 

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



[issue16427] Faster hash implementation

2012-11-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> Unaligned accesses are not a problem on x86(-64), but they will segfault
(bus error, IIRC) on other architectures such as SPARC, unfortunately.

On x86(-64) this kills performance and makes the optimization be senseless.

> FWIW, on x86/x64 gcc often generates identical code for x = y and
memcpy(x, y, 8).

The code can be identical, but the time will differ significantly for aligned 
and non-aligned data.

--

___
Python tracker 

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



[issue16449] RotatingFileHandler rollover doesn't work on QNX shmem filesystems

2012-11-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What about the "rotator" attribute.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue16427] Faster hash implementation

2012-11-11 Thread Stefan Krah

Stefan Krah added the comment:

FWIW, on x86/x64 gcc often generates identical code for x = y and
memcpy(x, y, 8). See e.g. the PACK_SINGLE and UNPACK_SINGLE macros in
Objects/memoryobject.c.

I didn't look at the patch yet, just an idea.

--

___
Python tracker 

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



[issue16449] RotatingFileHandler rollover doesn't work on QNX shmem filesystems

2012-11-11 Thread Vinay Sajip

Vinay Sajip added the comment:

Thanks for the patch, but I'm closing this as 'wontfix', as per the points made 
by Antoine and David. If you need logging from an embedded system, please 
consider using one of the socket-based logging handlers, if that's feasible in 
the specific situation.

--
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

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



[issue16427] Faster hash implementation

2012-11-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> If a fast hash for bytes/memoryview is desirable, I can write a fast
> robust implementation for nonaligned data.  But this will be more
> cumbersome and a bit slower.

Unaligned accesses are not a problem on x86(-64), but they will segfault
(bus error, IIRC) on other architectures such as SPARC, unfortunately.

(blame RISC for being really too "simplified")

--

___
Python tracker 

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



[issue16124] fcntl_ioctl still not 100% sane with unsigned longs

2012-11-11 Thread Garrett Cooper

Garrett Cooper added the comment:

Yes. Submitting a patch to fix this based on hg master shortly..

--

___
Python tracker 

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



[issue16140] subprocess.Popen the os.close calls in _execute_child can raise an EBADF exception

2012-11-11 Thread Mark Dickinson

Mark Dickinson added the comment:

Adding 'del p' at the end of the test method fixes this for me.

--

___
Python tracker 

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



[issue16140] subprocess.Popen the os.close calls in _execute_child can raise an EBADF exception

2012-11-11 Thread Mark Dickinson

Mark Dickinson added the comment:

test_gc and test_csv seem to be failing on some of the buildbots as a result of 
these checkins.  It looks as though the new test_subprocess test creates some 
uncollectable garbage.

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue14621] Hash function is not randomized properly

2012-11-11 Thread Giovanni Bajo

Giovanni Bajo added the comment:

Il giorno 11/nov/2012, alle ore 05:56, Chris Rebert  ha 
scritto:

> 
> Chris Rebert added the comment:
> 
> What about CityHash? (http://code.google.com/p/cityhash/ ; unofficial C port: 
> http://code.google.com/p/cityhash-c/ )
> It's good enough for Google...

It's good enough for Google in a context that does not require protection 
against collision attacks. If you have a look at SipHash' page, you will find a 
program to generate collisions to CityHash.
-- 
Giovanni Bajo

My Blog: http://giovanni.bajo.it

--

___
Python tracker 

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



[issue14631] Instance methods and WeakRefs don't mix.

2012-11-11 Thread Mark Dickinson

Changes by Mark Dickinson :


--
versions: +Python 3.4 -Python 3.3

___
Python tracker 

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



[issue14631] Instance methods and WeakRefs don't mix.

2012-11-11 Thread Simon Feltman

Simon Feltman added the comment:

Just a note this is also referred to as a "WeakMethod" by some folks (so this 
ticket shows up in those searches). See also:
http://bugs.python.org/issue813299
http://bugs.python.org/issue7464
http://bugs.python.org/issue16452

--

___
Python tracker 

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



[issue16452] Add support for weak reference to bound methods

2012-11-11 Thread Mark Dickinson

Changes by Mark Dickinson :


--
superseder:  -> Instance methods and WeakRefs don't mix.

___
Python tracker 

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



[issue14631] Instance methods and WeakRefs don't mix.

2012-11-11 Thread Mark Dickinson

Mark Dickinson added the comment:

Adding some useful links from Simon Feltman in issue 16452.

See also:
http://bugs.python.org/issue813299
http://bugs.python.org/issue7464

This is the recipes:
http://code.activestate.com/recipes/81253/
http://mindtrove.info/python-weak-references/

--
nosy: +sfeltman

___
Python tracker 

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



[issue5784] raw deflate format and zlib module

2012-11-11 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
stage:  -> needs patch
versions: +Python 3.4 -Python 3.1

___
Python tracker 

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



[issue14621] Hash function is not randomized properly

2012-11-11 Thread STINNER Victor

STINNER Victor added the comment:

Did qomeone start to write a PEP?
Le 11 nov. 2012 05:56, "Chris Rebert"  a écrit :

>
> Chris Rebert added the comment:
>
> What about CityHash? (http://code.google.com/p/cityhash/ ; unofficial C
> port: http://code.google.com/p/cityhash-c/ )
> It's good enough for Google...
>
> --
> nosy: +cvrebert
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue16452] Add support for weak reference to bound methods

2012-11-11 Thread Simon Feltman

Simon Feltman added the comment:

Indeed a duplicate of: http://bugs.python.org/issue14631

--
resolution:  -> duplicate
status: open -> closed

___
Python tracker 

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



[issue16140] subprocess.Popen the os.close calls in _execute_child can raise an EBADF exception

2012-11-11 Thread Gregory P. Smith

Changes by Gregory P. Smith :


--
stage: test needed -> committed/rejected

___
Python tracker 

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



  1   2   >