[issue16241] -X faulthandler is not documented in -X option docs

2012-10-25 Thread Petri Lehtinen

Petri Lehtinen added the comment:

Andrew: Generally all changes deserve a Misc/NEWS entry, see:

  http://docs.python.org/devguide/committing.html#news-entries

The feature was new in 3.3, but this change only went in after the release of 
3.3.0, so ISTM that a Misc/NEWS entry is required.

--

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



[issue15494] Move test/support.py into a test.support subpackage

2012-10-25 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 test.support will become a package in 3.3 and trunk after the final 3.2
 release goes out.
 
 Excessively large source files are a sign of bad software design.

Do you weigh in the python-dev discussion about splitting
unicodeobject.c?

--

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



[issue15494] Move test/support.py into a test.support subpackage

2012-10-25 Thread Antoine Pitrou

Antoine Pitrou added the comment:

s/Do you weigh in/Do you want to weigh in/, sorry.

--

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



[issue15494] Move test/support.py into a test.support subpackage

2012-10-25 Thread Chris Jerdonek

Chris Jerdonek added the comment:

 Excessively large source files are a sign of bad software design.

 Do you [want to] weigh in the python-dev discussion about splitting
 unicodeobject.c?

Nick did weigh in starting here:

http://mail.python.org/pipermail/python-dev/2012-October/122391.html

--

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



[issue16319] optional comma inside function argument list triggers syntax error

2012-10-25 Thread Inyeol Lee

New submission from Inyeol Lee:

Ubuntu 12.04, python 3.2.3

Optional trailing comma causes syntax error if used for keyword-only argument 
list:

These are OK --
def f(a, b,): pass
def f(a, b=None,): pass

These triggers syntax error --
def f(a, *, b,): pass
def f(a, *, b=None,): pass

python 3.1 and 3.2 shows this error, not tested for 3.3 yet.

--
components: Interpreter Core
messages: 173735
nosy: Inyeol.Lee
priority: normal
severity: normal
status: open
title: optional comma inside function argument list triggers syntax error
type: behavior
versions: Python 3.2

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



[issue15494] Move test/support.py into a test.support subpackage

2012-10-25 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Ah, ok. Perhaps I should read python-dev before talking about it!

--

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



[issue15494] Move test/support.py into a test.support subpackage

2012-10-25 Thread Nick Coghlan

Nick Coghlan added the comment:

I already did, that thread 'tis a large part of why I'm somewhat irritable in 
relation to this topic today. Huge source files are inherently bad because 
they provide no hint as to the modular breakdown and encourage excessive 
coupling between subcomponents is just such a basic assumption of physical 
software design that I'm completely dumbfounded that people are questioning it.

If the objections were I think this particular proposed breakdown is bad, it 
would be one thing, but most of them aren't, they're I don't think it should 
be broken up at all for stupidly trivial reasons that have nothing to do with 
anything.

--

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



[issue16307] multiprocess.pool.map_async callables not working

2012-10-25 Thread Janne Karila

Janne Karila added the comment:

I'm working on the test. It keeps failing...

--

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



[issue16299] __build__ as a temp build directory for setup.py

2012-10-25 Thread anatoly techtonik

anatoly techtonik added the comment:

That's not an argument. I am asking about it in general.

Another wart of Python.

--

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



[issue14616] subprocess docs should mention pipes.quote/shlex.quote

2012-10-25 Thread Chris Rebert

Chris Rebert added the comment:

No, the thought merely did not occur to me. I don't recall having seen such 
forward-looking notes in Python's documentation before.

Should the pipes.quote() mention be axed from the 3.x patch?

--

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



[issue16319] optional comma inside function argument list triggers syntax error

2012-10-25 Thread Chris Jerdonek

Chris Jerdonek added the comment:

I could be misinterpreting the documentation, but it looks to me like the 
examples given are behaving as documented:

parameter_list ::=  (defparameter ,)*
(  * [parameter] (, defparameter)*
[, ** parameter]
| ** parameter
| defparameter [,] )

