[issue22165] Empty response from http.server when directory listing contains invalid unicode

2014-08-17 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Looks like we hit with an encoding issue, which is due to way os.fsdecode() and 
os.listdir() decode the filenames.


>>> support.TESTFN_UNDECODABLE
b'@test_99678_tmp\xe7w\xf0'
>>> dir_list = os.listdir(self.tempdir)
>>> dir_list
['@test_99678_tmp%E7w%F0.txt', 'test']
>>> filename = os.fsdecode(support.TESTFN_UNDECODABLE) + '.txt'
>>> filename
'@test_99678_tmp\udce7w\udcf0.txt'


==
FAIL: test_undecodable_filename (test.test_httpservers.SimpleHTTPServerTestCase)
--
Traceback (most recent call last):
  File 
"/Users/buildbot/buildarea/3.4.murray-snowleopard/build/Lib/test/test_httpservers.py",
 line 282, in test_undecodable_filename
.encode('utf-8', 'surrogateescape'), body)
AssertionError: b'href="%40test_62069_tmp%ED%B3%A7w%ED%B3%B0.txt"' not found in 
b'http://www.w3.org/TR/html4/strict.dtd";>\n\n\n\nDirectory 
listing for tmp0asrs9ei/\n\n\nDirectory listing for 
tmp0asrs9ei/\n\n\n@test_62069_tmp%E7w%F0.txt\ntest\n\n\n\n\n'

--

___
Python tracker 

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



[issue22165] Empty response from http.server when directory listing contains invalid unicode

2014-08-17 Thread Senthil Kumaran

Changes by Senthil Kumaran :


--
status: closed -> open

___
Python tracker 

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



[issue22157] _ctypes on ppc64: libffi/src/powerpc/linux64.o: ABI version 1 is not compatible with ABI version 2 output

2014-08-17 Thread Matthias Klose

Matthias Klose added the comment:

this is fixed in the 3.4 branch (post 3.4.1) and on all active branches. you 
should be able to use --with-system-libffi in your current environment (maybe 
after running: apt-get build-dep python3.4.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue22165] Empty response from http.server when directory listing contains invalid unicode

2014-08-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a894b629bbea by Serhiy Storchaka in branch '3.4':
Issue #22165: Fixed test_undecodable_filename on non-UTF-8 locales.
http://hg.python.org/cpython/rev/a894b629bbea

New changeset 7cdc941d5180 by Serhiy Storchaka in branch 'default':
Issue #22165: Fixed test_undecodable_filename on non-UTF-8 locales.
http://hg.python.org/cpython/rev/7cdc941d5180

--

___
Python tracker 

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



[issue22165] Empty response from http.server when directory listing contains invalid unicode

2014-08-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Oh, I missed that os.listdir() on Mac returns really strange result. Thank you 
Senthil.

Here is a patch which try to workaround this. I'm not sure that it is enough. 
May be we should fix os.listdir(). Or conclude that this issue can't be fixed 
on Mac OS.

--
components: +Macintosh
nosy: +haypo, hynek, ned.deily, ronaldoussoren
resolution: fixed -> 
stage: resolved -> 
Added file: http://bugs.python.org/file36390/test_undecodable_filename.diff

___
Python tracker 

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



[issue22193] Add _PySys_GetSizeOf()

2014-08-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Fixed in changeset 2e417d9a2b1c. Thank you Arfrever.

--

___
Python tracker 

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



[issue22165] Empty response from http.server when directory listing contains invalid unicode

2014-08-17 Thread Ronald Oussoren

Ronald Oussoren added the comment:

OSX returns a strange value in os.listdir because the HFS+ filesystem itself 
has unicode filenames and transforms byte strings that are assumed to contain 
UTF-8 into something the filesystem can handle (and seems to replace bytes that 
aren't valid UTF-8 into a percent-encoded value).

--

___
Python tracker 

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



[issue22213] pyvenv style virtual environments unusable in an embedded system

2014-08-17 Thread Graham Dumpleton

New submission from Graham Dumpleton:

In am embedded system, as the 'python' executable is itself not run and the 
Python interpreter is initialised in process explicitly using PyInitialize(), 
in order to find the location of the Python installation, an elaborate sequence 
of checks is run as implemented in calculate_path() of Modules/getpath.c.

The primary mechanism is usually to search for a 'python' executable on PATH 
and use that as a starting point. From that it then back tracks up the file 
system from the bin directory to arrive at what would be the perceived 
equivalent of PYTHONHOME. The lib/pythonX.Y directory under that for the 
matching version X.Y of Python being initialised would then be used.

Problems can often occur with the way this search is done though.

For example, if someone is not using the system Python installation but has 
installed a different version of Python under /usr/local. At run time, the 
correct Python shared library would be getting loaded from /usr/local/lib, but 
because the 'python' executable is found from /usr/bin, it uses /usr as 
sys.prefix instead of /usr/local.

This can cause two distinct problems.

The first is that there is no Python installation at all under /usr 
corresponding to the Python version which was embedded, with the result of it 
not being able to import 'site' module and therefore failing.

The second is that there is a Python installation of the same major/minor but 
potentially a different patch revision, or compiled with different binary API 
flags or different Unicode character width. The Python interpreter in this case 
may well be able to start up, but the mismatch in the Python modules or 
extension modules and the core Python library that was actually linked can 
cause odd errors or crashes to occur.

Anyway, that is the background.

For an embedded system the way this problem was overcome was for it to use 
Py_SetPythonHome() to forcibly override what should be used for PYTHONHOME so 
that the correct installation was found and used at runtime.

Now this would work quite happily even for Python virtual environments 
constructed using 'virtualenv' allowing the embedded system to be run in that 
separate virtual environment distinct from the main Python installation it was 
created from.

Although this works for Python virtual environments created using 'virtualenv', 
it doesn't work if the virtual environment was created using pyvenv.

One can easily illustrate the problem without even using an embedded system.

$ which python3.4
/Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4

$ pyvenv-3.4 py34-pyvenv

$ py34-pyvenv/bin/python
Python 3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 00:54:21)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.prefix
'/private/tmp/py34-pyvenv'
>>> sys.path
['', '/Library/Frameworks/Python.framework/Versions/3.4/lib/python34.zip', 
'/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4', 
'/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/plat-darwin', 
'/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/lib-dynload', 
'/private/tmp/py34-pyvenv/lib/python3.4/site-packages']

