[issue9749] tuple-to-list conversion

2010-09-03 Thread Pyry Säilä

Pyry Säilä  added the comment:

Ah, I see. What a stupid error. My apologies.

--

___
Python tracker 

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



[issue9750] sqlite3 iterdump fails on column with reserved name

2010-09-03 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +ghaering
versions: +Python 3.2

___
Python tracker 

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



[issue9750] sqlite3 iterdump fails on column with reserved name

2010-09-03 Thread Gerhard Häring

Changes by Gerhard Häring :


--
assignee:  -> ghaering

___
Python tracker 

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



[issue4111] Add Systemtap/DTrace probes

2010-09-03 Thread anatoly techtonik

Changes by anatoly techtonik :


--
nosy: +techtonik

___
Python tracker 

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



[issue9750] sqlite3 iterdump fails on column with reserved name

2010-09-03 Thread Marko Kohtala

Marko Kohtala  added the comment:

The second patch contains also fixes for some places where the rules described 
in http://www.sqlite.org/lang_keywords.html are not followed.

--
Added file: http://bugs.python.org/file18722/sqlite3ident.patch

___
Python tracker 

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



[issue7077] SysLogHandler can't handle Unicode

2010-09-03 Thread Vinay Sajip

Vinay Sajip  added the comment:

Fix backported to release27-maint (r84445).

Python 2.6 and earlier are in security-fix-only mode.

--

___
Python tracker 

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



[issue9576] logging.addLevelName in file-based configurations

2010-09-03 Thread Vinay Sajip

Vinay Sajip  added the comment:

No feedback on this after two weeks, so closing.

--
status: pending -> closed

___
Python tracker 

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



[issue9751] _PyInstance_Lookup() defeats its purpose

2010-09-03 Thread Armin Rigo

New submission from Armin Rigo :

_PyInstance_Lookup() is documented as follows:

The point of this routine is that it never calls arbitrary Python
code, so is always "safe":  all it does is dict lookups.

But of course dict lookups can call arbitrary Python code.  This function has 
no purpose, because it's not possible to be "safe".  I checked in a crasher:

http://svn.python.org/projects/python/branches/release27-maint/Lib/test/crashers/gc_has_finalizer.py

--
components: Interpreter Core
messages: 115426
nosy: arigo
priority: low
severity: normal
stage: needs patch
status: open
title: _PyInstance_Lookup() defeats its purpose
type: crash
versions: Python 2.7

___
Python tracker 

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



[issue9576] logging.addLevelName in file-based configurations

2010-09-03 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

You set it to "won't fix", that's why I didn't give you any feedback.

In general, if you provides features programatically *and* via configuration, 
it makes sense to provide the whole set on both sides.

IOW, if you don't want a feature to be used by third-party apps, it should not 
be exposed at all.

--

___
Python tracker 

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



[issue9752] MSVC Compiler warning in Python\import.c

2010-09-03 Thread Daniel Stutzbach

New submission from Daniel Stutzbach :

7>..\Python\import.c(1158) : warning C4013: 'mkdir' undefined; assuming extern 
returning int

--
assignee: stutzbach
components: Interpreter Core, Windows
keywords: easy
messages: 115428
nosy: stutzbach
priority: low
severity: normal
stage: needs patch
status: open
title: MSVC Compiler warning in Python\import.c
versions: Python 3.2

___
Python tracker 

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



[issue9726] logging.handlers.RotatingFileHandler: implement "preserve log file name extension" feature

2010-09-03 Thread Vinay Sajip

Vinay Sajip  added the comment:

You can do this by subclassing RotatingFileHandler and overriding doRollover, 
as per this example:

http://plumberjack.blogspot.com/2010/09/using-custom-file-naming-scheme-for.html

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

___
Python tracker 

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



[issue8420] Objects/setobject.c contains unsafe code

2010-09-03 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Fixed in r84447

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

___
Python tracker 

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



[issue9576] logging.addLevelName in file-based configurations

2010-09-03 Thread Vinay Sajip

Vinay Sajip  added the comment:

I set to "pending" and "wontfix" to indicate what my proposed resolution was, 
and to await feedback - sorry for the misunderstanding.

The custom levels feature is not intended to be used casually (as it will cause 
unpredictable behaviour when used differently in different third-party 
libraries), but there are less common application-level scenarios (where 
logging interoperability is less of an issue) where custom levels might be 
needed - which is why they are provided.

It seems acceptable to me to have different conventions for third-party code 
and application code. For example, NullHandler is recommended for use with 
third-party libraries but is not especially useful for applications.

Configuration is not intended to *completely* cover the programmatic API - just 
to make it easier to do the most commonly-required things.

--

___
Python tracker 

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



[issue9753] test_socket.testDup, testFromFd fail on Windows

2010-09-03 Thread Daniel Stutzbach

New submission from Daniel Stutzbach :

The errors below show up on my XP machine in Python 3.1 as well as a recent 
build from the py3k branch.  I'm not sure why they *don't* show up on the XP 
buildbot.

fromfd() ultimately calls dup(), so the underlying problem is likely the same 
for all the failures.  dup() support was added for Windows in issue1378.

==
ERROR: testDup (test.test_socket.BasicTCPTest)
--
Traceback (most recent call last):
  File "C:\Python31\lib\test\test_socket.py", line 628, in testDup
msg = sock.recv(1024)
socket.error: [Errno 10038] An operation was attempted on something that is not 
a socket

==
ERROR: testFromFd (test.test_socket.BasicTCPTest)
--
Traceback (most recent call last):
  File "C:\Python31\lib\test\test_socket.py", line 619, in testFromFd
msg = sock.recv(1024)
socket.error: [Errno 10038] An operation was attempted on something that is not 
a socket

==
ERROR: testDup (test.test_socket.BasicTCPTest2)
--
Traceback (most recent call last):
  File "C:\Python31\lib\test\test_socket.py", line 628, in testDup
msg = sock.recv(1024)
socket.error: [Errno 10045] The attempted operation is not supported for the 
type of object referenced

==
ERROR: testFromFd (test.test_socket.BasicTCPTest2)
--
Traceback (most recent call last):
  File "C:\Python31\lib\test\test_socket.py", line 619, in testFromFd
msg = sock.recv(1024)
socket.error: [Errno 10038] An operation was attempted on something that is not 
a socket

--

--
components: Library (Lib), Windows
messages: 115432
nosy: brian.curtin, christian.heimes, roudkerk, stutzbach, tim.golden
priority: normal
severity: normal
status: open
title: test_socket.testDup, testFromFd fail on Windows
type: behavior
versions: Python 3.1, Python 3.2

