[issue18909] Segfaults on win-amd64 due to corrupt pointer to Tkapp_Interp

2013-09-05 Thread STINNER Victor

STINNER Victor added the comment:

2013/9/5 Christoph Gohlke :
> I am aware of two 3rd party C extensions that use the value of interpaddr():
>
> https://github.com/python-imaging/Pillow/blob/master/_imagingtk.c#L40
> https://github.com/matplotlib/matplotlib/blob/master/src/_tkagg.cpp#L233
>
> Both parse the PyObject returned by interpaddr() into a Py_ssize_t variable 
> using `PyArg_ParseTuple(PyObject*, "n", &Py_ssize_t)` and then cast the 
> Py_ssize_t variable to a (TkappObject*).

Ok, the code looks correct. Py_ssize_t is supposed to have the same
size than a void*.

> Can a PyLong with a value > 3**31 be parsed into a Py_ssize_t on 32 bit 
> platforms? Could this become a problem on systems where 32 bit processes can 
> address more than 2 GB?

No, values >= 2^31 will raise an error.

On Linux, addresses with the 32th bit set (range
0x8000-0x) are reserved for the Linux kernel. So
interpaddr() should be in the range 0x-0x7fff.

If the code worked before my patch, there is not reason for not
working with the patch. My patch only has an impact on one specific
platform: Windows 64 bit, the only platform where sizeof(long) <
sizeof(void*) (on all other platforms supported by Python,
sizeof(void*) == sizeof(long)).

--

___
Python tracker 

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



[issue18898] Apply the setobject optimizations to dictionaries

2013-09-05 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
keywords: +patch
Added file: http://bugs.python.org/file31597/noincref.diff

___
Python tracker 

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



[issue18808] Thread.join returns before PyThreadState is destroyed

2013-09-05 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> It would be much nicer to have an approach that worked for all thread users, 
> not just threading.Thread users.  For example, a user can easily (well,
> plausibly) get into the same kinds of troubles here by calling
> _thread.start_new_thread() directly, then waiting for their threads "to end" 
> before letting the program finish - they have no idea either when their
> tstates are actually destroyed.

The _thread module is a private API these days, I wouldn't worry too much about 
that. Are there reasons *not* to use the threading module (except CPython 
bootstrap issues that normal users should have no bother about)? Also, how 
would they wait for the thread to end, except by triggering their own Event 
object?