$ PYTHONHOME=/tmp/py34-pyvenv python3.4
Fatal Python error: Py_Initialize: unable to load the file system codec
ImportError: No module named 'encodings'
Abort trap: 6

The basic problem is that in a pyvenv virtual environment, there is no 
duplication of stuff in lib/pythonX.Y, with the only thing in there being the 
site-packages directory.

When you start up the 'python' executable direct from the pyvenv virtual 
environment, the startup sequence checks know this and consult the pyvenv.cfg 
to extract the:

home = /Library/Frameworks/Python.framework/Versions/3.4/bin

setting and from that derive where the actual run time files are.

When PYTHONHOME or Py_SetPythonHome() is used, then the getpath.c checks 
blindly believe that is the authoritative value:

 * Step 2. See if the $PYTHONHOME environment variable points to the
 * installed location of the Python libraries.  If $PYTHONHOME is set, then
 * it points to prefix and exec_prefix.  $PYTHONHOME can be a single
 * directory, which is used for both, or the prefix and exec_prefix
 * directories separated by a colon.

/* If PYTHONHOME is set, we believe it unconditionally */
if (home) {
wchar_t *delim;
wcsncpy(prefix, home, MAXPATHLEN);
prefix[MAXPATHLEN] = L'\0';
delim = wcschr(prefix, DELIM);
if (delim)
*delim = L'\0';
joinpath(prefix, lib_python);
joinpath(prefix, LANDMARK);
return 1;
}
Because of this, the problem above occurs as the proper runtime directories for 
files aren't included in sys.path. The result being that the 'encodings' module 
cannot even be found.

What I believe should occur is that PYTHONHOME should not be believed 
unconditi

[issue22213] pyvenv style virtual environments unusable in an embedded system

2014-08-17 Thread Nick Coghlan

Changes by Nick Coghlan :


--
nosy: +ncoghlan

___
Python tracker 

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



[issue22165] Empty response from http.server when directory listing contains invalid unicode

2014-08-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Well, then the workaround should work.

--

___
Python tracker 

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



[issue22213] pyvenv style virtual environments unusable in an embedded system

2014-08-17 Thread Nick Coghlan

Nick Coghlan added the comment:

Yeah, PEP 432 (my proposal to redesign the startup sequence) could just as well 
be subtitled "getpath.c hurts my brain" :P

One tricky part here is going to be figuring out how to test this - perhaps 
adding a new test option to _testembed and then running it both inside and 
outside a venv.

--

___
Python tracker 

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



[issue22213] pyvenv style virtual environments unusable in an embedded system

2014-08-17 Thread Nick Coghlan

Nick Coghlan added the comment:

Graham pointed out that setting PYTHONHOME ends up triggering the same control 
flow through getpath.c as calling Py_SetPythonHome, so this can be tested just 
with pyvenv and a suitably configured environment.

It may still be a little tricky though, since we normally run the pyvenv tests 
in isolated mode to avoid spurious failures due to bad environment settings...

--

___
Python tracker 

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



[issue22201] python -mzipfile fails to unzip files with folders created by zip

2014-08-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ffa5bfe75c3a by Serhiy Storchaka in branch '2.7':
Issue #22201: Command-line interface of the zipfile module now correctly
http://hg.python.org/cpython/rev/ffa5bfe75c3a

New changeset 7b933005c492 by Serhiy Storchaka in branch '3.4':
Issue #22201: Command-line interface of the zipfile module now correctly
http://hg.python.org/cpython/rev/7b933005c492

New changeset dc77ad3a17aa by Serhiy Storchaka in branch 'default':
Issue #22201: Command-line interface of the zipfile module now correctly
http://hg.python.org/cpython/rev/dc77ad3a17aa

--
nosy: +python-dev

___
Python tracker 

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



[issue22201] python -mzipfile fails to unzip files with folders created by zip