(from 
http://docs.python.org/dev/reference/compound_stmts.html#function-definitions )

The relevant clause in the above looks to be the following, which can't give 
rise to a trailing comma:

* [parameter] (, defparameter)* [, ** parameter]

--
nosy: +chris.jerdonek

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



[issue16319] optional comma inside function argument list triggers syntax error

2012-10-25 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Duplicate of issue 9232 (enhancement request).

--
resolution:  - duplicate
stage:  - committed/rejected
status: open - closed
superseder:  - Allow trailing comma in any function argument list.

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



[issue16315] Support xz compression in Mac build script

2012-10-25 Thread Ronald Oussoren

Ronald Oussoren added the comment:

For the record: I agree with Ned, the patch is not needed at this time and 
won't work as is anyway (in particular: tar on OSX does not have an 'J' option, 
so even if you install the lzma tools the patch won't work)

--

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



[issue16241] -X faulthandler is not documented in -X option docs

2012-10-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e816851fb30d by Andrew Svetlov in branch '3.3':
Update NEWS for issue #16241
http://hg.python.org/cpython/rev/e816851fb30d

New changeset af93948ca33d by Andrew Svetlov in branch 'default':
Update NEWS for issue #16241
http://hg.python.org/cpython/rev/af93948ca33d

--

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



[issue16241] -X faulthandler is not documented in -X option docs

2012-10-25 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Well, I have updated the NEWS file.

--

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



[issue16309] PYTHONPATH= different from no PYTHONPATH at all

2012-10-25 Thread Armin Rigo

Armin Rigo added the comment:

Attached the diff, in case we want to do that.  The diff is only about 
non-Windows platforms, given that it follows a Posix use case about PATH.  But 
do we also need to change PC/getpathp.c?

--
keywords: +patch
Added file: http://bugs.python.org/file27709/pythonpath.diff

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



[issue16320] Establish order in bytes/string dependencies

2012-10-25 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

The proposed patch reorganizes the dependencies for bytes and strings. Now 
object files depended only from needed (and from all needed) headers. This will 
reduce the compilation time when modifying the bytes implementation.

--
components: Build, Unicode
files: Makefile.pre.in.diff
keywords: patch
messages: 173747
nosy: ezio.melotti, haypo, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Establish order in bytes/string dependencies
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file27710/Makefile.pre.in.diff

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



[issue16315] Support xz compression in Mac build script

2012-10-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

OK. I thought that xz support was just forgot. The xz compression was very 
popular in the Linux distributives over the past few years.

--

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



[issue16320] Establish order in bytes/string dependencies

2012-10-25 Thread Serhiy Storchaka

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


--
stage:  - patch review

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



[issue16321] Move eq.h out of stringlib

2012-10-25 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

The Objects/stringlib directory used for templates which instantiates for 
specified bytes or unicode kinds. Objects/stringlib/eq.h has no relation to 
this templates and should be moved out (as Objects/unicode_eq.h for example).

Also it should be removed from Include/Python.h. It used only in 
Objects/dictobject.c and Objects/setobject.c, and included there directly.

--
components: Interpreter Core, Unicode
messages: 173749
nosy: ezio.melotti, haypo, serhiy.storchaka
priority: normal
severity: normal
stage: needs patch
status: open
title: Move eq.h out of stringlib
type: enhancement
versions: Python 3.4

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



[issue16318] FTP_TLS in ftplib not supporting prot_p storlines in FTP7.5

2012-10-25 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

Have you tried to see what happens in passive mode (use: ftps.set_pasv(True))?

--

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



[issue16305] possible segfault in math.factorial

2012-10-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 19ed42e84030 by Mark Dickinson in branch '3.3':
Issue #16305: Merge fix from 3.2.
http://hg.python.org/cpython/rev/19ed42e84030

New changeset cbdd6852a274 by Mark Dickinson in branch 'default':
Issue #16305: Merge fix from 3.3.
http://hg.python.org/cpython/rev/cbdd6852a274

--
nosy: +python-dev

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



[issue16307] multiprocess.pool.map_async callables not working

2012-10-25 Thread Janne Karila

Janne Karila added the comment:

Three test cases added. 

The tricky part in writing the tests was to realize that when the tests are run 
with Manager, the callback goes through a proxy object.

--
Added file: http://bugs.python.org/file27711/test_callback.patch

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



[issue16305] possible segfault in math.factorial

2012-10-25 Thread Mark Dickinson

Mark Dickinson added the comment:

Fixed in 3.2, 3.3 and default.  Thanks Amaury for the report and diagnosis!

(I forget to add the issue number in the 3.2 commit:  the changeset is 
b4bfcf7a4773.)

--
resolution:  - fixed
status: open - closed

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



[issue16310] zipfile: allow surrogates in filenames

2012-10-25 Thread Stefan Holek

Stefan Holek added the comment:

What we are trying to do is make distribute work with non-ASCII filenames, and 
this is one of the things we ran into.

Fact 1: Filenames are bytes, whether you like it or not. Treating them as 
strings is going to give you more trouble than dragging the bytes along.

Fact 2: Surrogates are Python 3's way of dealing with bytes.

Fact 3: What follows is that surrogates must be supported wherever Python 3 
deals with filenames.

Fact 4: This is a *bug* since Python breaks its own rules here (I have removed 
the enhancement marker). The issue is not what ZIP can do, but what Python 3 
*must* do. Creating a potentially non-standard ZIP file is fine, exploding in 
the user's face is not.

--
type: enhancement - 
versions: +Python 3.3

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



[issue16322] time.tzname on Python 3.3.0 for Windows is decoded by wrong encoding

2012-10-25 Thread Masami HIRATA

New submission from Masami HIRATA:

OS: Windows 7 Starter Edition SP1 (32-bit) Japanese version
Python: 3.3.0 for Windows x86 (python-3.3.0.msi)

time.tzname on Python 3.3.0 for Windows is decoded by wrong encoding.

C:\Python33python.exe
Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:55:48) [MSC v.1600 32 bit (In
tel)] on win32
Type help, copyright, credits or license for more information.
 import time
 time.tzname[0]
'\x93\x8c\x8b\x9e (\x95W\x8f\x80\x8e\x9e)'
 time.tzname[0].encode('iso-8859-1').decode('mbcs')
'東京 (標準時)'


'東京 (標準時)' means 'Tokyo (Standard Time)' in Japanese.
time.tzname on Python 3.2.3 for Windows works correctly.

C:\Python32python.exe
Python 3.2.3 (default, Apr 11 2012, 07:15:24) [MSC v.1500 32 bit (Intel)] on win
32
Type help, copyright, credits or license for more information.
 import time
 time.tzname[0]
'東京 (標準時)'


--
components: Windows
messages: 173755
nosy: msmhrt
priority: normal
severity: normal
status: open
title: time.tzname on Python 3.3.0 for Windows is decoded by wrong encoding
type: behavior
versions: Python 3.3

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



[issue16310] zipfile: allow surrogates in filenames

2012-10-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

If we allow for surrogates in the names, it will not correct UTF-8.  This can 
breaks other software.

We should clear 11th flag bit in this case.

--

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



[issue15494] Move test/support.py into a test.support subpackage

2012-10-25 Thread Ezio Melotti

Ezio Melotti added the comment:

 Umm, WTF? You're really asking me to justify the basic software
 engineering principle that modularity is good, 

I'm aware of the principle -- what I'm asking is what practical advantages this 
will bring (practicality beats purity).

 and wanting to dump everything in one file is one of the classic signs
 that your architectural design is non-existent and you have completely
 failed to adequately decompose your problem into smaller ones?