___
Python tracker 

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



[issue9744] calling __getattribute__ with wrong instance causes hang up

2010-09-03 Thread Andreas Stührk

Andreas Stührk  added the comment:

Actually, Python behaves the way you expect it. The problem is that when that 
exception is created, Python tries to look up the involved class names. To do 
that, it tries to get the "__class__" attribute (hapens in 
`getinstclassname()`, which will call again into A's `__getattibute__`, which 
will raise again, and for that new exception, "__class__" will be looked up, 
which will call into `__getattribute__` again, which will raise again and that 
goes on and on until finally the recursion limit is hit and a recursion error 
is raised. That recursion error will be discarded by `getinstclassname()`. 
Hence it's not really a hangup, it just takes a lot of time due to the 
recursive calls. Try your example with a recursion limit set to a really small 
value to see the expected behaviour.

--
nosy: +Trundle

___
Python tracker 

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



[issue9754] assertWarns and assertWarnsRegexp

2010-09-03 Thread Antoine Pitrou

New submission from Antoine Pitrou :

Similar to assertRaises and assertRaisesRegexp, unittest should provide 
assertWarns and assertWarnsRegexp, to check that a given callable (or piece of 
code) triggers a particular warning.

Currently, you have to do that manually using a mixture of 
warnings.catch_warnings and warnings.filterwarnings, which is pretty annoying.

--
components: Library (Lib)
messages: 115434
nosy: brett.cannon, michael.foord, pitrou
priority: normal
severity: normal
stage: needs patch
status: open
title: assertWarns and assertWarnsRegexp
type: feature request
versions: Python 3.2

___
Python tracker 

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



[issue8649] Py_UNICODE_* functions are undocumented

2010-09-03 Thread Nick Coghlan

Nick Coghlan  added the comment:

For this one, I suggest adding something to 
http://docs.python.org/dev/c-api/unicode.html#plain-py-unicode

--
nosy: +ncoghlan

___
Python tracker 

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



[issue9754] assertWarns and assertWarnsRegexp

2010-09-03 Thread Michael Foord

Michael Foord  added the comment:

+1

--

___
Python tracker 

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



[issue8654] Improve ABI compatibility between UCS2 and UCS4 builds

2010-09-03 Thread Daniel Stutzbach

Daniel Stutzbach  added the comment:

I just noticed that the previous "new" patch I uploaded was actually my 
original patch.  Oops.  Anyway...

In a discussion on the capi list, a few people objected to compiling in 
Unicode-agnostic mode by default (e.g., it would be annoying for Cython).  
Attached is a new patch that compiles in Unicode-agnostic mode only when 
Py_UNICODE_AGNOSTIC is defined (and brings the patch up to date with other 
changes to the py3k branch).

It includes automated tests, and I have tested UCS2 Linux, UCS4 Linux, and 
Windows builds.

After the patch, trying to import a module with a mismatched Unicode setting 
looks like this:

>>> import _testunicodemismatched
Traceback (most recent call last):
  File "", line 1, in 
ImportError: module's Unicode representation does not match the interpreter's

Here's a birds-eye view of the patch:

moduleobject.h: Add a flags field to PyModuleDef_Base
moduleobject.c: Detect import with mismatched Unicode setting
pyunicode.h: New file; non-agnostic code from unicodeobject.h moved here
unicodeobject.h: Deleted ~150 lines of #defines (yay!)
Everything else: tests

I'm pretty happy with the patch.  In the earlier discussion here, there was 
generally positive feedback for the overall idea.  Someone want to do a patch 
review?

--
keywords: +needs review
stage: needs patch -> patch review
Added file: http://bugs.python.org/file18723/unicode-2.patch

___
Python tracker 

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



[issue9753] test_socket.testDup, testFromFd fail on Windows

2010-09-03 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

test_socket.py passes here.
I run: python_d.exe -m test.regrtest -v test_socket

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue9753] test_socket.testDup, testFromFd fail on Windows

2010-09-03 Thread Daniel Stutzbach

Daniel Stutzbach  added the comment:

I run it the same way.

I wonder what's different? :-(  I will try to find some time to investigate 
further.

--

___
Python tracker 

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



[issue9753] test_socket.testDup, testFromFd fail on Windows

2010-09-03 Thread Daniel Stutzbach

Daniel Stutzbach  added the comment:

On Windows, socket.dup is implemented using DuplicateHandle.  The documentation 
for DuplicateHandle reads:

You should not use DuplicateHandle to duplicate handles to the following 
objects:

* I/O completion ports. No error is returned, but the duplicate handle 
cannot be used.
* Sockets. No error is returned, but the duplicate handle may not be 
recognized by Winsock at the target process. Also, using DuplicateHandle 
interferes with internal reference counting on the underlying object. To 
duplicate a socket handle, use the WSADuplicateSocket function.

--

___
Python tracker 

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



[issue9744] calling __getattribute__ with wrong instance causes hang up

2010-09-03 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
resolution:  -> works for me
status: open -> closed

___
Python tracker 

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



[issue9755] Fix refcounting details in Py3k C API documentation

2010-09-03 Thread Nick Coghlan

New submission from Nick Coghlan :

As noted in [1] the refcount data for the C API documentation is contained in a 
separate file at Doc/data/refcounts.dat.

This file is not mentioned in "Documenting Python" and hence has not been 
correctly updated for Py3k (e.g. none of the PyString methods have been renamed 
to PyUnicode in that file, so the relevant refcount changes are not documented 
correctly).

There are several possible improvements to be considered in this area
1. Mention this file and its purpose in "Documenting Python"
2. Update the Sphinx extension to warn if a C API function is not found in this 
file
3. Update the Sphinx extension to allow this information to be expressed inline 
in the function definition rather than off in a separate file (if practical)
4. Address Skip's comment from that file by allowing "-0" to indicate stolen 
references for arguments and "+0" for borrowed references as return values
5. Perhaps add a mechanism to indicate when PyMem_Free needs to be called on a 
return value or pointer output value.

[1] http://mail.python.org/pipermail/python-dev/2010-September/103429.html

--
messages: 115441
nosy: ncoghlan
priority: normal
severity: normal
status: open
title: Fix refcounting details in Py3k C API documentation

___
Python tracker 

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



[issue9755] Fix refcounting details in Py3k C API documentation

2010-09-03 Thread Nick Coghlan