2014-08-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Applied first part of the patch. Thank you Ryan. For the rest please open 
separate issue.

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

___
Python tracker 

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



[issue22068] tkinter: avoid reference loops with Variables and Fonts

2014-08-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0b79c702abda by Serhiy Storchaka in branch '2.7':
Issue #22068: Avoided reference loops with Variables and Fonts in Tkinter.
http://hg.python.org/cpython/rev/0b79c702abda

New changeset 873002eb8087 by Serhiy Storchaka in branch '3.4':
Issue #22068: Avoided reference loops with Variables and Fonts in Tkinter.
http://hg.python.org/cpython/rev/873002eb8087

New changeset f44f5daff665 by Serhiy Storchaka in branch 'default':
Issue #22068: Avoided reference loops with Variables and Fonts in Tkinter.
http://hg.python.org/cpython/rev/f44f5daff665

--

___
Python tracker 

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



[issue22034] posixpath.join() and bytearray

2014-08-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Could anyone please make the review?

--
assignee:  -> serhiy.storchaka

___
Python tracker 

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



[issue22193] Add _PySys_GetSizeOf()

2014-08-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is alternative patch. May be it looks more clear for you.

--
stage: needs patch -> patch review
Added file: http://bugs.python.org/file36391/_PySys_GetSizeOf_overflow_2.patch

___
Python tracker 

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



[issue22068] tkinter: avoid reference loops with Variables and Fonts

2014-08-17 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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

___
Python tracker 

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



[issue22014] Improve display of OS exception <-> errno mapping

2014-08-17 Thread Jon Poler

Jon Poler added the comment:

Here's one way to accomplish this. Please see attached 
os_exceptions_table_V2.patch.

I wasn't having much luck trying to use ReST, so I took advantage of the fact 
that the Doc/conf.py file is executed every time sphinx-build is run. conf.py 
imports and calls the main function from Doc/tools/build_table.py. This script 
dynamically builds a table by scraping errno values corresponding to an OS 
exception and inserting them in the appropriate place. 
Doc/library/exceptions.rst just uses a literalinclude of the new table that 
gets built to Lib/test/os_exception_hierarchy.txt (the same directory that 
holds the original exceptions hierarchy).

Error catching is used so that, in the event of an error, a warning will be 
raised but the sphinx-build command will still succeed.

--
Added file: http://bugs.python.org/file36392/os_exceptions_table_V2.patch

___
Python tracker 

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



[issue22165] Empty response from http.server when directory listing contains invalid unicode

2014-08-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b05d4f3ee190 by Serhiy Storchaka in branch '3.4':
Issue #22165: Fixed test_undecodable_filename on Mac OS.
http://hg.python.org/cpython/rev/b05d4f3ee190

New changeset 58e0d2c3ead8 by Serhiy Storchaka in branch 'default':
Issue #22165: Fixed test_undecodable_filename on Mac OS.
http://hg.python.org/cpython/rev/58e0d2c3ead8

--

___
Python tracker 

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



[issue22195] Make it easy to replace print() calls with logging calls

2014-08-17 Thread Martin Matusiak

Martin Matusiak added the comment:

Would it make sense for the logging module to supply something like the 
LoggerWriter class you wrote? 

With a section in the documentation that says something like "have you been 
logging using print() this whole time? No problem, just do sys.stdout = 
LoggerWriter()"?

--

___
Python tracker 

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



[issue22214] Tkinter: Don't stringify callbacks arguments

2014-08-17 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Currently Tkinter supports two modes:

* When wantobjects=1 (default), all results of Tcl/Tk commands are converted to 
appropriate Python objects (int, float, str, bytes, tuple) if it is possible or 
to Tcl_Obj for unknown Tcl types.
* When wantobjects=0 (legacy mode), all results of Tcl/Tk commands are 
converted to strings.

But arguments of a callback are always converted to str, even when 
wantobjects=1. This can lost information ("42" is not distinguished from 42 or 
(42,)) and may be less efficient. Unfortunately we can't just change Tkinter to 
pass callback arguments as Python objects, this is backward incompatible 
change. Proposed patch introduces third mode wantobjects=2. It is the same as 
wantobjects=1, but callbacks now received . Default mode is still 
wantobjects=1, it can be changed in future. But in Tkinter applications (IDLE, 
Turtledemo, Pynche) we can use wantobjects=2 right now.

The only problem left is documenting it. The wantobjects parameter is not 
documented at all except an entry in "What's New in Python 2.3". Does anyone 
want to document this feature?

--
components: Tkinter
files: tkinter_obj_cmd.patch
keywords: patch
messages: 225446
nosy: gpolo, serhiy.storchaka, terry.reedy
priority: normal
severity: normal
stage: patch review
status: open
title: Tkinter: Don't stringify callbacks arguments
type: enhancement
versions: Python 3.5
Added file: http://bugs.python.org/file36393/tkinter_obj_cmd.patch

___
Python tracker 

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



[issue22214] Tkinter: Don't stringify callbacks arguments

2014-08-17 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
dependencies: +Run Tkinter tests with wantobjects=False