As I see it, test.support is a module containing miscellaneous helper functions 
to be used in the tests.  Therefore, if I'm looking for an helper function 
(like assert_python*()), I could just open the file and find it there.
This is especially true for *generic* helper functions, like assert_python* 
(not widely used, see #9517) and temp_dir (duplicated in support.py, see 
#15376).  Both these issues were probably caused by the fact that people didn't 
know about script_helper.py and ended up implementing their own versions of the 
functions either in the test files or in support.py.
Something similar happened with requires_zlib (and possibly a few others) too 
-- it was defined in several test modules before being moved to support.py.

Having several modules doesn't solve the problem of discoverability -- it 
actually make it worse by adding another level of indirection (find what files 
do you have and which one is the right one - find what you are looking for in 
the right file).  I often look at the code from hg.python.org, and ctrl+f there 
clearly covers only one file.  Similarly inspecting/grepping a single file is 
easier than doing it for multiple files, especially if you don't know what the 
other files are.

If people are not trying to find a specific function, but rather want an 
overview of the helper test functions, we could (and should) document them like 
we did with Doc/library/test.rst and have sections there.  For example if I 
`ls` Lib/test/support/ and see a script_helper.py file, I could hardly guess 
that it contains functions to run python in a subprocress.  This could be 
easily explained in the doc.

That said, I should mention that 1) I'm not sure how many other helper modules 
there are around, how big they are, and how well things are already divided; 2) 
I don't know the structure that you want to use for the package.  If you are 
just grouping the existing helper modules in a package and if the namespace is 
kept flat (so that we don't end up with test.support.whatever.TESTFN), then I 
agree that it's an improvement.  If you are planning to further split 
support.py, then I'm -1.

 Huge source files are inherently bad because they
 provide no hint as to the modular breakdown

I can't think off the top of my head of a sensible breakdown for support.py.  I 
can see that the assert/kill/spawn/python functions are all related, but the 
current module division seems to me quite arbitrary.  Why import(_fresh)_module 
and related functions are not on their own module even if they have more code 
than all the assert/kill/spawn_python functions?  Should all the skip/require 
decorators in support.py get their own module?  What about the context manages 
like run_with_locale, temp_dir, temp_umask, EnvironmentVarGuard, etc.?  Why 
script_helper contains helper functions to run python in a subprocess and also 
helper functions for scripts?

 If the objections were I think this particular proposed 
 breakdown is bad

If you suggest a breakdown I can provide better objections, however I think 
it's already broken down enough (and maybe even too much).

 I already did, that thread 'tis a large part of why 
 I'm somewhat irritable in relation to this topic today.

Same here, just in the opposite directions ;)


P.S. incidentally the other day someone asked me where unittest.main was 
defined because he couldn't find it using Find in files.  We tried looking in 
__main__.py and __init__.py for def main and it wasn't there, but we noticed 
a from .main import TestProgram, main.  So we looked in main.py for a def 
main and still couldn't find it, so we looked for just main.  Eventually we 
found a main = TestProgram at the very bottom of main.py.

--

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



[issue16322] time.tzname on Python 3.3.0 for Windows is decoded by wrong encoding

2012-10-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I see in 3.3 PyUnicode_DecodeFSDefaultAndSize() was replaced by 
PyUnicode_DecodeLocale().

What show sys.getdefaultencoding(), sys.getfilesystemencoding(), and 
locale.getpreferredencoding()?

--
components: +Extension Modules
keywords: +3.3regression
nosy: +serhiy.storchaka
versions: +Python 3.4

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



[issue14616] subprocess docs should mention pipes.quote/shlex.quote

2012-10-25 Thread Andrew Svetlov

Andrew Svetlov added the comment:

I think patch for 3.3 should mention only shlex.quote.
I don't care about 2.7 patch but it looks good to me.

--
nosy: +asvetlov

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



[issue16323] Wrong C API documentation for locale encoding

2012-10-25 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

The documentation for PyUnicode_DecodeLocale() and PyUnicode_EncodeLocale() are 
wrong. The second parameter described as int surrogateescape, but actually it 
is const char *errors.

--
assignee: docs@python
components: Documentation, Unicode
messages: 173760
nosy: docs@python, ezio.melotti, serhiy.storchaka
priority: normal
severity: normal
stage: needs patch
status: open
title: Wrong C API documentation for locale encoding
type: behavior
versions: Python 3.3, Python 3.4

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



[issue16272] C-API documentation clarification for tp_dictoffset

2012-10-25 Thread Andrew Svetlov

Changes by Andrew Svetlov andrew.svet...@gmail.com:


--
nosy: +asvetlov

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



[issue13510] Clarify that readlines() is not needed to iterate over a file

2012-10-25 Thread Éric Araujo

Éric Araujo added the comment:

readlines might be discouraged; readline has its use cases (two days ago I used 
it to get one line to pass to csv.Sniffer.sniff), but next(file) works too, so 
it could be de-emphasized.  There may be a difference with respect to the 
trailing newline however; I don’t remember if __iter__ or readline keep it or 
not.

--

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



[issue13510] Clarify that readlines() is not needed to iterate over a file

2012-10-25 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
keywords: +easy
versions: +Python 3.4

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



[issue15494] Move test/support.py into a test.support subpackage

2012-10-25 Thread Martin v . Löwis

Martin v. Löwis added the comment:

Since basic software engineering principles have been invoked, I'd like to 
point out that many of the standard motivations to modularization don't apply 
in this case. So it is fair to ask what *specific* benefits such a 
restructuring may have. Such a description is necessary in advance in order to 
determine whether a specific restructuring actually achieves the stated 
objectives.

In the Wikipedia article on Modular programming, the main advantage (as in 
top-down  design) is that you can decompose a yet-to-be-built system upfront, 
and split the work into several teams, which then can develop the system 
independently, and only need to integrate at the end. This is less relevant as 
the system in question is already built.