> So the new `waittime` _may_ be negative, in which case we've already timed
> out (but passing a negative `waittime` to acquire() means "wait as long as 
> it takes to acquire the lock").  So this block should return if waittime < 0.

Thanks, good point :-o

As for the is_alive() method, mmh, ok, it needs to be tweaked too. That will 
make the patch more interesting.

--

___
Python tracker 

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



[issue16853] add a Selector to the select module

2013-09-05 Thread Charles-François Natali

Charles-François Natali added the comment:

> Giampaolo Rodola' added the comment:
>
> I have realized just now that at least epoll() and kqueue() selectors could 
> take advantage and define their own modify() method (there was even a TODO I 
> totally missed).

As a side note, in the general case, there's more than a performance
optimization: the problem with unregister() + register() vs a real
modify (e.g. EPOLL_CTL_MOD) is that it's subject to a race condition,
if an event fires during the short window where the FD isn't
registered anymore.

But since selectors use level-triggered notification, that's not an
issue: I'll probably add a comment in the code explaining why it's
safe, though.

--

___
Python tracker 

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



[issue18879] tempfile.NamedTemporaryFile can close the file too early, if not assigning to a variable

2013-09-05 Thread Jakub Stasiak

Jakub Stasiak added the comment:

I don't see an obvious way of solving that. One thing I could think of is 
creating a wrapper for file method being returned from __getattr__ that holds 
reference to _TemporaryFileWrapper instance until the method gets called, 
please find a patch attached.

--
keywords: +patch
nosy: +jstasiak
Added file: http://bugs.python.org/file31598/tempfile.patch

___
Python tracker 

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



[issue18829] csv produces confusing error message when passed a non-string delimiter

2013-09-05 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Attached the patch to accomodate Ezio Melotti's request. The patch now have two 
separate errors for "wrong type" and "right type, wrong length".

Don't we break compatibility by changing the type of exception from TypeError 
to ValueError?

--
Added file: 
http://bugs.python.org/file31599/fix_error_message_reader_csv_alternative_1_v3.patch

___
Python tracker 

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



[issue1584] Mac OS X: building with X11 Tkinter

2013-09-05 Thread Ned Deily

Ned Deily added the comment:

Here's a patch. It is simple-minded but I think it should be powerful enough 
for advanced users to build with non-default Tcl and Tk libraries without 
having to modify the source.  It adds two new options to configure; if used, 
both must be specified:

  ./configure \
  --with-tcltk-includes="-I/opt/local/include" \
  --with-tcltk-libs="-L/opt/local/lib -ltcl8.5 -ltk8.5"

The values are passed into the top-level setup.py and override the default 
searches and values for include_dirs and libraries when building _tkinter.so.

In addition, the options can be overridden with make.  This can be useful when 
testing tkinter with different versions of Tcl/Tk:

   ./configure
   make
   make test  # test with platform default Tcl/Tk
   ( cd ./build/lib.xx && mv _tkinter.so _tkinter.so.default )
   make \
   TCLTK_INCLUDES="-I/opt/local/include" \
   TCLTK_LIBS="-L/opt/local/lib -ltcl8.6 -ltk8.6"
   make test  # test with another version of Tcl/Tk

I have some more testing to do on other platforms but, unless there are major 
objections, I intend to commit this soon for use with Issue15663.

--
components:  -Macintosh
keywords: +patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file31600/issue1584_rev0.patch

___
Python tracker 

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



[issue18930] os.spawnXX functions terminates process if second argument is empty list

2013-09-05 Thread Stefan Schukat

New submission from Stefan Schukat:

If os.spawnv or os.spawnve  is called with an empty second argument the process 
terminates in release builds under Windows. This is simple to reproduce:

>>> import os
>>> nPath = os.path.join(os.environ["windir"], "notepad.exe")
>>> os.spawnv(os.P_NOWAIT, nPath, []) # or os.spawnv(os.P_NOWAIT, nPath, [], {})

This has the same cause as the bug reported for execv 
http://bugs.python.org/issue1039 and could be fixed in the same way.

--
components: Interpreter Core
messages: 196988
nosy: SSchukat
priority: normal
severity: normal
status: open
title: os.spawnXX functions terminates process if second argument is empty list
versions: Python 2.7

___
Python tracker 

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



[issue18931] new selectors module should support devpoll on Solaris

2013-09-05 Thread Giampaolo Rodola'

New submission from Giampaolo Rodola':

This is a follow up of issue 16853.
I will try to see whether I can come up with a patch later today.

--
messages: 196989
nosy: christian.heimes, felipecruz, giampaolo.rodola, gvanrossum, haypo, 
meador.inge, neologix, pitrou, python-dev, rosslagerwall, sbt
priority: normal
severity: normal
status: open
title: new selectors module should support devpoll on Solaris
versions: Python 3.4

___
Python tracker 

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



[issue18932] selectors and modify()

2013-09-05 Thread Giampaolo Rodola'

New submission from Giampaolo Rodola':

This is a follow up of issue 16853 (see comment 
http://bugs.python.org/issue16853#msg196984).

--
messages: 196990
nosy: christian.heimes, felipecruz, giampaolo.rodola, gvanrossum, haypo, 
meador.inge, neologix, pitrou, python-dev, rosslagerwall, sbt
priority: normal
severity: normal
status: open
title: selectors and modify()
versions: Python 3.4

___
Python tracker 

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



[issue18849] Failure to try another name for tempfile when directory with chosen name exists on windows

2013-09-05 Thread Vlad Shcherbina

Changes by Vlad Shcherbina :


Removed file: 
http://bugs.python.org/file31580/temp_dir_exists_retry_test_27.patch

___
Python tracker 

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



[issue18849] Failure to try another name for tempfile when directory with chosen name exists on windows

2013-09-05 Thread Vlad Shcherbina

Changes by Vlad Shcherbina :


Removed file: http://bugs.python.org/file31573/temp_dir_exists_retry_27.patch

___
Python tracker 

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



[issue18849] Failure to try another name for tempfile when directory with chosen name exists on windows

2013-09-05 Thread Vlad Shcherbina

Changes by Vlad Shcherbina :


Removed file: http://bugs.python.org/file31574/temp_dir_exists_retry_33_34.patch

___
Python tracker 

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



[issue18849] Failure to try another name for tempfile when directory with chosen name exists on windows

2013-09-05 Thread Vlad Shcherbina

Changes by Vlad Shcherbina :


Removed file: 
http://bugs.python.org/file31579/temp_dir_exists_retry_test_33_34.patch

___
Python tracker 

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



[issue18849] Failure to try another name for tempfile when directory with chosen name exists on windows

2013-09-05 Thread Vlad Shcherbina

Changes by Vlad Shcherbina :


Added file: 
http://bugs.python.org/file31601/temp_dir_exists_retry_test_33_34.patch

___
Python tracker 

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



[issue18879] tempfile.NamedTemporaryFile can close the file too early, if not assigning to a variable

2013-09-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yet one way is just remove __del__() and monkey-patch underlied file.

--
Added file: http://bugs.python.org/file31603/tempfile_simplify.patch

___
Python tracker 

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



[issue18849] Failure to try another name for tempfile when directory with chosen name exists on windows

2013-09-05 Thread Vlad Shcherbina

Changes by Vlad Shcherbina :


Added file: http://bugs.python.org/file31605/temp_dir_exists_retry_27.patch

___
Python tracker 

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



[issue18849] Failure to try another name for tempfile when directory with chosen name exists on windows

2013-09-05 Thread Vlad Shcherbina

Changes by Vlad Shcherbina :


Added file: http://bugs.python.org/file31604/temp_dir_exists_retry_test_27.patch

___
Python tracker 

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



[issue18879] tempfile.NamedTemporaryFile can close the file too early, if not assigning to a variable

2013-09-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
stage:  -> patch review

___
Python tracker 

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



[issue18849] Failure to try another name for tempfile when directory with chosen name exists on windows

2013-09-05 Thread Vlad Shcherbina

Changes by Vlad Shcherbina :


Added file: http://bugs.python.org/file31602/temp_dir_exists_retry_33_34.patch

___
Python tracker 

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



[issue18849] Failure to try another name for tempfile when directory with chosen name exists on windows

2013-09-05 Thread Vlad Shcherbina

Changes by Vlad Shcherbina :


Removed file: 
http://bugs.python.org/file31604/temp_dir_exists_retry_test_27.patch

___
Python tracker 

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



[issue18849] Failure to try another name for tempfile when directory with chosen name exists on windows

2013-09-05 Thread Vlad Shcherbina

Changes by Vlad Shcherbina :


Removed file: http://bugs.python.org/file31605/temp_dir_exists_retry_27.patch

___
Python tracker 

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



[issue18849] Failure to try another name for tempfile when directory with chosen name exists on windows

2013-09-05 Thread Vlad Shcherbina

Changes by Vlad Shcherbina :


Removed file: 
http://bugs.python.org/file31601/temp_dir_exists_retry_test_33_34.patch

___
Python tracker 

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



[issue18849] Failure to try another name for tempfile when directory with chosen name exists on windows

2013-09-05 Thread Vlad Shcherbina

Changes by Vlad Shcherbina :


Removed file: http://bugs.python.org/file31602/temp_dir_exists_retry_33_34.patch

___
Python tracker 

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



[issue18849] Failure to try another name for tempfile when directory with chosen name exists on windows

2013-09-05 Thread Vlad Shcherbina

Changes by Vlad Shcherbina :


Added file: http://bugs.python.org/file31607/temp_dir_exists_retry_33_34.patch

___
Python tracker 

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



[issue18849] Failure to try another name for tempfile when directory with chosen name exists on windows

2013-09-05 Thread Vlad Shcherbina

Changes by Vlad Shcherbina :


Added file: 
http://bugs.python.org/file31606/temp_dir_exists_retry_test_33_34.patch

___
Python tracker 

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



[issue18849] Failure to try another name for tempfile when directory with chosen name exists on windows

2013-09-05 Thread Vlad Shcherbina

Changes by Vlad Shcherbina :


Added file: http://bugs.python.org/file31608/temp_dir_exists_retry_test_27.patch

___
Python tracker 

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



[issue18849] Failure to try another name for tempfile when directory with chosen name exists on windows

2013-09-05 Thread Vlad Shcherbina

Changes by Vlad Shcherbina :


Added file: http://bugs.python.org/file31609/temp_dir_exists_retry_27.patch

___
Python tracker 

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



[issue18879] tempfile.NamedTemporaryFile can close the file too early, if not assigning to a variable

2013-09-05 Thread Meador Inge

Meador Inge added the comment:

I was experimenting with something similar to what Jakub has.  Rebinding the 
call the the wrapper seems like a simple and clean way to do it.  Although, I 
wasn't absolutely sure whether this approach covers all cases.

--

___
Python tracker 

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



[issue13153] IDLE crashes when pasting non-BMP unicode char on Py3

2013-09-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Previous patch has a regression, it breaks decoding NUL which Tcl encodes in 
"modified" UTF-8 as \xc0\x80. However this part of code already broken, because 
it handles only singular NUL and not a NUL embedded in larger string.

Here is a patch which also fixes decoding NULs from "modified" UTF-8.

--
Added file: http://bugs.python.org/file31610/tkinter_string_conv_3.patch

___
Python tracker 

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



[issue13153] IDLE crashes when pasting non-BMP unicode char on Py3

2013-09-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Removed file: http://bugs.python.org/file31185/tkinter_string_conv.patch

___
Python tracker 

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



[issue13153] IDLE crashes when pasting non-BMP unicode char on Py3

2013-09-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Removed file: http://bugs.python.org/file31592/tkinter_string_conv_2.patch

___
Python tracker 

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



[issue18923] Use the new selectors module in the subprocess module

2013-09-05 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
nosy: +giampaolo.rodola

___
Python tracker 

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



[issue18856] Added test coverage for calendar print functions

2013-09-05 Thread Madison May

Madison May added the comment:

At Ezio suggestion, I've updated the patch to use 
test.support.captured_stdout().

--
Added file: http://bugs.python.org/file31611/calendar_print_v2.diff

___
Python tracker 

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



[issue18923] Use the new selectors module in the subprocess module

2013-09-05 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

It's likely that asyncore won't be able to take any practical advantage from 
this integration.

To say one, epoll()/kqueue() pollers won't bring any speedup over 
select()/poll() because of how asyncore.loop() function is implemented (see 
http://bugs.python.org/issue6692#msg103628 and 
http://bugs.python.org/issue11273).

Also, the new selectors module only takes read and write events into account, 
whereas asyncore explicitly closes dispatcher in case of disconnection events 
(POLLOUT, etc).

In summary I'd say it's a lot wiser to leave asyncore alone and consider it 
frozen.

--

___
Python tracker 

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



[issue16853] add a Selector to the select module

2013-09-05 Thread Richard Oudkerk

Richard Oudkerk added the comment:

On 05/09/2013 9:28am, Charles-François Natali wrote:
> As a side note, in the general case, there's more than a performance
> optimization: the problem with unregister() + register() vs a real
> modify (e.g. EPOLL_CTL_MOD) is that it's subject to a race condition,
> if an event fires during the short window where the FD isn't
> registered anymore.

Even with edge-triggered notification, doesn't registering an fd check 
the current readiness:

 >>> import os, select
 >>> r, w = os.pipe()
 >>> p = select.epoll()
 >>> os.write(w, b"h")
 >>> p.register(r, select.EPOLLIN | select.EPOLLET)
 >>> p.poll(0)
[(3, 1)]
 >>> p.poll(0)
[]

Otherwise it would be very difficult to edge-triggered notification.

--

___
Python tracker 

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



[issue18829] csv produces confusing error message when passed a non-string delimiter

2013-09-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

A comment in csv.py says about compatibility with 2.3! After adding ValueError 
to the list of catched exceptions we can keep this compatibility for future 
generations. Here is a patch. I also have resorted the tests a little.

--
Added file: 
http://bugs.python.org/file31612/fix_error_message_reader_csv_alternative_1_v4.patch

___
Python tracker 

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



[issue18878] Add support of the 'with' statement to sunau.open.

2013-09-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a62f59667c9e by Serhiy Storchaka in branch 'default':
Issue #18878: sunau.open now supports the context manager protocol.  Based on
http://hg.python.org/cpython/rev/a62f59667c9e

--
nosy: +python-dev

___
Python tracker 

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



[issue18922] Output versions of scripts to stdout

2013-09-05 Thread Nicola Palumbo

Changes by Nicola Palumbo :


Removed file: http://bugs.python.org/file31590/issue18922.patch

___
Python tracker 

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



[issue18922] Output versions of scripts to stdout

2013-09-05 Thread Nicola Palumbo

Changes by Nicola Palumbo :


Added file: http://bugs.python.org/file31613/issue18922.patch

___
Python tracker 

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



[issue18933] Add link to source code in logging documentation

2013-09-05 Thread Jonathan Frere

New submission from Jonathan Frere:

The logging module documentation is probably best accompanied by the source 
that it is meant to be documenting.  Could a link to either the package 
directory (http://hg.python.org/cpython/file/2.7/Lib/logging/) or the 
__init__.py file in that directory 
(http://hg.python.org/cpython/file/2.7/Lib/logging/__init__.py), I'd argue the 
__init__.py file.

--
assignee: docs@python
components: Documentation, Library (Lib)
messages: 197000
nosy: Johz, docs@python, vinay.sajip
priority: normal
severity: normal
status: open
title: Add link to source code in logging documentation
type: enhancement

___
Python tracker 

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



[issue18709] SSL module fails to handle NULL bytes inside subjectAltNames general names (CVE-2013-4238)

2013-09-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 90040e560527 by Christian Heimes in branch '3.3':
Issue #18709: GCC 4.6 complains that 'v' may be used uninitialized in 
GEN_EMAIL/GEN_URI/GEN_DNS case
http://hg.python.org/cpython/rev/90040e560527

New changeset 4e93f32176fb by Christian Heimes in branch 'default':
Issue #18709: GCC 4.6 complains that 'v' may be used uninitialized in 
GEN_EMAIL/GEN_URI/GEN_DNS case
http://hg.python.org/cpython/rev/4e93f32176fb

New changeset 07ee48ce4513 by Christian Heimes in branch '2.6':
Issue #18709: GCC 4.6 complains that 'v' may be used uninitialized in 
GEN_EMAIL/GEN_URI/GEN_DNS case
http://hg.python.org/cpython/rev/07ee48ce4513

New changeset a7d5b86ffb95 by Christian Heimes in branch '2.7':
Issue #18709: GCC 4.6 complains that 'v' may be used uninitialized in 
GEN_EMAIL/GEN_URI/GEN_DNS case
http://hg.python.org/cpython/rev/a7d5b86ffb95

--

___
Python tracker 

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



[issue18830] Remove duplicates from a result of getclasstree()

2013-09-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 39d0dfa5808c by Serhiy Storchaka in branch '3.3':
Issue #18830: inspect.getclasstree() no more produces duplicated entries even
http://hg.python.org/cpython/rev/39d0dfa5808c

New changeset 86ab7b7c173e by Serhiy Storchaka in branch 'default':
Issue #18830: inspect.getclasstree() no more produces duplicated entries even
http://hg.python.org/cpython/rev/86ab7b7c173e

New changeset 408165aced01 by Serhiy Storchaka in branch '2.7':
Issue #18830: inspect.getclasstree() no more produces duplicated entries even
http://hg.python.org/cpython/rev/408165aced01

--
nosy: +python-dev

___
Python tracker 

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



[issue18878] Add support of the 'with' statement to sunau.open.

2013-09-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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

___
Python tracker 

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



[issue18830] Remove duplicates from a result of getclasstree()

2013-09-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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

___
Python tracker 

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



[issue18829] csv produces confusing error message when passed a non-string delimiter

2013-09-05 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Same as fix_error_message_reader_csv_alternative_1_v4.patch (by Serhiy), but I 
removed unused variables in the test.

--
Added file: 
http://bugs.python.org/file31614/fix_error_message_reader_csv_alternative_1_v5.patch

___
Python tracker 

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



[issue18922] Output versions of scripts to stdout

2013-09-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e81699a6390c by Serhiy Storchaka in branch 'default':
Issue #18922: Now The Lib/smtpd.py and Tools/i18n/msgfmt.py scripts write
http://hg.python.org/cpython/rev/e81699a6390c

--
nosy: +python-dev

___
Python tracker 

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



[issue18922] Output versions of scripts to stdout

2013-09-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Nicola and Berker.

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

___
Python tracker 

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



[issue18672] Fix format specifiers for debug output in _sre.c

2013-09-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 99310e5e1b1c by Serhiy Storchaka in branch '3.3':
Issue #18672: Fixed format specifiers for Py_ssize_t in debugging output in
http://hg.python.org/cpython/rev/99310e5e1b1c

New changeset c41c68a18bb6 by Serhiy Storchaka in branch 'default':
Issue #18672: Fixed format specifiers for Py_ssize_t in debugging output in
http://hg.python.org/cpython/rev/c41c68a18bb6

New changeset 603b4d593758 by Serhiy Storchaka in branch '2.7':
Issue #18672: Fixed format specifiers for Py_ssize_t in debugging output in
http://hg.python.org/cpython/rev/603b4d593758

--
nosy: +python-dev

___
Python tracker 

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



[issue18672] Fix format specifiers for debug output in _sre.c

2013-09-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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

___
Python tracker 

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



[issue18829] csv produces confusing error message when passed a non-string delimiter

2013-09-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I rather prefer adding new tests.

--
Added file: 
http://bugs.python.org/file31615/fix_error_message_reader_csv_alternative_1_v6.patch

___
Python tracker 

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



[issue18933] Add link to source code in logging documentation

2013-09-05 Thread Vinay Sajip

Vinay Sajip added the comment:

Why for the logging module in particular? This isn't the norm for stdlib 
packages, AFAIK.

The logging documentation (both tutorial and reference) is supposed to stand on 
its own, and in general I don't expect documentation users to (have to) look at 
the source to understand how to use logging.

If you think particular aspects of the documentation need clarifying, then 
please indicate what they are and suggest what sort of improvements you think 
are in order.

--

___
Python tracker 

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



[issue12704] Language Reference: Clarify behaviour of yield when generator is not resumed

2013-09-05 Thread Eli Bendersky

Eli Bendersky added the comment:

On Wed, Sep 4, 2013 at 5:27 PM, Nikolaus Rath wrote:

>
> Nikolaus Rath added the comment:
>
> On 09/04/2013 06:03 AM, Eli Bendersky wrote:
> > Why guess... did you try it in the code?
>
> I don't follow... why guess what? And try what in code?
>

I was referring to this part of the original report:

"""
This strongly suggests that the last-executed yield statement will raise an
exception if the generator is closed. If this is the case, it would be
great if the documentation could be extended to say what exception is
raised.

If this is not the case, it would be great if whatever magic is happening
could be documented as well.
"""

If this is the case, if this is not the case... I was just saying that you
can provide some sample code in the issue that demonstrates what *actually*
happens and whether it's not explained well enough in the documentation.

--

___
Python tracker 

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



[issue18924] Enum members are easily replaced

2013-09-05 Thread Eli Bendersky

Eli Bendersky added the comment:

On Wed, Sep 4, 2013 at 3:05 PM, Ethan Furman  wrote:

>
> Ethan Furman added the comment:
>
> Yes, as a matter of fact:
>
> --> Test.this
> 
> --> Test.this = 'other'
> --> Test.this
> 'other'
> --> Test('that')
> 
> --> list(Test)
> []
>
> As you can see, the Test Enum becomes inconsistent if this is allowed.
>

Again, this is fully in accordance to the Python philosophy of allowing
monkey-patching in the first place. There's any number of way
monkey-patching objects can lead to inconsistent states, because the
internal invariants are only guaranteed to be preserved through public,
documented interfaces.

I'm still -1.

--

___
Python tracker 

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



[issue18935] test_regrtest.test_timeout failure

2013-09-05 Thread Charles-François Natali

New submission from Charles-François Natali:

http://buildbot.python.org/all/builders/AMD64 Fedora without threads 
3.x/builds/5074/steps/test/logs/stdio
"""
==
FAIL: test_timeout (test.test_regrtest.ParseArgsTestCase)
--
Traceback (most recent call last):
  File 
"/home/buildbot/buildarea/3.x.krah-fedora/build/Lib/test/test_regrtest.py", 
line 30, in test_timeout
self.assertEqual(ns.timeout, 4.2)
AssertionError: None != 4.2
"""

That's because the "--timeout" isn't supported if Python is built 
--without-threads.

Possible patch attached.

--
components: Tests
files: test_timeout.diff
keywords: needs review, patch
messages: 197013
nosy: haypo, neologix, pitrou
priority: normal
severity: normal
stage: patch review
status: open
title: test_regrtest.test_timeout failure
type: behavior
versions: Python 3.4
Added file: http://bugs.python.org/file31617/test_timeout.diff

___
Python tracker 

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



[issue2259] Poor support other than 44.1khz, 16bit audio files?

2013-09-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka
versions: +Python 3.3, Python 3.4 -Python 2.6, Python 3.0, Python 3.1

___
Python tracker 

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



[issue18934] multiprocessing: use selectors module

2013-09-05 Thread Charles-François Natali

New submission from Charles-François Natali:

Here's a patch.

--
components: Library (Lib)
files: selectors_multiprocessing.diff
keywords: needs review, patch
messages: 197012
nosy: neologix, sbt
priority: normal
severity: normal
stage: patch review
status: open
title: multiprocessing: use selectors module
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file31616/selectors_multiprocessing.diff

___
Python tracker 

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



[issue1575020] Request wave support > 16 bit samples

2013-09-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue1575020] Request wave support > 16 bit samples

2013-09-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
versions: +Python 3.4 -Python 3.2

___
Python tracker 

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



[issue16853] add a Selector to the select module

2013-09-05 Thread Charles-François Natali

Charles-François Natali added the comment:

> Richard Oudkerk added the comment:
>
> Even with edge-triggered notification, doesn't registering an fd check
> the current readiness:

Hum...
Looks like I forgot to turn my brain on this morning :-)

--

___
Python tracker 

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



[issue18933] Add link to source code in logging documentation

2013-09-05 Thread Jonathan Frere

Jonathan Frere added the comment:

Well, if all the modules could link back to source code, that would be ideal, 
it's just the logging happens to be the one that I keep coming back to.  
Encouraging users to read the source will hopefully help people understand the 
modules they're using conceptually, and also give people more sample code to 
use.

That said, a number of modules link back to the source, particularly small 
single-file implementations of things, such as glob, fnmatch, string, pprint, 
repr, types, UserDict, weakref, Queue, sched, to name a few that I randomly 
opened.

Why logging in particular?  Well, as I said, I keep on coming back to it, so at 
least one Python user feels this need.  Secondly, it's a module that perhaps 
isn't quite as conceptually clear as others (hence the 'alternatives' that 
abound).  Thirdly, parts of the module such as logging.handlers will be 
directly used as templates by many developers.

--

___
Python tracker 

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



[issue18934] multiprocessing: use selectors module

2013-09-05 Thread Richard Oudkerk

Richard Oudkerk added the comment:

LGTM.

But I would move "import selectors" in multiprocessing.connection to just 
before the definition of wait() for Unix.  It is not needed on Windows and 
unnecessary imports slow down start up of new processes.

--

___
Python tracker 

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



[issue18934] multiprocessing: use selectors module

2013-09-05 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
nosy: +giampaolo.rodola

___
Python tracker 

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



[issue18879] tempfile.NamedTemporaryFile can close the file too early, if not assigning to a variable

2013-09-05 Thread Meador Inge

Meador Inge added the comment:

The monkey-patched version breaks the auto-close on __del__ feature:

[meadori@li589-207 cpython]$ ./python 
Python 3.4.0a1+ (default:c41c68a18bb6, Sep  5 2013, 17:51:03) 
[GCC 4.7.2 20120921 (Red Hat 4.7.2-2)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tempfile
>>> tempfile.NamedTemporaryFile(dir=".",delete=False).write(b"hello")
__main__:1: ResourceWarning: unclosed file <_io.BufferedRandom name=4>
5

Also run the test suite with '-R :' and you will see tons of resource warnings.

Breaking auto-close is because now unlinking *and* closing are being guarded by 
'delete'.  Even if that is fixed you still run into resource leak problems.  
Looks like the monkey-patching introduces a reference cycle.

The wrapper binding approach works fine in all the tests I did.

--

___
Python tracker 

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



[issue18931] new selectors module should support devpoll on Solaris

2013-09-05 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

Patch is in attachment.

--
keywords: +patch
Added file: http://bugs.python.org/file31618/devpoll.patch

___
Python tracker 

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



[issue12866] Add support for 24-bit samples in the audioop module

2013-09-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Unfortunately Peter's file is not ready for release. It adds support of 24-bit 
samples only to the part of functions, it works only on little-endian platform, 
it should crash on platforms which not allows non-aligned access, and I suspect 
it can overflow output buffers. And it doesn't provided in diff format.

Here is other patch which adds support for 24-bit samples. It also cleanup and 
simplify the code of audioop.c so that its total size is even decreased. Patch 
includes test and documentation changes.

--
components: +Extension Modules
keywords: +patch
nosy: +r.david.murray
stage:  -> patch review
title: Want to submit our Audioop.c patch for 24bit audio -> Add support for 
24-bit samples in the audioop module
Added file: http://bugs.python.org/file31619/audioop_24bit.patch

___
Python tracker 

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



[issue18879] tempfile.NamedTemporaryFile can close the file too early, if not assigning to a variable

2013-09-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> The monkey-patched version breaks the auto-close on __del__ feature:

Files were closed. Just with a warning. I consider this as an enhancement. If 
you don't close file explicitly you will get a leak on non-refcounted Python 
implementations. It's true for both ordinal files so tempfiles. Perhaps we 
should add a warning in any __del__ method (even if we will commit Jakub's 
patch, this way LGTM too).

--

___
Python tracker 

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



[issue1575020] Request wave support > 16 bit samples

2013-09-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
dependencies: +Add support for 24-bit samples in the audioop module

___
Python tracker 

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



[issue2259] Poor support other than 44.1khz, 16bit audio files?

2013-09-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
dependencies: +Add support for 24-bit samples in the audioop module

___
Python tracker 

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



[issue18937] add unittest assertion for logging

2013-09-05 Thread Antoine Pitrou

New submission from Antoine Pitrou:

It is sometimes useful to check for the log messages emitted by some piece of 
code (especially a library). Would it be a good idea to add a dedicated 
assertion method for that? I would propose the following API:


with self.assertLogging("logger.name", level="WARN") as cm:
...

The `cm` context manager could give access to all the log records and formatted 
output lines for the given logger name (and children) and at least the given 
logging level. I have something like that here, except not with a dedicated 
assertion method:
https://bitbucket.org/optiflowsrd/obelus/src/c2a2f78068123264adde8cc3ece4889c61773f00/obelus/test/__init__.py?at=default#cl-20

--
components: Library (Lib)
messages: 197022
nosy: ezio.melotti, michael.foord, pitrou, vinay.sajip
priority: normal
severity: normal
status: open
title: add unittest assertion for logging
type: enhancement
versions: Python 3.4

___
Python tracker 

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



[issue18909] Segfaults on win-amd64 due to corrupt pointer to Tkapp_Interp

2013-09-05 Thread Christoph Gohlke

Christoph Gohlke added the comment:

Sorry, of course I meant > 2**31. Thank you very much for your review!

--

___
Python tracker 

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



[issue18936] getopt chokes on unicode option names

2013-09-05 Thread Jason R. Coombs

New submission from Jason R. Coombs:

Today I encountered a bug where I was using a Distutils.Command subclass, which 
uses getopt for option parsing. The implementation is here: 
https://bitbucket.org/jaraco/jaraco.packaging/src/2.2/jaraco/packaging/depends.py?at=default

Around line 59, the options are defined, but because the syntax is Python 3 
style with unicode literals, under Python 2.7, those get created as unicode 
objects.

When I invoke that Command under Python 2.7, I get this error:

Traceback (most recent call last):
  File "setup.py", line 160, in 
setup(**setup_params)
  File "/usr/lib/python2.7/distutils/core.py", line 138, in setup
ok = dist.parse_command_line()
  File "build/bdist.linux-x86_64/egg/setuptools/dist.py", line 250, in 
parse_command_line
  File "/usr/lib/python2.7/distutils/dist.py", line 467, in parse_command_line
args = self._parse_command_opts(parser, args)
  File "build/bdist.linux-x86_64/egg/setuptools/dist.py", line 533, in 
_parse_command_opts
  File "/usr/lib/python2.7/distutils/dist.py", line 564, in _parse_command_opts
(args, opts) = parser.getopt(args[1:])
  File "/usr/lib/python2.7/distutils/fancy_getopt.py", line 253, in getopt
self._grok_option_table()
  File "/usr/lib/python2.7/distutils/fancy_getopt.py", line 171, in 
_grok_option_table
"must be a string of length >= 2") % long
distutils.errors.DistutilsGetoptError: invalid long option 'requirement=': must 
be a string of length >= 2

That error is raised because 'requirement=' is a Unicode, but the test in 
fancy_getopt is isinstance(opt, str).

I can work around the issue by wrapping all of the options in str() calls, 
which leaves them unchanged on Python 3 and downcasts them to strings on Python 
2, but that's not pretty.

I suggest that fancy_getopt should either include 'unicode' in the isinstance 
test or (if unicode values really aren't supported), encode unicode values 
first.

--
components: Library (Lib)
messages: 197020
nosy: jason.coombs
priority: low
severity: normal
status: open
title: getopt chokes on unicode option names
versions: Python 2.7

___
Python tracker 

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



[issue18934] multiprocessing: use selectors module

2013-09-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 81f0c6358a5f by Charles-François Natali in branch 'default':
Issue #18934: multiprocessing: use selectors module.
http://hg.python.org/cpython/rev/81f0c6358a5f

--
nosy: +python-dev

___
Python tracker 

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



[issue18938] Prepend Is Not A Word

2013-09-05 Thread Benjamin Peterson

Benjamin Peterson added the comment:

It is however a very common programming term.

--
nosy: +benjamin.peterson
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue18937] add unittest assertion for logging

2013-09-05 Thread R. David Murray

R. David Murray added the comment:

I have project in which that would be useful, so +1 from me for the general 
concept.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue18938] Prepend Is Not A Word

2013-09-05 Thread Johnny Boy

New submission from Johnny Boy:

If you do a custom install on Windows and click "Add python.exe to Path" the 
text below says "Prepend c:\Python33\ to the system Path variable"

Prepend is not a word!
The word you are looking for is Prefix.
http://encyclopedia2.thefreedictionary.com/prepend
"
Although it sounds correct, prepend is not an English word. It was created to 
sound like the opposite of "append," which means to add to the end. The correct 
English word is "prefix;"
"

--
components: Installation
messages: 197025
nosy: opticyclic
priority: normal
severity: normal
status: open
title: Prepend Is Not A Word
versions: Python 3.3

___
Python tracker 

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



[issue18934] multiprocessing: use selectors module

2013-09-05 Thread Charles-François Natali

Charles-François Natali added the comment:

The test is failing on some (unstable) buildbots:
http://buildbot.python.org/all/builders/AMD64%20Solaris%2011%20%5BSB%5D%203.x/builds/1598/steps/test/logs/stdio
"""
==
FAIL: test_invalid_handles (test.test_multiprocessing_fork.TestInvalidHandle)
--
Traceback (most recent call last):
  File 
"/home/cpython/buildslave/cc-32/3.x.snakebite-solaris11-amd64/build/Lib/test/_test_multiprocessing.py",
line 2962, in test_invalid_handles
self.assertRaises((ValueError, OSError), conn.poll)
AssertionError: (, ) not raised by poll
"""

Basically, this test checks that calling poll() on an invalid
Connection (invalid FD) raises an OSError.
That's true for select, kqueue and epoll, but not for poll(), which
returns POLLNVAL.
I'm not sure about what to do here.

--

___
Python tracker 

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



[issue18924] Enum members are easily replaced

2013-09-05 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I think Ethan has a point that the inconsistency when overriding a member can 
hide subtle bugs. I would agree with Eli and Eric if it wasn't for that 
problem. Also, we can first forbid overriding, then change our decision later 
on if someone comes with a use case (doing the converse would be more annoying 
as it would break compatibility).

--
nosy: +pitrou

___
Python tracker 

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



[issue18938] Prepend Is Not A Word

2013-09-05 Thread Graham Wideman

Graham Wideman added the comment:

"Prepend" appears in every online dictionary I consulted. For a dictionary to 
list it and give the usual meaning for it, pretty much demonstrates "prepend" 
functioning as a real word. That and its 1.3 million hits on google.

"Prepend" certainly has a commonly understood meaning, particularly in 
computing. 

To the extent that "prepend" has became popular as the appropriate-sounding 
opposite of "append", that is exactly why it _should_ be used in this 
context... where one might well need to discuss adding strings before or after, 
and be clear about the distinction.

--
nosy: +gwideman

___
Python tracker 

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



[issue18934] multiprocessing: use selectors module

2013-09-05 Thread Richard Oudkerk

Richard Oudkerk added the comment:

I remember wondering at one time why EPOLLNVAL did not exist, and realizing 
that closed fds are just silently unregistered by epoll().

I guess the issue is that some of the selectors indicate a bad fd on 
registration, and others do it when polled.

On registration  On poll

SelectSelector  No   Raises OSError
PollSelectorNo   No (EVENT_READ or EVENT_WRITE)
EpollSelector   Raises OSError   No
KqueueSelector  ??

It would be easiest to relax the test, perhaps by just checking that 
conn.poll(0) raises or returns True.

Or maybe PollSelector.select() should raise OSError if POLLNVAL is indicated.  
That would match the behaviour of SelectSelector.select().

--

___
Python tracker 

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



[issue18876] Problems with files opened in append mode with io module

2013-09-05 Thread Erik Bray

Erik Bray added the comment:

Thank you!  Has there been a separate issue opened for the BufferedWriter bug 
or can that be covered by this issue as well?

--

___
Python tracker 

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



[issue18939] Venv docs regarding original python install

2013-09-05 Thread Graham Wideman

New submission from Graham Wideman:

http://docs.python.org/dev/library/venv.html

More detail needed regarding the original python environment

The article explains how to use venv to create a new python installation with 
independent libraries etc, and a means to activate one or another virtual 
python environment. However, there are some points regarding the original 
python environment which are cloudy.

(1) After pyvenv, what status does the original python installation have? Does 
pyvenv turn it into just one of now two or more virtual environments? Or is the 
original one special? Must it be specifically deactivated in order to activate 
a (different) virtual environment?

(2) The motivation behind venv seems to be to create virtual enviroments that 
can be substantially or completely separate from the system site directories or 
from the original python that pyvenv was run from.  Yet elsewhere the doc 
discusses how  pyvenv creates a pyvenv.cfg file with a home key pointing back 
to the originating Python installation, and "sys.base_prefix and 
sys.base_exec_prefix point to the non-venv Python installation which was used 
to create the venv."... which suggest that a venv is _not_ independent of its 
creating Python installation.

It would be helpful to provide some context for this seemingly contradictory 
information.  Perhaps there are scenarios with differing degrees of 
independence, in which these pointers back to the originating Python 
installation may or may not be relevant?

(3) How do you proceed to create virtual environments from scratch when you 
have no initial python installation, or no python installation of that python 
version?

-- Hope these suggestions help.

--
assignee: docs@python
components: Documentation
messages: 197030
nosy: docs@python, gwideman
priority: normal
severity: normal
status: open
title: Venv docs regarding original python install
type: behavior
versions: Python 3.3

___
Python tracker 

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



[issue18933] Add link to source code in logging documentation

2013-09-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset dc4e6b48c321 by Vinay Sajip in branch '2.7':
Issue #18933: Added links to source code.
http://hg.python.org/cpython/rev/dc4e6b48c321

New changeset 34e515f2fdfe by Vinay Sajip in branch '3.3':
Issue #18933: Added links to source code.
http://hg.python.org/cpython/rev/34e515f2fdfe

New changeset c5924523747e by Vinay Sajip in branch 'default':
Closes #18933: Merged update from 3.3.
http://hg.python.org/cpython/rev/c5924523747e

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue18937] add unittest assertion for logging