___
Python tracker 

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



[issue22215] "embedded NUL character" exceptions

2014-08-17 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Currently most functions which accepts string only without embedded NUL 
character, raise TypeError. Proposed patch change exception type to more 
consistent ValueError. It also unifies error messages.

I have opened a discussion on Python-Dev.

--
components: Interpreter Core
files: valueerror_embedded_nul_character.diff
keywords: patch
messages: 225447
nosy: serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: "embedded NUL character" exceptions
type: enhancement
versions: Python 3.5
Added file: 
http://bugs.python.org/file36394/valueerror_embedded_nul_character.diff

___
Python tracker 

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



[issue13916] disallow the "surrogatepass" handler for non utf-* encodings

2014-08-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Could you please finish this issue Victor?

--
assignee:  -> haypo
stage: resolved -> 

___
Python tracker 

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



[issue22115] Add new methods to trace Tkinter variables

2014-08-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Synchronized with the tip.

--
stage:  -> patch review
Added file: http://bugs.python.org/file36395/tkinter_trace_variable_3.patch

___
Python tracker 

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



[issue22115] Add new methods to trace Tkinter variables

2014-08-17 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Removed file: http://bugs.python.org/file36179/tkinter_trace_variable_2.patch

___
Python tracker 

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



[issue22216] smtplip STARTTLS fails at second attampt due to unsufficiant quit()

2014-08-17 Thread Milan Oberkirch

New submission from Milan Oberkirch:

When using smtplib.SMTP to connect to a SMTP server the instance variables 
esmtp_response survives a SMTP.quit() which results in the following error:

>>> import smtplib
>>> smtp = smtplib.SMTP('mail.oberkirch.org', 25)
>>> smtp.starttls()
(220, b'2.0.0 Ready to start TLS')
>>> smtp.ehlo()
(250, b'mail.oberkirch.org\nPIPELINING\nSIZE 1024\nVRFY\nETRN\nAUTH PLAIN 
LOGIN\nAUTH=PLAIN LOGIN\nENHANCEDSTATUSCODES\n8BITMIME\nDSN')
>>> smtp.quit()
(221, b'2.0.0 Bye')
>>> smtp.connect('mail.oberkirch.org', 25)
(220, b'mail.oberkirch.org ESMTP Postfix')
>>> smtp.starttls()
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.4/smtplib.py", line 672, in starttls
raise SMTPException("STARTTLS extension not supported by server.")
smtplib.SMTPException: STARTTLS extension not supported by server.
>>>

While reporting this issue I found out that starttls also does not throw away 
any ehlo information as it should. Provided that fixing this would probably 
break existing code (which would only work with non-standard servers like 
postfix) I did not change that behaviour.

--
components: Library (Lib)
files: quit_resets_greeting.patch
keywords: patch
messages: 225450
nosy: zvyn
priority: normal
severity: normal
status: open
title: smtplip STARTTLS fails at second attampt due to unsufficiant quit()
type: behavior
versions: Python 3.4, Python 3.5
Added file: http://bugs.python.org/file36396/quit_resets_greeting.patch

___
Python tracker 

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



[issue22217] Reprs for zipfile classes

2014-08-17 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Proposed patch implements __repr__() methods of three zipfile classes: ZipFile, 
ZipInfo and ZipExtFile. Example:

>>> import zipfile
>>> zf = 
>>> zipfile.ZipFile('/usr/share/doc/texlive-base/support/makeindex/ind-src.zip')
>>> zf

>>> zf.infolist()[:2]
[, ]
>>> zf.open('ind-src/fig1.tex')


--
assignee: serhiy.storchaka
components: Library (Lib)
messages: 225451
nosy: serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Reprs for zipfile classes
type: enhancement
versions: Python 3.5

___
Python tracker 

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



[issue22217] Reprs for zipfile classes

2014-08-17 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
keywords: +patch
Added file: http://bugs.python.org/file36397/zipfile_reprs.diff

___
Python tracker 

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



[issue21549] Add the members parameter for TarFile.list()

2014-08-17 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka

___
Python tracker 

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



[issue21549] Add the members parameter for TarFile.list()

2014-08-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Added a test. Make the members parameter keyword-only.

If there are no objections I'll commit the patch soon.

--
Added file: http://bugs.python.org/file36398/tarfile_list_members_2.patch

___
Python tracker 

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



[issue21549] Add the members parameter for TarFile.list()

2014-08-17 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Removed file: http://bugs.python.org/file35307/tarfile_list_members.patch

___
Python tracker 

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



[issue22218] Fix more compiler warnings "comparison between signed and unsigned integers"

2014-08-17 Thread STINNER Victor

New submission from STINNER Victor:

The issue #22110 enabled more compiler warnings. Attached patch fixes some of 
them in the Modules/ subdirectory.

--
files: fix_more_warnings.patch
keywords: patch
messages: 225453
nosy: haypo
priority: normal
severity: normal
status: open
title: Fix more compiler warnings "comparison between signed and unsigned 
integers"
versions: Python 3.5
Added file: http://bugs.python.org/file36399/fix_more_warnings.patch

___
Python tracker 

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



[issue22218] Fix more compiler warnings "comparison between signed and unsigned integers"

2014-08-17 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +neologix, serhiy.storchaka

___
Python tracker 

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



[issue22218] Fix more compiler warnings "comparison between signed and unsigned integers"

2014-08-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 05e8f92b58ff by Victor Stinner in branch 'default':
Issue #22218: Fix "comparison between signed and unsigned integers" warnings in
http://hg.python.org/cpython/rev/05e8f92b58ff

--
nosy: +python-dev

___
Python tracker 

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



[issue22218] Fix more compiler warnings "comparison between signed and unsigned integers"

2014-08-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

You are very fast.

--

___
Python tracker 

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



[issue22195] Make it easy to replace print() calls with logging calls

2014-08-17 Thread Vinay Sajip

Vinay Sajip added the comment:

> Would it make sense for the logging module to supply something like the 
> LoggerWriter class you wrote? 

Perhaps I'm not making myself clear :-( I've posted the LoggerWriter class (not 
the initial version, but the later, slightly more functional one) to see if it 
will meet the needs that Antoine raised and Raymond concurred with. The 
intention is, if it meets their requirements, to indeed add the LoggerWriter 
class to the stdlib. If it doesn't meet the requirements, then suggestions 
and/or patches to improve it are welcome.

However, from a smoke test, sys.stdout = LoggerWriter() doesn't seem to work as 
expected, but I can't see why at the moment (and currently I'm not able to give 
it my undivided attention).