Another motivation given in Wikipedia is reuse in different systems. There 
isn't really any reuse planned for the code in question, but perhaps reuse in 
other Python implementations would make a point. If that is the motivation, the 
split should be to separate CPython support code from other support code.

The wikipedia article also claims that the code is easier to debug, update, and 
modify. Easier modification may come from the notion of abstract interfaces: 
the module implementation can be changed without affecting module use (if the 
interfaces are unchanged. For this case, the code is already at a module 
boundary (of the support module); I fail to see why further modularization 
would improve anything.

Easier debugging may come from less code being involved in a certain code path. 
Mere refactoring cannot improve that. You have to rewrite the functions, but 
that would be possible even without splitting the module.

--

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



[issue16309] PYTHONPATH= different from no PYTHONPATH at all

2012-10-25 Thread Armin Rigo

Armin Rigo added the comment:

Attached another simpler diff (only one + line instead of two...).

--
Added file: http://bugs.python.org/file27712/pythonpath2.diff

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



[issue16324] MIMEText __init__ does not support Charset instance

2012-10-25 Thread Claude Paroz

New submission from Claude Paroz:

When initializing a MIMEText instance, it might be desirable to set the 
_charset parameter to a real Charset instance, not only a charset identifier 
(for example to pass a Charset with customized body_encoding). Unfortunately, 
this is failing:

  File .../django/core/mail/message.py, line 128, in __init__
MIMEText.__init__(self, text, subtype, charset)
  File /usr/lib/python3.2/email/mime/text.py, line 29, in __init__
**{'charset': _charset})
  File /usr/lib/python3.2/email/mime/base.py, line 25, in __init__
self.add_header('Content-Type', ctype, **_params)
  File /usr/lib/python3.2/email/message.py, line 475, in add_header
parts.append(_formatparam(k.replace('_', '-'), v))
  File /usr/lib/python3.2/email/message.py, line 67, in _formatparam
if value is not None and len(value)  0:
TypeError: object of type 'Charset' has no len()

It is possible to later call set_charset, but the payload is already encoded 
(and 'Content-Transfer-Encoding' is set).
Did I miss anything?

--
components: email
messages: 173764
nosy: barry, claudep, r.david.murray
priority: normal
severity: normal
status: open
title: MIMEText __init__ does not support Charset instance
type: behavior
versions: Python 3.2

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



[issue11160] ZipFile.comment expects bytes

2012-10-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The ZIP specification says:


If general purpose bit 11 is unset, the file name and comment should conform 
to the original ZIP character encoding.  If general purpose bit 11 is set, the 
filename and comment must support The Unicode Standard, Version 4.1.0 or 
greater using the character encoding form defined by the UTF-8 storage 
specification.  The Unicode Standard is published by the The Unicode
Consortium (www.unicode.org).  UTF-8 encoded data stored within ZIP files 
is expected to not include a byte order mark (BOM). 


Also there is extension for UTF-8 encoded file comment.  All this means the 
file comment should be interpreted as an unicode string.

However the specification says nothing about .ZIP file comment (except that 
encryption or data authentication is applied to it).

Since changeset 4186f20d9fa4 ZipFile.comment raises TypeError on try to assign 
non-bytes. I think the documentation should be clarified.

--
components:  -Library (Lib)
nosy: +serhiy.storchaka
stage:  - needs patch
type:  - enhancement
versions: +Python 3.3, Python 3.4

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



[issue16310] zipfile: allow surrogates in filenames

2012-10-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Related issues: issue10614, issue10757, issue10972.

--

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



[issue11009] urllib.splituser is not documented

2012-10-25 Thread Ezio Melotti

Ezio Melotti added the comment:

Doing that now will be backward incompatible, because people might be using 
these functions already even if they are not documented.  An alias could be 
created, but I'm not sure it's worth doing it.

--
nosy: +ezio.melotti
status: pending - open

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



[issue16216] Arithmetic operations with NULL

2012-10-25 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
type:  - behavior

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



[issue16217] Tracebacks are unnecessarily verbose when using 'python -m'

2012-10-25 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
components: +Library (Lib)
nosy: +ezio.melotti
stage:  - needs patch

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



[issue16309] PYTHONPATH= different from no PYTHONPATH at all

2012-10-25 Thread Eric Snow

Eric Snow added the comment:

 Given how confusing it seems, perhaps we should change it to
 adopt a PATH-like behaviour.

Wouldn't that introduce a backward-compatibility issue?  FWIW, otherwise I 
agree that it makes a lot of sense to conform to the same behavior as PATH.

--
nosy: +eric.snow

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



[issue16219] segfault when using xml.etree.ElementTree.XMLTreeBuilder

2012-10-25 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +eli.bendersky
status: pending - open

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



[issue16309] PYTHONPATH= different from no PYTHONPATH at all

2012-10-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM.

--
nosy: +serhiy.storchaka

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



[issue16309] PYTHONPATH= different from no PYTHONPATH at all

2012-10-25 Thread Serhiy Storchaka

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


--
stage:  - commit review

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



[issue16240] Document a way to escape metacharacters in glob/fnmatch

2012-10-25 Thread Ezio Melotti

Ezio Melotti added the comment:

I would use It is possible to remove rather than One can remove, but 
otherwise the patch LGTM.

--
nosy: +eric.araujo, ezio.melotti, terry.reedy
stage: needs patch - patch review

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



[issue16239] PEP8 arithmetic operator examples

2012-10-25 Thread Ezio Melotti

Ezio Melotti added the comment:

Attached a patch that modifies some of the example in the section.

-  x = x * 2 - 1
-  hypot2 = x * x + y * y
+  x = x*2 - 1
+  hypot2 = x*x + y*y