Changes by Nick Coghlan :


--
assignee:  -> d...@python
nosy: +d...@python

___
Python tracker 

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



[issue9753] test_socket.testDup, testFromFd fail on Windows

2010-09-03 Thread Daniel Stutzbach

Daniel Stutzbach  added the comment:

Following the advice of DuplicateHandle's documentation, I reimplemented dup on 
Windows using WSADuplicateHandle.  Attached is a patch.  With the patch, the 
tests pass on my Windows machine.

Would someone like to review the patch?

--
assignee:  -> stutzbach
keywords: +needs review, patch
resolution:  -> accepted
stage:  -> patch review

___
Python tracker 

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



[issue9753] test_socket.testDup, testFromFd fail on Windows

2010-09-03 Thread Daniel Stutzbach

Changes by Daniel Stutzbach :


Added file: http://bugs.python.org/file18724/issue9753.patch

___
Python tracker 

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



[issue9753] test_socket.testDup, testFromFd fail on Windows

2010-09-03 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

The documentation of WSASocket(), and the code of PyBluez
http://code.google.com/p/pybluez/source/browse/trunk/msbt/_msbt.c#374
both suggest to use the FROM_PROTOCOL_INFO constant.
Otherwise, the patch looks good.

--

___
Python tracker 

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



[issue9751] _PyInstance_Lookup() defeats its purpose

2010-09-03 Thread Georg Brandl

Georg Brandl  added the comment:

I'm not sure anyone will be interested in this: it doesn't affect 3.x.

--
nosy: +georg.brandl

___
Python tracker 

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



[issue9750] sqlite3 iterdump fails on column with reserved name

2010-09-03 Thread Marko Kohtala

Marko Kohtala  added the comment:

It also fails if table or column names contain double quote.

--
Added file: http://bugs.python.org/file18725/sqlite3bug2.py

___
Python tracker 

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



[issue9756] Crash with custom __getattribute__

2010-09-03 Thread Florent Xicluna

New submission from Florent Xicluna :

I found this crash while playing with proxies (thanks haypo).
http://code.activestate.com/recipes/496741-object-proxying/


class MyClass(object):

def __init__(self):
self.pwn = None

def __getattribute__(self, name):
print('MyClass.__getattribute__(self, %r)' % name)
return getattr('abc', name)

instance = MyClass()
str.strip(instance)

--
components: Interpreter Core
messages: 115446
nosy: flox, haypo
priority: normal
severity: normal
stage: needs patch
status: open
title: Crash with custom __getattribute__
type: crash
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2

___
Python tracker 

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



[issue9750] sqlite3 iterdump fails on column with reserved name

2010-09-03 Thread Marko Kohtala

Changes by Marko Kohtala :


Added file: http://bugs.python.org/file18726/sqlite3dump.patch

___
Python tracker 

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



[issue9756] Crash with custom __getattribute__

2010-09-03 Thread Andreas Stührk

Andreas Stührk  added the comment:

It's because you can fool `PyObject_IsInstance()` that way:

>>> class Spam(object):
... def __getattribute__(self, name):
... if name == '__class__':
... return str
... raise AttributeError
... 
>>> isinstance(Spam(), str)
True

--
nosy: +Trundle

___
Python tracker 

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



[issue9753] test_socket.testDup, testFromFd fail on Windows

2010-09-03 Thread Daniel Stutzbach

Daniel Stutzbach  added the comment:

Thanks!  Updated as you suggested and committed as r84450 and r84451.

--
keywords:  -needs review
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue9754] assertWarns and assertWarnsRegexp

2010-09-03 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

The __warningregistry__ stuff looks horrible.

--

___
Python tracker 

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



[issue9754] assertWarns and assertWarnsRegexp

2010-09-03 Thread Florent Xicluna

Florent Xicluna  added the comment:

> unittest should provide assertWarns and assertWarnsRegexp

+1
(the internal helpers in test.support could be refactored)

> The __warningregistry__ stuff looks horrible.

+1
(and it does not behave exactly the same in all Python versions)

--
nosy: +flox

___
Python tracker 

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



[issue9754] assertWarns and assertWarnsRegexp

2010-09-03 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

+1 from me as well.

--
nosy: +giampaolo.rodola

___
Python tracker 

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



[issue8746] *chflags detection broken on FreeBSD 9-CURRENT

2010-09-03 Thread Nick Dowell

Nick Dowell  added the comment:

We've just noticed this same problem with Python 3.1.2 on Mac OS X.

The problem is that the program source in the configure script has extraneous 
'[' and ']' characters in it, causing compilation to fail.
Excerpt of configure from line 17357:
  cat >>conftest.$ac_ext <<_ACEOF
  /* end confdefs.h.  */
  [
  #include 
  #include 
  int main(int argc, char*argv[])
  {
if(chflags(argv[0], 0) != 0)
  return 1;
return 0;
  }
  ]
  _ACEOF

These extra '[' and ']' characters were added to configure.in in revision 74038:
http://svn.python.org/view/python/trunk/configure.in?r1=74033&r2=74038

I have locally modified my configure.in and configure scripts to back out that 
change, and found it resolves the issue.

--
nosy: +Nick.Dowell

___
Python tracker 

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



[issue9754] assertWarns and assertWarnsRegexp

2010-09-03 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Here is a patch. The approach is different from support.check_warnings(), and 
tries to mimic assertRaises* instead.

--
keywords: +patch
Added file: http://bugs.python.org/file18727/assertwarns.patch

___
Python tracker 

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



[issue8746] *chflags detection broken on FreeBSD 9-CURRENT

2010-09-03 Thread Douglas Leeder

Changes by Douglas Leeder :


--
nosy: +Douglas.Leeder

___
Python tracker 

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



[issue7231] Windows installer does not add \Scripts folder to the path

2010-09-03 Thread Jason R. Coombs

Jason R. Coombs  added the comment:

The big problem with adding the %python%\scripts directory to the path is it 
makes a lot of assumptions about how Python is deployed.

And it raises some questions. What should the precedence be? What should happen 
if multiple versions of Python are installed? Should the latest version take 
precedence? Should the latest version remove the path for the previous version?

Personally, I'm -1 on this idea unless it's a checkbox that can easily be 
deselected (or not selected by default). I install multiple different versions 
of Python to my system and I symlink \Python to the "active" version and I add 
"\Python\Scripts" to the path, so I can easily switch between my active version 
of Python. Adding \Python26\Scripts and \Python26-64\Scripts and 
\Python27\Scripts and ... to the path could become very messy.