--

___
Python tracker 

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



[issue22219] python -mzipfile fails to add empty folders to created zip

2014-08-17 Thread Antony Lee

New submission from Antony Lee:

Compare

$ mkdir foo; zip -q foo{,}; unzip -l foo.zip
Archive:  foo.zip
  Length  DateTimeName
-  -- -   
0  2014-08-17 10:49   foo/
- ---
0 1 file

and

$ mkdir foo; python -mzipfile -c foo{.zip,}; unzip -l foo.zip
Archive:  foo.zip
warning [foo.zip]:  zipfile is empty

A patch was posted by Ryan Wilson in related issue #22201.

--
components: Library (Lib)
messages: 225457
nosy: Antony.Lee
priority: normal
severity: normal
status: open
title: python -mzipfile fails to add empty folders to created zip
versions: Python 3.4, Python 3.5

___
Python tracker 

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



[issue22212] zipfile.py fails if zlib.so module fails to build.

2014-08-17 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti
stage:  -> needs patch
type:  -> behavior

___
Python tracker 

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



[issue22219] python -mzipfile fails to add empty folders to created zip

2014-08-17 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
nosy: +serhiy.storchaka
stage:  -> needs patch
type:  -> behavior
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



[issue22220] Ttk extensions test failure

2014-08-17 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Strange test failure on one of Windows buildbots:
http://buildbot.python.org/all/builders/x86%20Windows%20Server%202003%20%5BSB%5D%203.x/builds/2393/steps/test/logs/stdio

==
ERROR: test_horizontal_range 
(tkinter.test.test_ttk.test_extensions.LabeledScaleTest)
--
Traceback (most recent call last):
  File 
"D:\cygwin\home\db3l\buildarea\3.4.bolen-windows\build\lib\tkinter\test\test_ttk\test_extensions.py",
 line 113, in test_horizontal_range
lscale.pack()
  File 
"D:\cygwin\home\db3l\buildarea\3.4.bolen-windows\build\lib\tkinter\__init__.py",
 line 1952, in pack_configure
+ self._options(cnf, kw))
_tkinter.TclError: cannot use geometry manager pack inside . which already has 
slaves managed by grid

==
ERROR: test_resize (tkinter.test.test_ttk.test_extensions.LabeledScaleTest)
--
Traceback (most recent call last):
  File 
"D:\cygwin\home\db3l\buildarea\3.4.bolen-windows\build\lib\tkinter\test\test_ttk\test_extensions.py",
 line 175, in test_resize
x.pack(expand=True, fill='both')
  File 
"D:\cygwin\home\db3l\buildarea\3.4.bolen-windows\build\lib\tkinter\__init__.py",
 line 1952, in pack_configure
+ self._options(cnf, kw))
_tkinter.TclError: cannot use geometry manager pack inside . which already has 
slaves managed by grid

==
ERROR: test_variable_change 
(tkinter.test.test_ttk.test_extensions.LabeledScaleTest)
--
Traceback (most recent call last):
  File 
"D:\cygwin\home\db3l\buildarea\3.4.bolen-windows\build\lib\tkinter\test\test_ttk\test_extensions.py",
 line 143, in test_variable_change
x.pack()
  File 
"D:\cygwin\home\db3l\buildarea\3.4.bolen-windows\build\lib\tkinter\__init__.py",
 line 1952, in pack_configure
+ self._options(cnf, kw))
_tkinter.TclError: cannot use geometry manager pack inside . which already has 
slaves managed by grid

==
ERROR: test_menu (tkinter.test.test_ttk.test_extensions.OptionMenuTest)
--
Traceback (most recent call last):
  File 