Here I used more space around operators with lower priority.

-  x = x*2 - 1
-  hypot2 = x*x + y*y
-  c = (a+b) * (a-b)
+  x = x * 2-1
+  hypot2 = x*x + y * y
+  c = a+b * a-b

These 3 examples in the No section show respectively:
1) more space around the operator with higher priority;
2) inconsistent spacing around operators with the same priority;
3) misleading spacing (similar to 1);

I don't think it's necessary to mention 'x * 2 - 1' in either sections, because 
it's not wrong, but otoh 'x*2 - 1' is a better alternative.

--
assignee: docs@python - ezio.melotti
keywords: +patch
nosy: +ezio.melotti
stage:  - patch review
Added file: http://bugs.python.org/file27713/issue16239.diff

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



[issue16271] weird dual behavior with changing __qualname__; different values observed through attribute and descriptor

2012-10-25 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti, pitrou
type:  - behavior
versions: +Python 3.4

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



[issue16285] Update urllib to RFC 3986

2012-10-25 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti

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



[issue16286] Optimize a==b and a!=b for bytes and str

2012-10-25 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti
stage:  - patch review

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



[issue16325] PEP 8 refers to reference to PEP 8

2012-10-25 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

PEP 8 refers to Guido's original Python Style Guide essay 
(http://www.python.org/doc/essays/styleguide.html), but the essay was removed, 
only link to PEP 8 (and PEP 257) left.

--
assignee: docs@python
components: Documentation
messages: 173773
nosy: docs@python, serhiy.storchaka
priority: normal
severity: normal
status: open
title: PEP 8 refers to reference to PEP 8
type: behavior

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



[issue16322] time.tzname on Python 3.3.0 for Windows is decoded by wrong encoding

2012-10-25 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

Looking at the CRT source code, tznames should be decoded with mbcs.
See also http://mail.python.org/pipermail/python-3000/2007-August/009290.html

--
nosy: +amaury.forgeotdarc

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



[issue16325] PEP 8 refers to reference to PEP 8

2012-10-25 Thread Ezio Melotti

Ezio Melotti added the comment:

The link might still be OK, otherwise we could copy the note directly in the 
PEP.

--
nosy: +ezio.melotti

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



[issue16239] PEP8 arithmetic operator examples

2012-10-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

-  x = x * 2 - 1
-  hypot2 = x * x + y * y

Why you remove this?

-  c = (a+b) * (a-b)
+  c = a+b * a-b

This changes the semantic.

but otoh 'x*2 - 1' is a better alternative.

Can you justify this?

--
nosy: +serhiy.storchaka

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



[issue16240] Document a way to escape metacharacters in glob/fnmatch

2012-10-25 Thread Fred L. Drake, Jr.

Fred L. Drake, Jr. added the comment:

Better (IMO):

Wrap the meta-characters in brackets for a literal match.  For example, 
``'[?]'`` matches the character ``'?'``.

--
nosy: +fdrake

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



[issue14616] subprocess docs should mention pipes.quote/shlex.quote

2012-10-25 Thread Ezio Melotti

Ezio Melotti added the comment:

 I think patch for 3.3 should mention only shlex.quote.

+1

I'm not sure what's the best thing to do about pipes.quote.  Pointing to an 
undocumented function that is available in 3.3 in a different module doesn't 
sound like a really good idea.
Maybe we could document pipes.quote as an internal/deprecated function so that 
people that follow the link from the subprocess docs will be aware that the 
function is available under a different name in 3.3+.
Otherwise we could just document shlex.quote() in 3.3+.

--
nosy: +ezio.melotti

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



[issue16239] PEP8 arithmetic operator examples

2012-10-25 Thread Ezio Melotti

Ezio Melotti added the comment:

 -  x = x * 2 - 1
 -  hypot2 = x * x + y * y

 Why you remove this?

As I explained in my previous message, even if valid, these are IMHO less clear 
than x*2 - 1 and x*x + y*y.

 -  c = (a+b) * (a-b)
 +  c = a+b * a-b

 This changes the semantic.

It does indeed, but I think it's worth pointing out that misleading spacing 
should be avoided.  Maybe a different example could be used.

 but otoh 'x*2 - 1' is a better alternative.

 Can you justify this?

x*2 - 1  gives a visual hint of what gets executed first,
x * 2-1  gives a wrong/misleading hint of what gets executed first,
x * 2 - 1 gives no hint at all.

I think that providing the correct hint is better than not providing any hints 
(and clearly better than providing the wrong hint!).

--

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



[issue16240] Document a way to escape metacharacters in glob/fnmatch

2012-10-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

My patch was only example.  Commit what you feel is better.

--

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



[issue16240] Document a way to escape metacharacters in glob/fnmatch

2012-10-25 Thread Ezio Melotti

Ezio Melotti added the comment:

For a literal match, wrap the meta-characters in brackets.  For example, 
``'[?]'`` matches the character ``'?'``.

Stating the goal at the beginning of the sentence will make this easier to find 
while skimming through the doc.

--

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



[issue16325] PEP 8 refers to reference to PEP 8

2012-10-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I think there is no sense to refer to removed document. If Guido's original 
essay saved somewhere, than PEP 8 should refer to this copy. Otherwise 
meaningless link should be removed.

--

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



[issue16325] PEP 8 refers to reference to PEP 8

2012-10-25 Thread Ezio Melotti

Ezio Melotti added the comment:

Do you think something like the attached patch would be OK?

--
keywords: +patch
stage:  - patch review
Added file: http://bugs.python.org/file27714/issue16325.diff

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



[issue16239] PEP8 arithmetic operator examples

2012-10-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 As I explained in my previous message, even if valid, these are IMHO less 
 clear than x*2 - 1 and x*x + y*y.

I don't feel this.  Anyone else feel this?  It seems to me, this is a serious 
change in the Style Guide.

 It does indeed, but I think it's worth pointing out that misleading spacing 
 should be avoided

I think this example shows that even without misleading such spacing is not 
good.  The destructiveness of misleading spacing is evident for all.

--

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



[issue16322] time.tzname on Python 3.3.0 for Windows is decoded by wrong encoding

2012-10-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

As I understand, OP has UTF-8 locale.

--

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



[issue16239] PEP8 arithmetic operator examples

2012-10-25 Thread Ezio Melotti

Ezio Melotti added the comment:

As I see it:
For  c = (a + b) * (a - b)  the hint (and the actual priority) is given by the 
(), the spaces around the +/- are not necessary but don't affect readability.
For  c = (a+b) * (a-b)  the hints are given both by the () and the spacing, the 
lack of spaces around the +/- is not necessary but doesn't affect readability.
For  c = a+b * a-b  the hints are given both by the spacing and they are wrong.

--

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



[issue16325] PEP 8 refers to reference to PEP 8

2012-10-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM, but I'm not well competent to assess these changes.

--

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



[issue14799] Tkinter ttk tests hang on linux

2012-10-25 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Update: test_ttk_guionly hangs on Ubuntu with Unity.
It passed on Arch as well as on Ubuntu via xvfb-run.

--

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



[issue14799] Tkinter ttk tests hang on linux

2012-10-25 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Fir Unity it hangs on Tcl_ConditionWait inside Tcl_DoOneEvent function.

--

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



[issue14799] Tkinter ttk tests hang on linux

2012-10-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

For me it passed with Openbox and Compiz, but fails with KWin.

--

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



[issue15494] Move test/support.py into a test.support subpackage

2012-10-25 Thread Chris Jerdonek

Chris Jerdonek added the comment:

 If you are planning to further split support.py, then I'm -1.

Ezio, this issue is not to split up support.py.  Nick already responded to you 
to this effect in the fourth comment above.  Also, in the second comment to 
this issue, I said that this issue was to move support.py as is into 
support/__init__.py, and then to move script_helper.py as is into the package.

 Having several modules doesn't solve the problem of discoverability

We already have more than one module.  This issue helps discoverability by 
grouping them in one place so people know what support modules there are.  In 
other words, this issue addresses the following problem you mentioned:

Both these issues were probably caused by the fact that people didn't know 
about script_helper.py and ended up implementing their own versions of the 
functions either in the test files or in support.py.  Something similar 
happened with requires_zlib (and possibly a few others)...

 So it is fair to ask what *specific* benefits such a restructuring may have.

Martin, see the paragraph above.  In addition, this change makes it easier to 
search whatever support modules we have.  It also provides a place to put new 
support modules to avoid further exacerbating the discoverability problem 
stated above.

--

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



[issue15494] Move test/support.py into a test.support subpackage

2012-10-25 Thread Ezio Melotti

Ezio Melotti added the comment:

 Ezio, this issue is not to split up support.py.  Nick already responded
 to you to this effect in the fourth comment above.

Indeed, I should have re-read the messages more carefully.

 Also, in the second comment to this issue, I said that this issue was
 to move support.py as is into support/__init__.py, and then to move
 script_helper.py as is into the package.

 We already have more than one module. 

Are there other modules except these two?  Because if the package will only 
group these two, I think it's better/easier to merge script_helper.py in 
support.py.

As I said in the previous message I don't see why the spawn/kill/assert_python 
functions should be in a separate file and the import_fresh_module ones 
shouldn't.  Even if having these two files in the same package will make 
discoverability easier it still seems an arbitrary division.

--

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



[issue15494] Move test/support.py into a test.support subpackage

2012-10-25 Thread R. David Murray

R. David Murray added the comment:

Every sizeable (and some not-so-sizeable) Python projects I've worked on have 
one or more 'utils' modules that collect stuff that doesn't logically fit 
elsewhere.  That's what test.support is for the test infrastructure.

I agree that we should not talk in generalities.  As Martin has indicated, 
appeal to authority in the form of basic software engineering principles is 
not enough by itself.  We should look at specific proposals and decide based on 
specific arguments whether they will improve matters.  And yes, their status as 
good engineering principles is meaningful, but only if the reasons for those 
specific principles actually apply in the specific case.

Certainly making the functions in script_helpers more discoverable is a 
laudable goal.

As an aside: I've worked on a project that is well modularized if you judge by 
the number and size of the source files (if you ignore a few single-class files 
created by former java programmers)...but it didn't follow any of the logical 
reasons Martin quoted for modularization: finding things in the source base was 
a pain, and different responsibility groups were responsible for files spread 
across the source tree and wound up stepping on each other's toes, and 
debugging was not aided by the source structure because while the APIs started 
out reasonably well defined they did not stay that way...because the 
responsibility areas were not well defined or maintained.  *Why* you 
modularize, and *how* you modularize, are much more important than file size.

--

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



[issue16155] Some minor doc fixes in Doc/faq

2012-10-25 Thread Andrew Svetlov

Changes by Andrew Svetlov andrew.svet...@gmail.com:


--
nosy: +asvetlov

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



[issue16322] time.tzname on Python 3.3.0 for Windows is decoded by wrong encoding

2012-10-25 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
nosy: +belopolsky, haypo

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



[issue16324] MIMEText __init__ does not support Charset instance

2012-10-25 Thread R. David Murray

R. David Murray added the comment:

I don't think you missed anything.  It doesn't look like this has ever worked, 
but you'd certainly think it would.  The documentation doesn't claim anything 
about it one way or another.  That probably means we should treat it as an 
enhancement rather than a bug fix, but I'm open to argument on that.

--

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



[issue16324] MIMEText __init__ does not support Charset instance

2012-10-25 Thread Claude Paroz

Claude Paroz added the comment:

It's fine for me to consider it as an enhancement. The fix might be as simple 
as replacing **{'charset': _charset} by **{'charset': str(_charset)} in 
MIMEText __init__.

--

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



[issue15066] make install error: ImportError: No module named _struct

2012-10-25 Thread Antonio Chay

Antonio Chay added the comment:

Hello there!
I have the same issue, using CentOS 5.8, I *reversed* this patch:

http://bugs.python.org/issue8205

and now make install works.

A side note: before it failed to compile _multiprocessing, with the patch 
reversed now is included.

HTH.
Regards!

--
nosy: +chay

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



[issue16326] distutils build_ext fails to set library_dirs in 2.7.2 on Linux

2012-10-25 Thread Andy Salnikov

New submission from Andy Salnikov:

Hi,

when trying to build extension modules with distutils I ran into
a problem that linking fails with an errors like:

gcc -pthread -shared -L build/temp.linux-x86_64-2.7/h5py/defs.o 
-L/reg/g/psdm/sw/external/hdf5/1.8.4p1/x86_64-rhel6-gcc44-opt/lib -L. 
-Wl,-R/reg/g/psdm/sw/external/hdf5/1.8.4p1/x86_64-rhel6-gcc44-opt/lib -lhdf5 
-lpython2.7 -o build/lib.linux-x86_64-2.7/h5py/defs.so
/usr/bin/ld: cannot find -lpython2.7
collect2: ld returned 1 exit status

For some reason location of the python library is not added to the 
command line with -L option.

I tracked the reason down to a particular environment that we have, 
in out environment python executable found in a $PATH is a symbolic link
to a binary installed in some non-standard location. I believe this 
piece of code in build_ext.py fails to realize this:

if sys.executable.startswith(os.path.join(sys.exec_prefix, bin)):
# building third party extensions
self.library_dirs.append(sysconfig.get_config_var('LIBDIR'))
else:
# building python standard extensions
self.library_dirs.append('.')

apparently sys.executable in our case refers to a symlink path, while 
sys.exec_prefix refers to actual installation directory.

I think fix for our case should be easy (I can't say about other cases
which may be broken by this logic), one just need to apply os.path.realpath()
to sys.executable before comparing it to sys.exec_prefix.

Andy

--
assignee: eric.araujo
components: Distutils
messages: 173796
nosy: Andy.Salnikov, eric.araujo, tarek
priority: normal
severity: normal
status: open
title: distutils build_ext fails to set library_dirs in 2.7.2 on Linux
type: compile error
versions: Python 2.7

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



[issue15392] Create a unittest framework for IDLE

2012-10-25 Thread Roger Serwy

Roger Serwy added the comment:

Issue7883 also has a test.

--

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



[issue16322] time.tzname on Python 3.3.0 for Windows is decoded by wrong encoding

2012-10-25 Thread STINNER Victor

STINNER Victor added the comment:

I see in 3.3 PyUnicode_DecodeFSDefaultAndSize() was replaced
 by PyUnicode_DecodeLocale().

Related changes:

 - 8620e6901e58 for the issue #5905
 - 279b0aee0cfb for the issue #13560

I wrote 8620e6901e58 for Linux, when the wcsftime() function is missing.

The problem is the changeset 279b0aee0cfb: it introduces a regression on 
Windows. It looks like PyUnicode_DecodeFSDefault() and 
PyUnicode_DecodeFSDefault() use a different encoding on Windows.

I suppose that we need to add an #ifdef MS_WINDOWS to use 
PyUnicode_DecodeFSDefault() on Windows, and PyUnicode_DecodeFSDefault() on 
Linux.

See also the issue #10653: time.strftime() uses strftime() (bytes) instead of 
wcsftime() (unicode) on Windows, because wcsftime() and tzname format the 
timezone differently.

--

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



[issue15494] Move test/support.py into a test.support subpackage

2012-10-25 Thread Martin v . Löwis

Martin v. Löwis added the comment:

This may increasingly get off-topic, so I'll stop with generalities after this 
post.

I find the effect of modularization on discoverability to be two-sided.

On the one hand, splitting functionality into groups helps discoverability, 
since you don't have to wade through tons of API, and the risk to see but not 
to recognize is reduced.

OTOH, the risk of entirely ignoring some functionality because it is placed 
somehwere where you wouldn't expect it is increased. The classical example is 
the the gethostname() function, which many people wouldn't expect in the socket 
module.

I have personally given up on expecting logical grouping when trying to find 
functionality (not just in Python, but in general). Instead, I rely on 
full-text search, which works reasonably well these days. I do use modularity 
when studying close friends related to some API I already know.

--

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



[issue16318] FTP_TLS in ftplib not supporting prot_p storlines in FTP7.5

2012-10-25 Thread Jeremy Brock

Jeremy Brock added the comment:

Hello Giampaolo,

It is the same timeout in PASV with Prot_P, please see attached documentation.  
Something I did not mention before is that the file being written shows up on 
the server but I can't view it because it is being used by another process. 
When the timeout occurs the file disappears - see attached images.

~Jeremy

--
Added file: http://bugs.python.org/file27715/FTP7.5 Issues Documentation - 
PASV.zip

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



[issue16306] Multiple error line for unknown command line parameter

2012-10-25 Thread Hieu Nguyen

Hieu Nguyen added the comment:

Submitted another patchs for py3k and python 2.7

--
Added file: http://bugs.python.org/file27716/issue16306_py3.patch

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



[issue16306] Multiple error line for unknown command line parameter

2012-10-25 Thread Hieu Nguyen

Changes by Hieu Nguyen ndhie...@gmail.com:


Added file: http://bugs.python.org/file27717/issue16306_py27.patch

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



[issue9192] Add a a way to determine float format

2012-10-25 Thread Hieu Nguyen

Changes by Hieu Nguyen ndhie...@gmail.com:


--
nosy: +hieu.nguyen

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



[issue9192] Add a a way to determine float format

2012-10-25 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti
stage:  - needs patch

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



[issue16243] Add example for inspect module doc

2012-10-25 Thread Berker Peksag

Berker Peksag added the comment:

Here's a patch that adds an example of using `inspect.formatargspec`.

--
keywords: +patch
nosy: +berker.peksag
Added file: http://bugs.python.org/file27718/inspect-formatargspec-example.patch

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



[issue11060] distutils2 sdist does not complain about version that is not PEP 386 compliant

2012-10-25 Thread Berker Peksag

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


--
nosy:  -berker.peksag

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



[issue11880] add a {dist-info} category to distutils2

2012-10-25 Thread Berker Peksag

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


--
nosy:  -berker.peksag

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



[issue16163] Wrong name in Lib/pkgutil.py:iter_importers

2012-10-25 Thread Berker Peksag

Berker Peksag added the comment:

Chris, did you have a chance to review the patch I submitted?

The only usage of `iter_importers` function in stdlib is in
`iter_modules` function:

http://hg.python.org/cpython/file/cbdd6852a274/Lib/pkgutil.py#l139

--

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



[issue16327] subprocess.Popen leaks file descriptors on os.fork() failure

2012-10-25 Thread Mark Gius

New submission from Mark Gius:

When subprocess.Popen is called with subprocess.PIPE and os.fork() fails (due 
to insufficient memory for example), the pipes created by _get_handles() are 
not closed.

Steps to reproduce:

1) Launch a python shell, import subprocess
2) Create a situation where os.fork() will fail (I ran a program to eat up 
nearly all of the memory on a system)
3) subprocess.Popen('/bin/echo', stdin=subprocess.PIPE)
4) OSError(12, 'Cannot allocate memory')
5) ls /proc/$pid/fd , There are now extra pipes.