Perhaps a better solution would be to provide a link in the start menu or a 
script to be run which adds the scripts to the path for that instance of 
Python... so it could be easily and painlessly added after the fact.

--
nosy: +jaraco

___
Python tracker 

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



[issue9754] assertWarns and assertWarnsRegexp

2010-09-03 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

There was some dead code in the patch.

--
Added file: http://bugs.python.org/file18728/assertwarns.patch

___
Python tracker 

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



[issue9754] assertWarns and assertWarnsRegexp

2010-09-03 Thread Antoine Pitrou

Changes by Antoine Pitrou :


Removed file: http://bugs.python.org/file18727/assertwarns.patch

___
Python tracker 

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



[issue7231] Windows installer does not add \Scripts folder to the path

2010-09-03 Thread sorin

sorin  added the comment:

Important tools (like ease_install, pypm) from `Script` directory are already 
including version prefixes in their names (tool-2.7.exe).

This means that it should not be a big problem having several Scripts 
directories on your path.

Most python users are not installing several versions, but we could expect that 
most of them will want to run a tool from scripts.

--

___
Python tracker 

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



[issue8654] Improve ABI compatibility between UCS2 and UCS4 builds

2010-09-03 Thread Guido van Rossum

Changes by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

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



[issue7231] Windows installer does not add \Scripts folder to the path

2010-09-03 Thread Brian Curtin

Brian Curtin  added the comment:

> Important tools (like ease_install, pypm) from `Script` directory are
> already including version prefixes in their names (tool-2.7.exe).
> 
> This means that it should not be a big problem having several Scripts
> directories on your path.

Just adding all Script directories to the path would penalize those projects 
who don't add versions to their file names. We should not do that.

If we're going to add any type of path manipulation, it should have the options 
to replace existing paths, append existing paths, or do nothing.


> Most python users are not installing several versions, but we could
> expect that most of them will want to run a tool from scripts.

Neither of these are true from my experience. Since 3.0 came out, I have always 
had a 2.x and 3.x installed concurrently, and come across many coworkers who 
have numerous versions installed. As for most people using something in 
Scripts, I've rarely interacted with anyone who uses it or knows about it 
besides myself.

--
nosy: +brian.curtin
stage:  -> needs patch
versions:  -Python 3.3

___
Python tracker 

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



[issue7231] Windows installer does not add \Scripts folder to the path

2010-09-03 Thread Brian Curtin

Brian Curtin  added the comment:

s/append existing paths/append new paths/

--

___
Python tracker 

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



[issue9757] Add context manager protocol to memoryviews

2010-09-03 Thread Antoine Pitrou

New submission from Antoine Pitrou :

This adds the context manager protocol to memoryview objects, as proposed on 
python-dev. Once the `with` block has finished, the underlying buffer is 
released and any operation on the memoryview raises a ValueError.

--
components: Interpreter Core
files: memcontext.patch
keywords: patch
messages: 115459
nosy: pitrou
priority: normal
severity: normal
stage: patch review
status: open
title: Add context manager protocol to memoryviews
type: feature request
versions: Python 3.2
Added file: http://bugs.python.org/file18729/memcontext.patch

___
Python tracker 

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



[issue9754] assertWarns and assertWarnsRegexp

2010-09-03 Thread Michael Foord

Michael Foord  added the comment:

(Note that in general I am against extending the TestCase API with more asserts 
given how wide it is and how much it has expanded in recent versions. I've 
written warning checking code enough times for third party projects that I 
think this is worth it though.)

--

___
Python tracker 

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



[issue8654] Improve ABI compatibility between UCS2 and UCS4 builds

2010-09-03 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

+#undef HAVE_USABLE_CHAR_T

Isn't it HAVE_USABLE_WCHAR_T?

+struct PY_UNICODE_STRUCT;
+typedef struct PY_UNICODE_STRUCT Py_UNICODE_STRUCT;
+#define Py_UNICODE Py_UNICODE_STRUCT

Why not simply `typedef struct PY_UNICODE_STRUCT Py_UNICODE`?

The _testunicodeagnostic module could have a simple test method making a couple 
of calls to PyUnicode_* functions.

--
nosy: +pitrou

___
Python tracker 

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



[issue9727] Add callbacks to be invoked when locale changes

2010-09-03 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +lemburg, loewis

___
Python tracker 

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



[issue1521950] shlex.split() does not tokenize like the shell

2010-09-03 Thread Éric Araujo

Éric Araujo  added the comment:

Thanks for the report. Would you like to work on a patch, or translate your 
examples into unit tests?

The docs do not mention “&” at all, and platform discrepancies have to be taken 
into account too, so I really don’t know if this is a bug fix for the normal 
mode, the POSIX mode, or a feature request requiring a new argument to the 
shlex function to preserve compatibility.

--
nosy: +eric.araujo, eric.smith

___
Python tracker 

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



[issue9723] pipes.quote() needs to be documented

2010-09-03 Thread Éric Araujo

Éric Araujo  added the comment:

Eric referred to this thread: 
http://mail.python.org/pipermail/stdlib-sig/2010-May/thread.html

--
nosy: +eric.araujo
versions:  -Python 2.5, Python 2.6, Python 3.3

___
Python tracker 

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



[issue9721] urlparse.urljoin() cuts off last base character with semicolon at url start

2010-09-03 Thread Éric Araujo

Éric Araujo  added the comment:

The versions getting bug fixes are 2.7, 3.1 (stable versions) and 3.2 (active). 
2.6 is in security mode now.

Can someone write a test (as a standalone script or a diff against 
Lib/test/test_urlparse.py) and tell if 3.1 and 3.2 have the bug too?

More importantly, can someone quote the latest URI RFC about that? The 
semicolon is related to the mysterious param component IIRC.

--
nosy: +eric.araujo
versions:  -Python 2.6

___
Python tracker 

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



[issue9754] assertWarns and assertWarnsRegexp

2010-09-03 Thread Florent Xicluna

Florent Xicluna  added the comment:

Patch looks good. However tests do not pass with -Werror (while test_warnings 
and others pass).