"D:\cygwin\home\db3l\buildarea\3.4.bolen-windows\build\lib\tkinter\test\test_ttk\test_extensions.py",
 line 256, in test_menu
optmenu.pack()
  File 
"D:\cygwin\home\db3l\buildarea\3.4.bolen-windows\build\lib\tkinter\__init__.py",
 line 1952, in pack_configure
+ self._options(cnf, kw))
_tkinter.TclError: cannot use geometry manager pack inside . which already has 
slaves managed by grid

--

May be it relates to my last Tkinter changes or may be it is just sporadic 
failure.

--
assignee: serhiy.storchaka
components: Tkinter
messages: 225458
nosy: serhiy.storchaka
priority: normal
severity: normal
stage: test needed
status: open
title: Ttk extensions test failure
type: behavior
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



[issue22219] python -mzipfile fails to add empty folders to created zip

2014-08-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Directory entry should be added not only when directory is empty.

See also issue20912.

--

___
Python tracker 

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



[issue22218] Fix more compiler warnings "comparison between signed and unsigned integers"

2014-08-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ca5eef14c1ab by Victor Stinner in branch 'default':
Issue #22218: Fix "comparison between signed and unsigned integers" warnings in
http://hg.python.org/cpython/rev/ca5eef14c1ab

--

___
Python tracker 

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



[issue22218] Fix more compiler warnings "comparison between signed and unsigned integers"

2014-08-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2f2c1816d0c7 by Victor Stinner in branch 'default':
Issue #22218: Fix "comparison between signed and unsigned integers" warning in
http://hg.python.org/cpython/rev/2f2c1816d0c7

--

___
Python tracker 

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



[issue21520] Erroneous zipfile test failure if the string 'bad' appears in pwd

2014-08-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The line is too long. It would be better to extract a filter as regular 
function. Otherwise LGTM.

--
nosy: +serhiy.storchaka
stage: needs patch -> commit review

___
Python tracker 

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



[issue22218] Fix more compiler warnings "comparison between signed and unsigned integers"

2014-08-17 Thread STINNER Victor

STINNER Victor added the comment:

> You are very fast.

Oh sorry. In fact, I didn't expect a review. I just created an issue to put an 
issue number in the commit changelog and give a little bit more context to my 
changes.

--

___
Python tracker 

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



[issue2527] Pass a namespace to timeit

2014-08-17 Thread Ben Roberts

Changes by Ben Roberts :


--
nosy: +roippi

___
Python tracker 

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



[issue22221] ast.literal_eval confused by coding declarations

2014-08-17 Thread Jorgen Schäfer

New submission from Jorgen Schäfer:

The ast module seems to get confused for certain strings which contain coding 
declarations.

>>> import ast

>>> s = u'"""\\\n# -*- coding: utf-8 -*-\n"""'
>>> print s
"""\
# -*- coding: utf-8 -*-
"""
>>> ast.literal_eval(s)
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/forcer/Programs/Python/python2.7/lib/python2.7/ast.py", line 49, 
in literal_eval
node_or_string = parse(node_or_string, mode='eval')
  File "/home/forcer/Programs/Python/python2.7/lib/python2.7/ast.py", line 37, 
in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
  File "", line 0
SyntaxError: encoding declaration in Unicode string

--
components: Library (Lib)
messages: 225464
nosy: jorgenschaefer
priority: normal
severity: normal
status: open
title: ast.literal_eval confused by coding declarations
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



[issue22222] dtoa.c: remove custom memory allocator

2014-08-17 Thread STINNER Victor

New submission from STINNER Victor:

dtoa.c has an optimized memory allocator for performances: it uses a short pool 
of 2304 doubles (18 KB) to avoid calling malloc/free. Comment in dtoa.c:

/* Memory management: memory is allocated from, and returned to, Kmax+1 pools
   of memory, where pool k (0 <= k <= Kmax) is for Bigints b with b->maxwds ==
   1 << k.  These pools are maintained as linked lists, with freelist[k]
   pointing to the head of the list for pool k.

   On allocation, if there's no free slot in the appropriate pool, MALLOC is
   called to get more memory.  This memory is not returned to the system until
   Python quits.  There's also a private memory pool that's allocated from
   in preference to using MALLOC.

   For Bigints with more than (1 << Kmax) digits (which implies at least 1233
   decimal digits), memory is directly allocated using MALLOC, and freed using
   FREE.

   XXX: it would be easy to bypass this memory-management system and
   translate each call to Balloc into a call to PyMem_Malloc, and each
   Bfree to PyMem_Free.  Investigate whether this has any significant
   performance on impact. */

Python already has such memory pool: PyObject_Malloc(). I propose to reuse it. 
It avoids wasting memory "until Python quits" just to optimize dtoa.c.

dtoa.c memory pool is only used for allocations smaller than 68 bytes (on 64 
bits system, Kmax=7). PyObject_Malloc() is optimized for allocations smaller 
than 513 bytes, so it's ok.

See also the issue #7632.