I tested on Ubuntu 11.10 python (2.7.2-5ubuntu1).  My reading of the 2.7 and 
3.3 development trees suggest that this is an issue with both of those 
branches, but I don't have a 3.3 installation to confirm with.

I've attached a snippet that fixes it for my version of Python on Ubuntu.  No 
idea what ramifications it will have for other versions/OS/etc.  No automated 
testing included because I'm not entirely sure how to replicate this without 
eating up a ton of ram or doing something naughty with ulimit.

--
components: Library (Lib)
files: fd_leak_fix.diff
keywords: patch
messages: 173804
nosy: Mark.Gius
priority: normal
severity: normal
status: open
title: subprocess.Popen leaks file descriptors on os.fork() failure
type: resource usage
versions: Python 2.7
Added file: http://bugs.python.org/file27719/fd_leak_fix.diff

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



[issue16327] subprocess.Popen leaks file descriptors on os.fork() failure

2012-10-25 Thread Antoine Pitrou

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


--
nosy: +gregory.p.smith, neologix
stage:  - patch review
versions: +Python 3.2, Python 3.3, Python 3.4

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



[issue16306] Multiple error line for unknown command line parameter

2012-10-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM.

--
nosy: +serhiy.storchaka
stage:  - commit review

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



[issue16322] time.tzname on Python 3.3.0 for Windows is decoded by wrong encoding