Is there a way to catch multiple warnings on a single logical line?
(With assertRaises we don't have such use case)

--
stage: needs patch -> patch review

___
Python tracker 

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



[issue9720] zipfile writes incorrect local file header for large files in zip64

2010-09-03 Thread Éric Araujo

Éric Araujo  added the comment:

A tip about versions: Development happens on the current active branch, py3k 
(future 3.2 version), and bug or doc fixes are backported to the stable 
versions 2.7 and 3.1. Security fixes go into 2.6 too.

Can you reproduce your bug in 2.7, 3.1 and 3.2?

Adding Alan to nosy since he’s listed in Misc/maintainers.rst.

--
nosy: +alanmcintyre, eric.araujo
versions:  -Python 2.5, Python 2.6, Python 3.3

___
Python tracker 

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



[issue9758] ioctl mutable buffer copying problem

2010-09-03 Thread Grzegorz Kulewski

New submission from Grzegorz Kulewski :

Hello,

It looks like something is broken in ioctl in 3.2 when the supplied (mutable) 
bytearray is exactly 1024 bytes long - the result is not copied into the buffer 
after the ioctl succedes:

def open_tuntap(type, name):
TUN_TYPE = {
'TUN' : 0x0001,
'TAP' : 0x0002
}

TUNSETIFF = 0x400454ca

dev = os.open('/dev/net/tun', os.O_RDWR)
buf = bytearray(SET_LEN_HERE)
name = name[:16]
buf[:len(name)] = name
buf[16:18] = TUN_TYPE[type].to_bytes(2, sys.byteorder)
fcntl.ioctl(dev, TUNSETIFF, buf, True)
print(buf)
print(len(buf))

open_tuntap('TAP', b'madtun%d')

Now try it with SET_LEN_HERE = 1024, 1023, 1025 and any other values. For < 
1024 it copies to the static buffer and back, for > 1024 it operates on the 
buffer itself (hopefully) and for 1024 it ignores the modified buffer 
completely. It's probably some corner case bug.

The example was tested under Linux 2.6.35.

Python 3.2a1+ (py3k:84054, Sep  3 2010, 01:45:35) 
[GCC 4.4.2] on linux2

--
components: Library (Lib)
messages: 115467
nosy: gkulewski
priority: normal
severity: normal
status: open
title: ioctl mutable buffer copying problem
type: behavior
versions: Python 3.2

___
Python tracker 

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



[issue9710] 2to3 could remove "-*- coding: utf-8 -*-"

2010-09-03 Thread Florent Xicluna

Florent Xicluna  added the comment:

PEP8 fixed with r84354

--

___
Python tracker 

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



[issue9708] cElementTree iterparse does not support "parser" argument

2010-09-03 Thread Florent Xicluna

Changes by Florent Xicluna :


--
nosy: +effbot
stage:  -> unit test needed
type:  -> behavior
versions: +Python 3.2

___
Python tracker 

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



[issue9754] assertWarns and assertWarnsRegexp

2010-09-03 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Patch looks good. However tests do not pass with -Werror (while test_warnings 
> and others pass).
> 
> 
> Is there a way to catch multiple warnings on a single logical line?

I thought we could beef up the API with additional arguments.
That would be at the expense of removing the "callable" argument (and
mandating the use as a context manager), though, otherwise the signature
gets too complicated.

--

___
Python tracker 

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



[issue9754] assertWarns and assertWarnsRegexp

2010-09-03 Thread Michael Foord

Michael Foord  added the comment:

Why not accepting a tuple of warnings? That doesn't make sense for 
assertWarnsRegexp of course.

--

___
Python tracker 

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



[issue9754] assertWarns and assertWarnsRegexp

2010-09-03 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Why not accepting a tuple of warnings?

It already does (and there's a test!).

> That doesn't make sense for assertWarnsRegexp of course.

True.

--

___
Python tracker 

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



[issue9756] Crash with custom __getattribute__

2010-09-03 Thread Andreas Stührk

Andreas Stührk  added the comment:

At least two tests in `test.test_descr` consider that behaviour as a feature: 
"test_isinst_isclass" and "test_proxy_super".

--

___
Python tracker 

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



[issue9759] GzipFile object should raise ValueError on .read() after .close()

2010-09-03 Thread Alain Kalker

New submission from Alain Kalker :

>>> f = open("test2.gz")
>>> d = f.read()
>>> f.close()
>>> e = f.read()
Traceback (most recent call last):
  File "", line 1, in 
ValueError: I/O operation on closed file
import gzip
>>> f = gzip.open("test2.gz")
>>> d = f.read()
>>> f.close()
>>> e = f.read()
>>> e
''

To remain consistent with other file(-like) objects, I think 'GzipFile's should 
also raise a ValueError in cases like this.

--
components: Library (Lib)
messages: 115473
nosy: ack
priority: normal
severity: normal
status: open
title: GzipFile object should raise ValueError on .read() after .close()
type: behavior

___
Python tracker 

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



[issue8654] Improve ABI compatibility between UCS2 and UCS4 builds

2010-09-03 Thread Daniel Stutzbach

Daniel Stutzbach  added the comment:

Thanks, Antoine.  Those are all good suggestions.  Attached is an updated patch.

Marc-Andre, Martin: would you like to look this over as well?

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

___
Python tracker 

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



[issue9755] Fix refcounting details in Py3k C API documentation

2010-09-03 Thread Skip Montanaro

Skip Montanaro  added the comment:

I thought Fred Drake wrote the code that generated that file, but that
was a long time ago in a galaxy far, far away.  Perhaps Georg has
subsumed it into his Sphinx/Python doc workflow?

(making Fred "nosy" so he sees this thread...)

S

--
nosy: +fdrake, skip.montanaro

___
Python tracker 

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



[issue5506] io.BytesIO doesn't support the buffer protocol

2010-09-03 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Here is a patch implementing getbuffer(), together with tests.

--
keywords: +patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file18731/bytesiobuf2.patch

___
Python tracker 

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



[issue9757] Add context manager protocol to memoryviews

2010-09-03 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Guido expressed skepticism at the idea:
http://mail.python.org/pipermail/python-dev/2010-September/103442.html

--

___
Python tracker 

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



[issue9760] Suggestion for improving with documentation

2010-09-03 Thread Jason Baker

New submission from Jason Baker :

http://docs.python.org/reference/compound_stmts.html#with

This documentation refers to "context expressions" in two places.  However, it 
never really defines what a context expression is.  The formal syntax that's 
presented is this:

with_stmt ::=  "with" with_item ("," with_item)* ":" suite
with_item ::=  expression ["as" target]

As best I can tell, the context expression is essentially the with_item.  If 
that's the case, I propose one of the following:

 1) The formal syntax is changed so that "with_item" becomes 
"context_expression".
 2) References to "context expression" change to "with item".
 3) The "context expression" is defined to be the with_item in the formal 