--
files: dtoa_remove_custom_alloc.patch
keywords: patch
messages: 225465
nosy: haypo, mark.dickinson, skrah
priority: normal
severity: normal
status: open
title: dtoa.c: remove custom memory allocator
versions: Python 3.5
Added file: http://bugs.python.org/file36400/dtoa_remove_custom_alloc.patch

___
Python tracker 

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



[issue22153] There is no standard TestCase.runTest implementation

2014-08-17 Thread evilzero

evilzero added the comment:

Updated documentation following suggestion.

--
keywords: +patch
nosy: +evilzero
Added file: http://bugs.python.org/file36401/myworkdoc.patch

___
Python tracker 

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



[issue22153] There is no standard TestCase.runTest implementation

2014-08-17 Thread evilzero

Changes by evilzero :


--
type:  -> enhancement

___
Python tracker 

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



[issue22221] ast.literal_eval confused by coding declarations

2014-08-17 Thread David Halter

Changes by David Halter :


--
nosy: +davidhalter

___
Python tracker 

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



[issue22206] PyThread_create_key(): fix comparison between signed and unsigned numbers in Python/thread_pthread.h

2014-08-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1b898b5d5ffe by Victor Stinner in branch 'default':
Issue #22206: Using pthread, PyThread_create_key() now sets errno to ENOMEM and
http://hg.python.org/cpython/rev/1b898b5d5ffe

--
nosy: +python-dev

___
Python tracker 

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



[issue22206] PyThread_create_key(): fix comparison between signed and unsigned numbers in Python/thread_pthread.h

2014-08-17 Thread STINNER Victor

STINNER Victor added the comment:

I fixed the issue in Python 3.5, I close the issue.

Even if Python 2.7 and 3.4 are also affected, I prefer to not modify them to 
not take the risk of introducing a regression for a corner case.

--
resolution:  -> fixed
status: open -> closed
versions:  -Python 2.7, Python 3.4

___
Python tracker 

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



[issue22221] ast.literal_eval confused by coding declarations

2014-08-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

eval() is affected too. 3.x isn't affected.

--
assignee:  -> serhiy.storchaka
components: +Interpreter Core -Library (Lib)
nosy: +serhiy.storchaka
stage:  -> needs patch
type:  -> behavior

___
Python tracker 

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



[issue22222] dtoa.c: remove custom memory allocator

2014-08-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This is very dangerous change. Could you please compare results of Python 
benchmarks with and without the patch?

--
nosy: +pitrou, serhiy.storchaka

___
Python tracker 

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



[issue10583] Encoding issue with chm help in 2.7.1

2014-08-17 Thread Mark Lawrence

Mark Lawrence added the comment:

Is there anything to be done here as Sphinx is a third party tool and the root 
cause is already fixed?

--

___
Python tracker 

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



[issue6759] zipfile.ZipExtFile.read() is missing universal newline support

2014-08-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Mode 'U' is deprecated now (issue15204).

--

___
Python tracker 

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



[issue22222] dtoa.c: remove custom memory allocator

2014-08-17 Thread Stefan Krah

Stefan Krah added the comment:

A modified version of telco.py (using floats instead of decimals) runs
about 5-6% slower with the change here.

--

___
Python tracker 

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



[issue22222] dtoa.c: remove custom memory allocator

2014-08-17 Thread Eric V. Smith

Changes by Eric V. Smith :


--
nosy: +eric.smith

___
Python tracker 

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



[issue22195] Make it easy to replace print() calls with logging calls

2014-08-17 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> However, from a smoke test, sys.stdout = LoggerWriter() doesn't seem to work 
> as expected

I wasn't thinking about replacing sys.stdout (which I think is in general a bad 
pattern, except for daemonized processes), rather being able to 1) either 
replace the print() calls with logging calls with a similar API or 2) add a 
file= argument to print calls.

(the 1) solution could look like "print = 
logging.getLogger('foo').debug_printer()")

--

___
Python tracker 

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



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

2014-08-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 97c70528b604 by Victor Stinner in branch 'default':
Issue #22207: Fix "comparison between signed and unsigned integers" warning in
http://hg.python.org/cpython/rev/97c70528b604

--
nosy: +python-dev

___
Python tracker 

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



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

2014-08-17 Thread STINNER Victor

STINNER Victor added the comment:

I commited the first part.

The remaining part is a long patch for unicodeobject.c.

--
Added file: http://bugs.python.org/file36402/unicode.patch

___
Python tracker 

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



[issue22195] Make it easy to replace print() calls with logging calls

2014-08-17 Thread Vinay Sajip

Vinay Sajip added the comment:

Loggers don't deal with output - handlers do - so I would prefer not to add an 
output-related method to a logger: people confuse the two enough as it is. Note 
that 

stream = LoggerWriter('foo')

gives an equivalent result to

stream = getLogger('foo').debug_printer()

and in my view the former is preferable.

I agree that there is no compelling reason to replace sys.stdout, though it 
means that you have to pass file=stream in each print() call.

It also makes more sense to use print() rather than have a separate API that 
looks just like print(), as you essentially would have to duplicate the 
functionality of the print() API and track enhancements to it over time (to 
avoid surprises).

--

___
Python tracker 

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



[issue21585] Run Tkinter tests with wantobjects=False