2013-09-05 Thread Vinay Sajip

Vinay Sajip added the comment:

I agree a context manager would be useful. Note that I have already provided a 
Handler subclass (TestHandler) as well as a Matcher class which allows matching 
of LogRecords, and which can be used in assertions. These are in test.support 
as they were originally intended for Python's own tests, but could be moved to 
the logging package if they are considered more generally useful.

See this for how to use them:

http://plumberjack.blogspot.co.uk/2010/09/unit-testing-and-logging.html

--

___
Python tracker 

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



[issue18937] add unittest assertion for logging

2013-09-05 Thread Vinay Sajip

Vinay Sajip added the comment:

Whoops, meant to say "... moved to the unittest package ...".

--

___
Python tracker 

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



[issue18940] TimedRotatingFileHandler fails to doRollover if a logger has delay=True and no logs in that time.

2013-09-05 Thread Joshua Olson

New submission from Joshua Olson:

In TimedRotatingFileHandler if you have a low volume logger than hasn't written 
to the log within the interval time doRollover will fail because there is no 
file to rotate.

os.rename(self.baseFilename, dfn) 

should be something like

if os.path.exists(self.base_fileName):
os.rename(self.baseFilename, dfn

I have included a unit test file.  This test fails on 2.7.1 and 2.7.3. I have 
not tried 2.7.5.

--
components: Library (Lib)
files: logging_test.py
messages: 197035
nosy: solarmist
priority: normal
severity: normal
status: open
title: TimedRotatingFileHandler fails to doRollover if a logger has delay=True 
and no logs in that time.
versions: Python 2.7
Added file: http://bugs.python.org/file31620/logging_test.py

___
Python tracker 

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



[issue18941] RotatingFileHandler and TimedRotatingFileHandler do not respect delay on rollover

2013-09-05 Thread Joshua Olson

New submission from Joshua Olson:

For low volume loggers RotatingFileHandler and TimedRotatingFileHandler will 
create possibly unnecessary files on doRollover, since they don't check the 
value of delay when opening the new self.stream.

self.stream = self._open()

should be something like

if not self.delay:
self.stream = self._open()

--
messages: 197036
nosy: solarmist
priority: normal
severity: normal
status: open
title: RotatingFileHandler and TimedRotatingFileHandler do not respect delay on 
rollover

___
Python tracker 

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



[issue18931] new selectors module should support devpoll on Solaris

2013-09-05 Thread Jesús Cea Avión

Changes by Jesús Cea Avión :


--
nosy: +jcea

___
Python tracker 

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



[issue18929] inspect.classify_class_attrs ignores metaclass

2013-09-05 Thread Ethan Furman

Ethan Furman added the comment:

Another option with the global fix is to only add the metaclass to the mro if 
the metaclass is not 'type'.

--

___
Python tracker 

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



[issue18808] Thread.join returns before PyThreadState is destroyed

2013-09-05 Thread Tim Peters

Tim Peters added the comment:

So you're not concerned about a now-private API (which used to be advertised), 
but are concerned about a user mucking with a new private lock in an 
exceedingly unlikely (in the absence of malice) way.  That clarifies things ;-)