syntax at some point in the documentation.

--
assignee: d...@python
components: Documentation
messages: 115478
nosy: Jason.Baker, d...@python
priority: normal
severity: normal
status: open
title: Suggestion for improving with documentation
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue5506] io.BytesIO doesn't support the buffer protocol

2010-09-03 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

There was an unused "weakreflist" member.

--
Added file: http://bugs.python.org/file18732/bytesiobuf2.patch

___
Python tracker 

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



[issue5506] io.BytesIO doesn't support the buffer protocol

2010-09-03 Thread Antoine Pitrou

Changes by Antoine Pitrou :


Removed file: http://bugs.python.org/file18731/bytesiobuf2.patch

___
Python tracker 

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



[issue5506] io.BytesIO doesn't support the buffer protocol

2010-09-03 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
components: +IO
nosy: +amaury.forgeotdarc, benjamin.peterson

___
Python tracker 

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



[issue7231] Windows installer does not add \Scripts folder to the path

2010-09-03 Thread Sridhar Ratnakumar

Sridhar Ratnakumar  added the comment:

FWIW, since last year ActivePython 2.6/2.7 puts C:\PythonXY\Scripts and 
%APPDATA%\Python\Scripts in %PATH% and we haven't had any complaints so far.

In addition, we also create a versioned interpreter executable - 
C:\PythonXY\pythonxy.exe - that is something the official installer can do as 
well, as it makes it possible to just type, say, "python27" when multiple 
Python versions are installed ... similar to typing 'python2.7' on *nix.

--

___
Python tracker 

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



[issue9193] PEP 3149 (versioned .so files) reference implementation

2010-09-03 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


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

___
Python tracker 

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



[issue3805] sslobj.read py3k takes odd arguments

2010-09-03 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Cleanup done in r84464 (py3k), r84465 (3.1).

--
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed
versions: +Python 3.1, Python 3.2 -Python 3.0

___
Python tracker 

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



[issue1521950] shlex.split() does not tokenize like the shell

2010-09-03 Thread Dan Christian

Dan Christian  added the comment:

It's been a while since I looked at this.  I'm not really in a
position to contribute code/tests right now; but I can comment.

I don't think POSIX mode existed when I first reported this, but
that's where it makes sense.  I think all POSIX shells (borne, C,
korne), will behave the same way for the issues mentioned.

There are really two cases in one bug.

The first part is that the shell will split tokens at characters that
shlex doesn't.  The handling of &, |, ;, >, and < could be done by
adjusting the definition of shlex.wordchars.  The shell may also
understands things like: &&, ||, |&, and >&.  The exact definition of
these depends on the shell, so maybe it's best to just split them out
as separate tokens and let the user figure out the compound meanings.

The proper handling of quotes/escapes requires some kind of new
interface.  You need to distinguish between tokens that were modified
by the quote/escape rules and those that were not.  One suggestion is
to add a new method as such:

shlex.get_token2()
   Return a tuple of the token and the original text of the token
(including quotes and escapes).  Otherwise, this is the same as
shlex.get_token().

Comparing the two values for equality (or maybe identity) would tell
you if something special was going on.  You can always pass the second
value to a reconstructed command line without losing any of the
original parsing information.

-Dan

On Fri, Sep 3, 2010 at 10:27 AM, Éric Araujo  wrote:
>
> Éric Araujo  added the comment:
>
> Thanks for the report. Would you like to work on a patch, or translate your 
> examples into unit tests?
>
> The docs do not mention “&” at all, and platform discrepancies have to be 
> taken into account too, so I really don’t know if this is a bug fix for the 
> normal mode, the POSIX mode, or a feature request requiring a new argument to 
> the shlex function to preserve compatibility.
>
> --
> nosy: +eric.araujo, eric.smith
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue8746] *chflags detection broken on FreeBSD 9-CURRENT

2010-09-03 Thread Ned Deily

Ned Deily  added the comment:

Nick, can you provide a unit test and a patch file for the issue against the 
currently maintained versions?  Adding Alexandre to comment on why the 
configure change was made.

--
components: +Build
nosy: +alexandre.vassalotti, ned.deily
stage:  -> unit test needed
versions: +Python 2.7, Python 3.2 -Python 2.6

___
Python tracker 

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



[issue9717] operator module - "in place" operators documentation

2010-09-03 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I agree that the docs for augmented assignments and the corresponding method 
and funciton can and should be improved.

But I do not like this as is. In particular, Python does not have in-place 
operators; it has methods that optionally do an operation in-place if the first 
argument (self) is mutable. I think adding "" is insufficient to avoid the 
confusion of the incorrect term. What I think should be said is that the ixxx 
methods and the corresponding operator.ixxx functions implement the operation 
part of operation-augmented assignments.

For the operator doc, I think we should expand the initial paragraph ("The 
operator module ...") a bit so that less needs to said specifically for the 
ixxx functions.

Also, most of your explanation is really about augmented assignment and the 
.__ixxx__ special methods, not specifically about operator.ixxx functions, and 
might better be added to the subsection 3.3.6. Emulating numeric typesof the 
special methods section (and cross-referenced from the operator doc) or even 
used to improve 6.2.1. Augmented assignment statements, and not buried in the 
operator doc. If people are confused about the .ixxx functions, they are 
probably confused also about a.a. and .__ixxx__ methods.

So I would like to attack the whole problem and expand this issue to "Improve 
operator-augmented assginment docs." and cover all three relevant doc areas, 
starting with
6.2.1. Augmented assignment statements. As already hinted, I would like to 
expand the title to "Operator-augmented assignment statements.".

I would like there to be a prototype example near the top: either "target_arg 
op= arg", with op explained as one of +-*/... or "target_arg += arg" as a 
specific example, or both. Since the target is also an arg reference, it 
obviously must refer to a single existing object. Then discuss the two cases of 
target immutable and mutable, as the current doc and your proposal does.

Otherwise in this section, I am mystified by the reference of "(See section 
Primaries for the syntax definitions for the last three symbols.)". I have also 
forgotten the meaning of "With the exception of assigning to tuples "; i should 
just be stated.

As already stated, I also believe the explanation of .__ixxx__ methods in 
3.3.6. Emulating numeric types could be improved a bit.

--
nosy: +terry.reedy
stage:  -> patch review
versions: +Python 2.7, Python 3.1, Python 3.2 -Python 3.3

___
Python tracker 

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



[issue9756] Crash with custom __getattribute__