2014-08-17 Thread Terry J. Reedy

Terry J. Reedy added the comment:

My impression is that we are trying to move away from using test_main, or is 
using support.run_unittest considered a sufficient change from the old explicit 
suite method?

Anyway, here is an alternate approach, adding two lines to wrap all test 
classes, that tags the test classes in the code and hence in error messages.

import unittest
for i in range(2): exec('''
class T{0}(unittest.TestCase):
def test_2(self):
self.assertTrue({0} == 1)
'''.format(i))
unittest.main()
>>>
F.
==
FAIL: test_2 (__main__.T0)
--
Traceback (most recent call last):
  File "", line 4, in test_2
AssertionError: False is not true

--
Ran 2 tests in 0.016s

--
nosy: +terry.reedy

___
Python tracker 

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



[issue22181] os.urandom() should use Linux 3.17 getrandom() syscall

2014-08-17 Thread Josh Rosenberg

Changes by Josh Rosenberg :


--
nosy: +josh.rosenberg

___
Python tracker 

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



[issue22115] Add new methods to trace Tkinter variables

2014-08-17 Thread Terry J. Reedy

Terry J. Reedy added the comment:

trace_add:

"list or tuple" (of such strings.)  Can we say 'sequence' (or even set or 
iterable) or is the requirement specifically tuple or list?

Does tk call the traceback function with any args it supplies(other than those 
passed in)? (In other words, is the callback affected by the #22214 proposal?)

*args is a tuple of objects, not parameters (names). I would just say 
"Additional arguments are passed to the traceback call".

trace_remove:

"Should be same as were specified in trace_add()." Is a subset not allowed to 
remove a subset of the registrations currently allowed?  Does trying to delete 
other modes raise TclError?  If both are so, I would say something like "Must 
be a subset of current trace modes.". 

"Additional parameters should be same as were specified in trace_add()."
Again, /parameters/arguments/. That aside, remembering and passing the 
arguments back seems like a bizarre requirement that makes not sense. What 
happens if one does not, or gets it wrong? It the args are really required 
exactly, then is seems that trace_add should return (cbname,) + args to be 
passed back to trace_remove as cbname_args.

Alternatively, could *args (and mode) be retrieved from trace_info?

trace_variable, _vdelete

" This method is deprecated and will likely be removed in a future version of 
Tcl."  Slightly more accurate would be "This deprecated method wraps a 
deprecated tcl method that will likely be removed in the future."

--

___
Python tracker 

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



[issue22214] Tkinter: Don't stringify callbacks arguments

2014-08-17 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I think I requested elsewhere that public _tkinter/tkinter names be documented. 
 What you wrote already seems clear enough.

"Default mode is still wantobjects=1," The patch appears to change it to 2 in 
tkinter/__init__.py.

"/* Create argument list (argv1, ..., argvN) */
 if (!(arg ..."

/arg/args/ is definitely less confusing. Add /list/tuple/ to old and new 
functions.

One thing slightly puzzles me: the current PythonCmd is used in a call to 
Tcl_CreateCommand.  (Since the latter is not in _tkinter, I presume it is 
'imported' in one of the includes.)  The new PythonObjCmd is passed to 
Tcl_CreateObjCommand. Does that already exist, just waiting for us to add 
PythonObjCmd?


I near as I can tell, the only differences between PythonCmd and PythonOjbCmd 
are /argv/objv/ and the following.
  
  PyObject *s = unicodeFromTclString(argv[i + 1]);
  PyObject *s = FromObj(data->self, objv[i + 1]);

I think I would make the name substitution either in both or neither.  It would 
be nice to reuse the rest of the code.

--

___
Python tracker 

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



[issue22200] Remove distutils checks for Python version

2014-08-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset fbb51251eb9d by Benjamin Peterson in branch '3.4':
remove 2.2 and 2.6 compat code (closes #22200)
http://hg.python.org/cpython/rev/fbb51251eb9d

New changeset 66c7f30fe8c7 by Benjamin Peterson in branch 'default':
merge 3.4 (closes #22200)
http://hg.python.org/cpython/rev/66c7f30fe8c7

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

___
Python tracker 

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



[issue17131] subprocess.Popen.terminate can raise exception on Posix

2014-08-17 Thread Martin Panter

Martin Panter added the comment:

This is more or less a dupe of Issue 6973, which also has a potential patch.

--

___
Python tracker 

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



[issue6973] subprocess.Popen.send_signal doesn't check whether the process has terminated

2014-08-17 Thread Martin Panter

Martin Panter added the comment:

It seems to me that raising OSError isn’t quite right. Either the error is more 
of an internal programmer error, like how writing to a closed file object 
raises ValueError, or there should not be an error, like when the process has 
terminated but has not been reaped, or when closing an already-closed file.

--
components: +Interpreter Core -Library (Lib)
nosy: +vadmium

___
Python tracker 

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



[issue6973] subprocess.Popen.send_signal doesn't check whether the process has terminated

2014-08-17 Thread Martin Panter

Changes by Martin Panter :


--
components: +Library (Lib) -Interpreter Core

___
Python tracker 

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