I'm not really concerned about either.  User perversity knows no limits, 
though, so I wouldn't be surprised if some people are rolling their own 
higher-level threads in Python for reasons they think are compelling.

Details don't really matter to that, right?  Like:

> Also, how would they wait for the thread to end, except by
> triggering their own Event object?

Any number of ways.  Roll their own Event, roll their own Barrier, roll their 
own Condition, or even something as simple as keeping an integer count of the 
number of threads they created, and then (e.g.)

while nthreads:
time.sleep(1)

at the end, with each thread doing a

global nthreads
with nthreads_lock:
nthreads -= 1

in its end-of-life code.  Essentially rolling their own clumsy variant of a 
Semaphore.

I've seen code like that "in the wild".  But, no, I'll join you in not worrying 
about it ;-)

--

___
Python tracker 

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



[issue18940] TimedRotatingFileHandler fails to doRollover if a logger has delay=True and no logs in that time.

2013-09-05 Thread Joshua Olson

Joshua Olson added the comment:

Here is a patch for the logging file from the cpython hg repo.

--
keywords: +patch
Added file: http://bugs.python.org/file31621/doRollover.patch

___
Python tracker 

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



[issue18940] TimedRotatingFileHandler fails to doRollover if a logger has delay=True and no logs in that time.

2013-09-05 Thread Joshua Olson