2010-09-03 Thread STINNER Victor

STINNER Victor  added the comment:

<< I found this crash while playing with proxies (thanks haypo).
http://code.activestate.com/recipes/496741-object-proxying/ >>

My question was: why does isinstance(Proxy('abc'), str) works (give True), 
whereas re.match('abc', Proxy('abc')) fail.

It looks like you gave me the answer ;-)

--

___
Python tracker 

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



[issue9717] operator module - "in place" operators documentation

2010-09-03 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Consider breaking the operator module documents into sections, grouping all of 
the in-place ops into the last section.  Start that section with a full 
description of how in-place works in python and show some examples of 
successful way to use the in-place operators.

Right now, the docs are somewhat misleading because they imply that the 
i-functions can be used in the same was as their counterparts.

--
nosy: +rhettinger

___
Python tracker 

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



[issue9717] operator module - "in place" operators documentation

2010-09-03 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee: d...@python -> rhettinger

___
Python tracker 

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



[issue9731] Add ABCMeta.has_methods and tests that use it

2010-09-03 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Good idea!

I see Raymond's point about the name. How about .method_check?
To me Sequence.method_check(range) means "Abstract Seqeunce class, please 
method-check the concrete range class."

If Sequence.register(range) is in the range source file, I would expect to find 
the test of the range class in test_range.

If all collection registrations were bundled together in collections.py, I 
think I would expect the tests to be in test_collections. But I could still be 
presuaded that the range method check should be in test_range where all the 
individual methods are (should be!) tested.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue9761] stale .pyc files aren't cleaned out

2010-09-03 Thread Steve Thompson

New submission from Steve Thompson :

I'm running pythong 2.6.1 on Windows XP SP3.

On many occasions I have ran into cases where I've installed a new package via 
the package's setup.py (pylint, logilab-common, etc) and new .pyc files don't 
get generated when I attempt to run the tools/packages.  I'm not sure if this 
should be considered a package issue or an interpreter issue.  I'd like to see 
the interpreter regenerate the .pyc file as expected so my colleagues and I 
don't burn time on "broken" packages we know nothing about only to find out it 
was due to some stale .pyc files.  A quick fix would be to make the packages in 
question clean out their installation directories or regenerate all the pyc 
files manually.

How should this issue be handled?

--
components: Interpreter Core, Windows
messages: 115488
nosy: Steve.Thompson
priority: normal
severity: normal
status: open
title: stale .pyc files aren't cleaned out
type: behavior
versions: Python 2.6

___
Python tracker 

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



[issue9762] build failures

2010-09-03 Thread Antoine Pitrou

New submission from Antoine Pitrou :

After a `make distclean` and a whole recompile I still get these:

building 'crypt' extension
gcc -pthread -fPIC -g -O0 -Wall -Wstrict-prototypes -I. -I./Include 
-I/usr/local/include -IInclude -I/home/antoine/py3k/debug -c 
/home/antoine/py3k/debug/Modules/cryptmodule.c -o 
build/temp.linux-x86_64-3.2-pydebug/home/antoine/py3k/debug/Modules/cryptmodule.o
gcc -pthread -shared 
build/temp.linux-x86_64-3.2-pydebug/home/antoine/py3k/debug/Modules/cryptmodule.o
 -L/usr/local/lib -o build/lib.linux-x86_64-3.2-pydebug/crypt.cpython-32dm.so
*** WARNING: renaming "crypt" since importing it failed: 
build/lib.linux-x86_64-3.2-pydebug/crypt.cpython-32dm.so: undefined symbol: 
crypt

building 'nis' extension
gcc -pthread -fPIC -g -O0 -Wall -Wstrict-prototypes -I. -I./Include 
-I/usr/local/include -IInclude -I/home/antoine/py3k/debug -c 
/home/antoine/py3k/debug/Modules/nismodule.c -o 
build/temp.linux-x86_64-3.2-pydebug/home/antoine/py3k/debug/Modules/nismodule.o
gcc -pthread -shared 
build/temp.linux-x86_64-3.2-pydebug/home/antoine/py3k/debug/Modules/nismodule.o 
-L/usr/local/lib -o build/lib.linux-x86_64-3.2-pydebug/nis.cpython-32dm.so
*** WARNING: renaming "nis" since importing it failed: 
build/lib.linux-x86_64-3.2-pydebug/nis.cpython-32dm.so: undefined symbol: 
yp_get_default_domain

Failed to build these modules:
crypt  nis

--
assignee: barry
components: Build
messages: 115489
nosy: barry, pitrou
priority: normal
severity: normal
stage: needs patch
status: open
title: build failures
type: compile error
versions: Python 3.2

___
Python tracker 

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



[issue9293] Unsupported IO operations should raise UnsupportedOperation

2010-09-03 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Here is a patch.

--
keywords: +patch
Added file: http://bugs.python.org/file18733/unsupported.patch

___
Python tracker 

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



[issue9763] Crashes upon run after syntax error encountered in OSX 10.5.8

2010-09-03 Thread William Barr

New submission from William Barr :

Steps for reproduction:
1.  Open a new code window
2.  Enter python code which contains a syntax error
3.  F5 and attempt to run the file (This was done without saving first)
4.  Close the syntax error dialog.  
5.  Fix the syntax error and try to F5 again without saving again.  
6.  IDLE will encounter an error and unexpectedly close.  

I'm reporting this after having tested this on 4 different OSX 10.5.8 machines. 
 I'm not sure if other versions of Python are also susceptible to this as well.

--
components: IDLE
messages: 115491
nosy: Webs961
priority: normal
severity: normal
status: open
title: Crashes upon run after syntax error encountered in OSX 10.5.8
type: crash
versions: Python 3.1

___
Python tracker 

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



[issue9759] GzipFile object should raise ValueError on .read() after .close()

2010-09-03 Thread Amaury Forgeot d'Arc

Changes by Amaury Forgeot d'Arc :


--
stage:  -> needs patch

___
Python tracker 

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



[issue9731] Add ABCMeta.has_methods and tests that use it

2010-09-03 Thread Daniel Stutzbach

Daniel Stutzbach  added the comment:

I agree that my original name proposal is terrible. :-)  method_check and 
verify_full_api both look fine to me.

> If all collection registrations were bundled together in 
> collections.py, I think I would expect the tests to be in 
> test_collections. But I could still be presuaded that the range method
> check should be in test_range where all the individual methods are 
> (should be!) tested.