2012-10-25 Thread Masami HIRATA

Masami HIRATA added the comment:

 What show sys.getdefaultencoding(), sys.getfilesystemencoding(), and 
 locale.getpreferredencoding()?

C:\Python33python.exe
Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:55:48) [MSC v.1600 32 bit (In
tel)] on win32
Type help, copyright, credits or license for more information.
 import sys
 sys.getdefaultencoding()
'utf-8'
 sys.getfilesystemencoding()
'mbcs'
 import locale
 locale.getpreferredencoding()
'cp932'


'cp932' is the same as 'mbcs' in the Japanese environment.

--

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



[issue12317] inspect.getabsfile() is not documented

2012-10-25 Thread Hieu Nguyen

Changes by Hieu Nguyen ndhie...@gmail.com:


--
nosy: +hieu.nguyen

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



[issue14266] pyunit script as shorthand for python -m unittest

2012-10-25 Thread Hieu Nguyen

Changes by Hieu Nguyen ndhie...@gmail.com:


--
nosy: +hieu.nguyen

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



[issue16327] subprocess.Popen leaks file descriptors on os.fork() failure

2012-10-25 Thread Mark Gius

Mark Gius added the comment:

Just read the docs for stdin and stdout.  This patch will indtroduce a bug 
where a provided file descriptor can be closed.  This definitely shouldn't 
close a file descriptor that isn't created by _get_handles().  I'll update.

--

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



[issue16327] subprocess.Popen leaks file descriptors on os.fork() failure

2012-10-25 Thread Mark Gius

Mark Gius added the comment:

Patch now only closes pipe fds created by Popen

--
Added file: http://bugs.python.org/file27720/fd_leak_fix_v2.diff

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



[issue4202] Multiple interpreters and readline module hook functions.

2012-10-25 Thread Winston451

Winston451 added the comment:

Hi,

I'm currently developping an application which runs sub interpreters in threads 
(one sub interpreter per thread). When I try to use readline completion in 
these sub interpreters it fails because it's not possible to import the 
keyword module (PyEval_GetRestricted() returns true). I think it is due to 
the fact that readline's on_completion() use PyGILState_Ensure(). It should be 
possible to use PyEval_RestoreThread with _PyOS_ReadlineTState instead.

--
nosy: +Winston451
status: pending - open

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



[issue16327] subprocess.Popen leaks file descriptors on os.fork() failure

2012-10-25 Thread Gregory P. Smith

Changes by Gregory P. Smith g...@krypto.org:


--
assignee:  - gregory.p.smith

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



  1   2   >