Changes by Joshua Olson :


--
type:  -> behavior

___
Python tracker 

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



[issue18940] TimedRotatingFileHandler fails to doRollover if a logger has delay=True and no logs in that time.

2013-09-05 Thread Joshua Olson

Changes by Joshua Olson :


Removed file: http://bugs.python.org/file31620/logging_test.py

___
Python tracker 

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



[issue18940] TimedRotatingFileHandler fails to doRollover if a logger has delay=True and no logs in that time.

2013-09-05 Thread Joshua Olson

Changes by Joshua Olson :


Removed file: http://bugs.python.org/file31621/doRollover.patch

___
Python tracker 

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



[issue18924] Enum members are easily replaced

2013-09-05 Thread Eric Snow

Eric Snow added the comment:

> I would agree with Eli and Eric if it wasn't for that problem.

Agreed.  That was the gist of my question that led to Ethan's example.  If it's 
easy to accidentally break an enum, particularly in a subtle way, then it may 
not be worth taking a consenting adults approach.

Usually in consenting adults cases, it's simply not worth adding the extra 
complexity (or taking the time) to lock down an API or cover all the cases--it 
won't be a problem in practice since normal usage doesn't bear enough risk to 
worry about it.

In the case of enums, particularly in how they re-purpose classes and yet allow 
non-item attributes, there's a higher risk of accidentally breaking something 
during normal usage.  They quack like a class, but maybe they need to look less 
like a duck.  The question is, is the risk (and associated cost) of accidental 
breakage high enough to warrant the cost of being more heavy-handed?