All of the registrations are bundled together in _abcoll.py, which 
collections.py imports into collections.py's namespace.  (It's in a separate 
file to get around some bootstrapping issues.)

I favor putting them in test_collections to make it slightly easier to check 
for a 1:1 correlation between registrations and tests, but it's not something I 
feel strongly about.

--

___
Python tracker 

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



[issue9728] Docs point to FAQ Section 3, but FAQs are not numbered

2010-09-03 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

As I remember, the FAQ was once that, *the* (giant) FAQ, with numbered 
sections. When broken into pieces, the order may have been re-arranged.

Given that the broken reference is in extending/windows, I would look in both 
the Extending and Windows FAQs. However, I found neither 'PyType_Type' nor 
'PyVarObject_HEAD_INIT' nor 'initialization' in either.

Besides removing the dead reference, you could either look through the revision 
history of the file or ask on pydev if you need the info.

The split-up FAQs first appear in a release doc set in Python 2.6.4, 
documentation released on 25 October 2009. I do not know if the earlier, 
unitary FAQ is in the repository or not.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue9761] stale .pyc files aren't cleaned out

2010-09-03 Thread Brett Cannon

Brett Cannon  added the comment:

So are you installing new versions of a package you already have installed 
using ``python setup.py install``? Exactly what command are you using to do the 
install?

--
nosy: +brett.cannon

___
Python tracker 

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



[issue9762] build failures

2010-09-03 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

The normal build lines for the crypt and nis modules contain additional library 
linkage ("normal", that is before your commit :-)):

gcc -pthread -shared 
build/temp.linux-x86_64-3.2/home/antoine/py3k/__svn__/Modules/cryptmodule.o 
-L/home/antoine/py3k/__svn__/usr/lib -L/usr/local/lib -lcrypt -o 
build/lib.linux-x86_64-3.2/crypt.so

gcc -pthread -shared 
build/temp.linux-x86_64-3.2/home/antoine/py3k/__svn__/Modules/nismodule.o 
-L/home/antoine/py3k/__svn__/usr/lib -L/usr/local/lib -lnsl -o 
build/lib.linux-x86_64-3.2/nis.so

("-lcrypt" in the former, "-lnsl" in the latter)

--

___
Python tracker 

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



[issue9761] stale .pyc files aren't cleaned out

2010-09-03 Thread Steve Thompson

Steve Thompson  added the comment:

"Setup.py install". We've also seen this happen when checking our python
files out of our version control system.  Also seen a .pyc get used when the
.py no longer exists, but I could see that being intentional behavior.

On Sep 3, 2010 2:57 PM, "Brett Cannon"  wrote:

Brett Cannon  added the comment:

So are you installing new versions of a package you already have installed
using ``python setup.py install``? Exactly what command are you using to do
the install?

--
nosy: +brett.cannon

___
Python tracker 

___"Setup.py install". We've also seen this happen when checking 
our python files out of our version control system.  Also seen a .pyc get used 
when the .py no longer exists, but I could see that being intentional 
behavior.

On Sep 3, 2010 2:57 PM, "Brett Cannon" 
rep...@bugs.python.org> 
wrote:
Brett Cannon br...@python.org> 
added the comment:

So are you installing new versions of a package you already have installed 
using ``python setup.py install``? Exactly what command are you using to do the 
install?

--
nosy: +brett.cannon
___Python 
tracker rep...@bugs.python.org>http://bugs.python...

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



[issue9731] Add ABCMeta.has_methods and tests that use it

2010-09-03 Thread Éric Araujo

Éric Araujo  added the comment:

I wanted to propose the name check_methods, but then I thought that some people 
could read too much in that name, for example that arguments and return value 
are checked for correct type and value (see how Web people misunderstand “HTML 
validation”). That said, “check” promises less than “validate”, and ABCs being 
a middle-to-advanced topic, we could trust people using this method to read the 
docstring and not expect too much.

--

___
Python tracker 

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



[issue9761] stale .pyc files aren't cleaned out

2010-09-03 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Does your version control system let the files read-only by default?
In this case, see issue6074.

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue9761] stale .pyc files aren't cleaned out

2010-09-03 Thread Steve Thompson

Steve Thompson  added the comment:

Hmmm... this definitely sounds like the issue for version controlled files,
but does not explain the issue when installing packages from source.

On Sep 3, 2010 3:16 PM, "Amaury Forgeot d'Arc" 
wrote:

Amaury Forgeot d'Arc  added the comment:

Does your version control system let the files read-only by default?
In this case, see issue6074.

--
nosy: +amaury.forgeotdarc

___
Python tracker 

___Hmmm... this definitely sounds like the issue for version controlled files, 
but does not explain the issue when installing packages from source.
On Sep 3, 2010 3:16 PM, "Amaury Forgeot 
d'Arc" rep...@bugs.python.org> 
wrote:
Amaury Forgeot d'Arc amaur...@gmail.com> added the 
comment:

Does your version control system let the files read-only by default?
In this case, see issue6074.

--
nosy: +amaury.forgeotdarc
___Python 
tracker rep...@bugs.python.org>http://bugs.python...

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



[issue6074] .pyc files created readonly if .py file is readonly, python won't overwrite

2010-09-03 Thread Steve Thompson

Steve Thompson  added the comment:

So what's the current status of this on Windows Platforms?

--
nosy: +Steve.Thompson

___
Python tracker 

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



[issue8746] *chflags detection broken on FreeBSD 9-CURRENT

2010-09-03 Thread Nick Dowell

Changes by Nick Dowell :


--
keywords: +patch
Added file: http://bugs.python.org/file18736/8746-3.1.2.patch

___
Python tracker 

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



[issue8746] *chflags detection broken on FreeBSD 9-CURRENT

2010-09-03 Thread Nick Dowell

Changes by Nick Dowell :


Added file: http://bugs.python.org/file18737/8746-2.7.patch

___
Python tracker 

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



[issue8746] *chflags detection broken on FreeBSD 9-CURRENT

2010-09-03 Thread Nick Dowell

Changes by Nick Dowell :


Added file: http://bugs.python.org/file18738/8746-2.6.6.patch

___
Python tracker 

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



[issue6074] .pyc files created readonly if .py file is readonly, python won't overwrite

2010-09-03 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

This is still the case: on Windows, if foo.py is readonly,
python -c "import foo"
generates foo.pyc with the readonly attribute.

Tested with 3.1 and current py3k (where the file is named 
__pycache__\foo.cpython-32.pyc)

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



  1   2   >