> Also, we can first forbid overriding, then change our decision later
> on if someone comes with a use case (doing the converse would be more
> annoying as it would break compatibility).

+1

--

___
Python tracker 

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



[issue18940] TimedRotatingFileHandler and RotatingFileHandler fail to doRollover if a logger has delay=True and no logs in that time.

2013-09-05 Thread Joshua Olson

Joshua Olson added the comment:

This fixes the issue in both RotatingFilerHandler classes.

--
title: TimedRotatingFileHandler fails to doRollover if a logger has delay=True 
and no logs in that time. -> TimedRotatingFileHandler and RotatingFileHandler 
fail to doRollover if a logger has delay=True and no logs in that time.
Added file: http://bugs.python.org/file31622/doRollover.patch

___
Python tracker 

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



[issue18940] TimedRotatingFileHandler and RotatingFileHandler fail to doRollover if a logger has delay=True and no logs in that time.

2013-09-05 Thread Joshua Olson

Changes by Joshua Olson :


Added file: http://bugs.python.org/file31623/logging_test.py

___
Python tracker 

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



[issue18941] RotatingFileHandler and TimedRotatingFileHandler do not respect delay on rollover

2013-09-05 Thread Joshua Olson

Joshua Olson added the comment:

Demonstrate the bug

--
Added file: http://bugs.python.org/file31624/logging_test.py

___
Python tracker 

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



[issue18941] RotatingFileHandler and TimedRotatingFileHandler do not respect delay on rollover

2013-09-05 Thread Joshua Olson

Joshua Olson added the comment:

If delay is set then don't automatically open the new file.

--
keywords: +patch
Added file: http://bugs.python.org/file31625/delay_rollover.patch

___
Python tracker 

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



[issue18939] Venv docs regarding original python install

2013-09-05 Thread Graham Wideman

Graham Wideman added the comment:

Additionally on the subject of venv docs:  I would encourage making it more 
clear regarding how activate changes the user's PATH. Both 
http://www.python.org/dev/peps/pep-0405/  and 
http://docs.python.org/3.3/library/venv.html  talk about how activate adds the 
activated python binary to the path, but doesn't mention what path:  The one 
for the current console session? The system PATH environment variable (Windows) 
or one of the bash startup scripts (unix)? This is important, because it 
determines how far-reaching is activation of a particular virtual environment.

--

___
Python tracker 

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



  1   2   >