[issue12619] Automatically regenerate platform-specific modules

2011-10-20 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy:  -petri.lehtinen

___
Python tracker 

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



[issue13231] sys.settrace - document 'some other code blocks' for 'call' event type

2011-10-20 Thread anatoly techtonik

New submission from anatoly techtonik :

http://docs.python.org/library/sys.html#sys.settrace

While writing settrace function you need to know what kind of data is expected 
and how to get more information about it. Current documentation for 
sys.settrace doesn't give too much answers. To improve that situation at least 
with 'call' event:

 1. Link 'frame' to the middle of table on inspect module page [1]
 2. List all possible 'code blocks' for 'call' event (I know there is module in 
addition to function)
 3. Provide example how to extract popular data for corresponding 'code block' 
(name for functions, name for modules, name for classes/methods, relative file 
path, line no, how to detect labmbda function) in a safe manner (inspect page 
contains some FUD about memory usage)


1. http://docs.python.org/library/inspect#types-and-members

--
assignee: docs@python
components: Documentation
messages: 146009
nosy: docs@python, techtonik
priority: normal
severity: normal
status: open
title: sys.settrace - document 'some other code blocks' for 'call' event type

___
Python tracker 

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



[issue13230] test_resources fails

2011-10-20 Thread Nadeem Vawda

Nadeem Vawda  added the comment:

This seems to be a duplicate of issue 13193.

--
nosy: +nadeem.vawda
resolution:  -> duplicate
stage: needs patch -> 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



[issue13193] test_packaging and test_distutils failures under Windows

2011-10-20 Thread Nadeem Vawda

Nadeem Vawda  added the comment:

Issue 13230 (closed as duplicate) reports another Linux failure in 
test_resources.

Changing the title, since it isn't Windows-specific.

--
nosy: +anikom15
stage:  -> needs patch

___
Python tracker 

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



[issue13193] test_packaging and test_distutils failures

2011-10-20 Thread Nadeem Vawda

Changes by Nadeem Vawda :


--
title: test_packaging and test_distutils failures under Windows -> 
test_packaging and test_distutils failures

___
Python tracker 

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



[issue9168] setuid in smtp.py sheds privileges before binding port

2011-10-20 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

The patch looks good to me and fixes the problem. To reproduce, try this:

sudo python -m smtpd 127.0.0.1:25

It raises a "socket.error: [Errno 13] Permission denied" when trying to bind to 
the privileged port.

Attached a refreshed the patch that applies cleanly on top of current 2.7 
branch.

--
nosy: +petri.lehtinen
versions:  -Python 3.1
Added file: http://bugs.python.org/file23481/smtpd.py-0.2-setuid-fix_v2.diff

___
Python tracker 

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



[issue8503] smtpd SMTPServer does not allow domain filtering

2011-10-20 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen
versions: +Python 3.3 -Python 3.2

___
Python tracker 

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



[issue3802] smtpd.py __getaddr insufficient handling

2011-10-20 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

AFAIK, the extra MAIL FROM and RCPT TO parameters are only valid for ESMTP. 
smtpd doesn't currently handle ESMTP, so this should not be a problem.

--
nosy: +petri.lehtinen
versions: +Python 2.7, Python 3.2, Python 3.3 -Python 2.6

___
Python tracker 

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



[issue8503] smtpd SMTPServer does not allow domain filtering

2011-10-20 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

This sounds like an important feature to me.

A few points:

- I'd rename the function name from accept_domain to e.g. validate_domain for 
clarity

- There could also be a function to validate the loca part of each recipient 
addresses. Or maybe the function should be changed to validate the whole 
recipient address, not only the domain part.

--

___
Python tracker 

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



[issue12816] smtpd uses library outside of the standard libraries

2011-10-20 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen

___
Python tracker 

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



[issue13201] Implement comparison operators for range objects

2011-10-20 Thread Mark Dickinson

Mark Dickinson  added the comment:

I get a test failure in test_hash (which is checking exactly that the 
hash(range) uses the default object hash, so that test is clearly out of date 
now).  Apart from that, the latest patch looks good to me.

I'm going to give this a couple of days in case anyone else has any comments, 
then I'll aim to commit it (with the extra test_hash fix) this weekend.

Thanks for all the work on this!

--
stage: patch review -> commit review

___
Python tracker 

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



[issue13201] Implement comparison operators for range objects

2011-10-20 Thread STINNER Victor

STINNER Victor  added the comment:

+one = PyLong_FromLong(1);
+if (!one)
+return -1;
+cmp_result = PyObject_RichCompareBool(r0->length, one, Py_EQ);
+Py_DECREF(one);

If would be nice to have a PyLong_CompareLong() function.

--
nosy: +haypo

___
Python tracker 

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



[issue13218] test_ssl failures on Ubuntu 11.10

2011-10-20 Thread Nadeem Vawda

Nadeem Vawda  added the comment:

> none of the buildbots are having this problem.

Actually, it turns out the Ubuntu ARM builder is hitting the same failures.
First failure for each branch was on 14 October (the day after 11.10 came out):

http://www.python.org/dev/buildbot/all/builders/ARM%20Ubuntu%203.x/builds/16
http://www.python.org/dev/buildbot/all/builders/ARM%20Ubuntu%203.2/builds/9
http://www.python.org/dev/buildbot/all/builders/ARM%20Ubuntu%202.7/builds/8

--

___
Python tracker 

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



[issue9574] allow whitespace around central '+' in complex constructor

2011-10-20 Thread Mark Dickinson

Changes by Mark Dickinson :


--
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



[issue13232] Logging: Unicode Error

2011-10-20 Thread Thomas Guettler

New submission from Thomas Guettler :

In changeset fe6be0426e0d the format() method was changed. Unfortunately it 
does not catch all unicode decode errors. 

I think line 482 of logging/__init__.py should be modified:
to this (add 'replace'):

s = s + record.exc_text.decode(sys.getfilesystemencoding(), 'replace')

http://hg.python.org/cpython/file/f35514dfadf8/Lib/logging/__init__.py#l482


Here is the stacktrace we get:
{{{
Traceback (most recent call last):
  File "/usr/lib64/python2.7/logging/__init__.py", line 838, in emit
msg = self.format(record)
  File "/usr/lib64/python2.7/logging/__init__.py", line 715, in format
return fmt.format(record)
  File "/home/modbau_esg_p/djangotools/utils/logutils.py", line 32, in format
msg=logging.Formatter.format(self, record)
  File "/usr/lib64/python2.7/logging/__init__.py", line 482, in format
s = s + record.exc_text.decode(sys.getfilesystemencoding())
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 662: 
ordinal not in range(128)
Logged from file base.py, line 209
}}}

--
components: Library (Lib)
messages: 146018
nosy: guettli
priority: normal
severity: normal
status: open
title: Logging: Unicode Error
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



[issue13232] Logging: Unicode Error

2011-10-20 Thread Vinay Sajip

Vinay Sajip  added the comment:

Can you tell me what the actual data was which failed to be decoded? Is there 
more than one encoding in effect (e.g. one for the filesystem, and another for 
the other data in the exception being logged)?

--
nosy: +vinay.sajip

___
Python tracker 

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



[issue12915] Add inspect.locate and inspect.resolve

2011-10-20 Thread Vinay Sajip

Vinay Sajip  added the comment:

The version in logging.config appears to be doing the same job, but is shorter:

def _resolve(name):
"""Resolve a dotted name to a global object."""
name = name.split('.')
used = name.pop(0)
found = __import__(used)
for n in name:
used = used + '.' + n
try:
found = getattr(found, n)
except AttributeError:
__import__(used)
found = getattr(found, n)
return found

The line "used = used + '.' + n" could of course be improved.

--
nosy: +vinay.sajip

___
Python tracker 

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



[issue13232] Logging: Unicode Error

2011-10-20 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti
stage:  -> test needed
type:  -> behavior

___
Python tracker 

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



[issue13232] Logging: Unicode Error

2011-10-20 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue12619] Automatically regenerate platform-specific modules

2011-10-20 Thread Jakub Wilk

Jakub Wilk  added the comment:

* STINNER Victor , 2011-10-19, 22:55:
>>FYI, in Debian we have at least:
>>one package using the CDROM module,
>Is it cdsuite? (http://offog.org/code/cdsuite.html)

No, Freevo .

>>3 packages using the IN module,
>I found policykit (it uses IN.INT_MAX).

Not in Debian, apparently...

>What are the 2 others? Which constants are used?

* Ganeti : SO_PEERCRED;
* Mandos : SO_BINDTODEVICE;
* Pydhcplib : SO_BINDTODEVICE.

>> 14 packages using the DLFCN module.
>
>Oh, so many? Which projects? Which constants are used?

* Boost : RTLD_NOW, RTLD_GLOBAL;
* Ecasound : RTLD_LAZY, RTLD_GLOBAL;
* GDCM : RTLD_LAZY, RTLD_GLOBAL;
* GNU Radio : RTLD_GLOBAL;
* GStreamer : RTLD_GLOBAL, RTLD_LAZY;
* MPI for Python : RTLD_NOW, RTLD_GLOBAL;
* Open Babel : RTLD_GLOBAL;
* PyTrilinos : RTLD_NOW, RTLD_GLOBAL;
* SALOME : RTLD_NOW, RTLD_GLOBAL;
* VTK : RTLD_NOW, RTLD_GLOBAL;
* Yade : RTLD_NOW, RTLD_GLOBAL;
* pyOpenSSL : RTLD_NOW, RTLD_GLOBAL.

(That's only 12; we have two versions of Ecasound in the archive, and 
two binary packages with DLFCN-using code are produced from GDCM 
sources.)

--

___
Python tracker 

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



[issue13227] Option to make the lru_cache type specific

2011-10-20 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset cba503a2c468 by Raymond Hettinger in branch 'default':
Issue 13227: Option to make the lru_cache() type specific (suggested by Andrew 
Koenig).
http://hg.python.org/cpython/rev/cba503a2c468

--
nosy: +python-dev

___
Python tracker 

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



[issue13227] Option to make the lru_cache type specific

2011-10-20 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Victor, Ezio, and Nick, thanks for the review.
Andrew, thanks for the feature request.

--
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



[issue13233] os.acces documentation error

2011-10-20 Thread Guilherme Moro

New submission from Guilherme Moro :

http://docs.python.org/library/os.html#os.access

points out that I should use
try:
fp = open("myfile")
except IOError as e:
if e.errno == errno.EACCESS:
return "some default data"
# Not a permission error.
raise
else:
with fp:
return fp.read()

but theres a typo the correct is errno.EACCES: not errno.EACCESS:

--
assignee: docs@python
components: Documentation
messages: 146024
nosy: Guilherme.Moro, docs@python
priority: normal
severity: normal
status: open
title: os.acces documentation error
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



[issue7322] Socket timeout can cause file-like readline() method to lose data

2011-10-20 Thread R. David Murray

R. David Murray  added the comment:

This patch has caused a non-trivial regression between 3.2 and 3.2.1.  The 
scenario in which I observed it is poplib.  I create a POP3 connection with a 
timeout.  At one point in its processing, poplib is reading lines until it gets 
a line '.\r\n', at which point the transaction is complete and it returns data 
to the caller.  If the pop server fails to terminate the transaction, we get a 
timeout on the read.  However, the POP server may still be alive, it may just 
have failed to close the transaction (servers have been observed in the wild 
that do this[*]).  Before this patch, one could catch the socket.timeout and 
recover from the failed transaction (loosing the transaction data, but that's 
OK because the transaction was incomplete...it would be better to get the 
partial transaction, but that's a poplib issue, not a socket issue).  One could 
then continue processing, sending new transactions to the POP server and 
getting responses.  After the patch, once the socket error is raised t
 here is no way to continue poplib processing short of tearing down the 
connection and rebuilding it, and restarting the POP processing from the 
beginning.

Now, this is clearly an abnormal situation (a POP server randomly not 
completing its transactions), but it was observed in the wild, and does 
represent a regression.  I think that Antoine's idea of making readline 
functional despite timeouts was the better approach.

Also note that Antoine's change to the makefile documentation is wrong with 
this patch in place, since a timeout invalidates the makefile rather than just 
"leaving the internal buffers in an inconsistent state".

Backing out this patch would probably be better than leaving it in place, if a 
better fix can't be found.

[*] The regression was detected testing against a test POP server designed to 
exhibit defective behaviors that have been observed over the years by the 
maintainers of the test server.  I can't point to specific existing servers 
that exhibit the broken behavior, but it did happen in the past and no doubt 
someone will write a buggy POP server that has the same broken behavior some 
time in the future as well.

--
nosy: +r.david.murray
resolution: fixed -> 
stage: committed/rejected -> 
status: closed -> open

___
Python tracker 

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



[issue12529] cgi.parse_header fails on double quotes and semicolons

2011-10-20 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset cfc545e028e0 by Senthil Kumaran in branch '3.2':
News entry for Issue12529 and Issue12604
http://hg.python.org/cpython/rev/cfc545e028e0

New changeset 52a4e899966c by Senthil Kumaran in branch 'default':
News entry for Issue12529 and Issue12604
http://hg.python.org/cpython/rev/52a4e899966c

New changeset 6f7ddbfafbb0 by Senthil Kumaran in branch '2.7':
News entry for Issue12529 and Issue12604
http://hg.python.org/cpython/rev/6f7ddbfafbb0

--

___
Python tracker 

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



[issue13219] re module doc has minor inaccuracy in character sets

2011-10-20 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 07eca800cdb4 by Ezio Melotti in branch '2.7':
#13219: clarify section about character sets in the re documentation.
http://hg.python.org/cpython/rev/07eca800cdb4

New changeset dc96a89ac192 by Ezio Melotti in branch '3.2':
#13219: clarify section about character sets in the re documentation.
http://hg.python.org/cpython/rev/dc96a89ac192

New changeset 78540d1264d9 by Ezio Melotti in branch 'default':
#13219: merge with 3.2.
http://hg.python.org/cpython/rev/78540d1264d9

--
nosy: +python-dev

___
Python tracker 

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



[issue12619] Automatically regenerate platform-specific modules

2011-10-20 Thread STINNER Victor

STINNER Victor  added the comment:

For Freevo: yes, it uses the CDROM module. But this module doesn't look to be 
perfect because Freevo has a fallback for FreeBSD and another for... Linux 
(because of missing CDROM.CDROM_DRIVE_STATUS?):
-
try:
from CDROM import *
# test if CDROM_DRIVE_STATUS is there
# (for some strange reason, this is missing sometimes)
CDROM_DRIVE_STATUS
except:
if os.uname()[0] == 'FreeBSD':
# FreeBSD ioctls - there is no CDROM.py...
CDIOCEJECT = 0x20006318
CDIOCCLOSE = 0x2000631c
CDIOREADTOCENTRYS = 0xc0086305
CD_LBA_FORMAT = 1
CD_MSF_FORMAT = 2
CDS_NO_DISC = 1
CDS_DISC_OK = 4
else:
# see linux/cdrom.h and Documentation/ioctl/cdrom.txt
CDROMEJECT   = 0x5309
CDROM_GET_CAPABILITY = 0x5331
CDROMCLOSETRAY   = 0x5319  # pendant of CDROMEJECT
CDROM_SET_OPTIONS= 0x5320  # Set behavior options
CDROM_CLEAR_OPTIONS  = 0x5321  # Clear behavior options
CDROM_SELECT_SPEED   = 0x5322  # Set the CD-ROM speed
CDROM_SELECT_DISC= 0x5323  # Select disc (for juke-boxes)
CDROM_MEDIA_CHANGED  = 0x5325  # Check is media changed
CDROM_DRIVE_STATUS   = 0x5326  # Get tray position, etc.
CDROM_DISC_STATUS= 0x5327  # Get disc type, etc.
CDROM_CHANGER_NSLOTS = 0x5328  # Get number of slots
CDROM_LOCKDOOR   = 0x5329  # lock or unlock door
CDROM_DEBUG  = 0x5330  # Turn debug messages on/off
CDROM_GET_CAPABILITY = 0x5331  # get capabilities
# CDROM_DRIVE_STATUS
CDS_NO_INFO = 0
CDS_NO_DISC = 1
CDS_TRAY_OPEN = 2
CDS_DRIVE_NOT_READY = 3
CDS_DISC_OK = 4
# capability flags
CDC_CLOSE_TRAY   = 0x1 # caddy systems _can't_ close
CDC_OPEN_TRAY= 0x2 # but _can_ eject.
CDC_LOCK = 0x4 # disable manual eject
CDC_SELECT_SPEED = 0x8 # programmable speed
CDC_SELECT_DISC  = 0x10# select disc from juke-box
CDC_MO_DRIVE = 0x4
CDC_MRW  = 0x8
CDC_MRW_W= 0x10
CDC_RAM  = 0x20
# CDROM_DISC_STATUS
CDS_AUDIO = 100
CDS_DATA_1 = 101
CDS_DATA_2 = 102
CDS_XA_2_1 = 103
CDS_XA_2_2 = 104
CDS_MIXED = 105
-

So Freevo does stil work if we remove the CDROM module. I still think that the 
Python standard library is not the right place for such constants. A third 
party module providing an API would be a better idea.

socket.SO_PEERCRED has been added to Python 3.3 by c64216addd7f:

"Add support for the send/recvmsg API to the socket module. Patch by David 
Watson and Heiko Wundram. (Closes #6560)"

socket.SO_PEERCRED is not listed in socket documentation.

socket has no SO_BINDTODEVICE constant yet.

RTLD_NOW, RTLD_GLOBAL and RTLD_LAZY will added to the posix module if my issue 
#13226 is accepted.

--

___
Python tracker 

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



[issue13219] re module doc has minor inaccuracy in character sets

2011-10-20 Thread Ezio Melotti

Ezio Melotti  added the comment:

Done, thanks for the report!

--
resolution:  -> fixed
stage: commit 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



[issue13233] os.acces documentation error

2011-10-20 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 1d8fad82c32d by Ezio Melotti in branch '3.2':
#13233: fix typo.
http://hg.python.org/cpython/rev/1d8fad82c32d

New changeset 99c8b93c57cd by Ezio Melotti in branch 'default':
#13233: null merge with 3.2.
http://hg.python.org/cpython/rev/99c8b93c57cd

--
nosy: +python-dev

___
Python tracker 

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



[issue13234] os.listdir breaks with literal paths

2011-10-20 Thread Manuel de la Pena

New submission from Manuel de la Pena :

During the development of an application that needed to write paths longer than 
260 chars we opted to use \\?\ as per 
http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#maxpath.

When working with literal paths the following the os.listdir funtion would 
return the following trace:

>>> import os
>>> test = r'\\?\C:\Python27'
>>> os.listdir(test)
Traceback (most recent call last):
  File "", line 1, in 
WindowsError: [Error 123] The filename, directory name, or volume label syntax 
is incorrect: '?\\C:\\Python27/*.*'

The reason for this is that the implementation of listdir appends '/' at the 
end of the path if os.path.sep is not present at the end of it which 
FindFirstFile does not like. This is a inconsistency from the OS but it can be 
easily fixed (see attached patch).

--
components: Library (Lib)
files: listdir.patch
keywords: patch
messages: 146031
nosy: mandel
priority: normal
severity: normal
status: open
title: os.listdir breaks with literal paths
versions: Python 2.7
Added file: http://bugs.python.org/file23482/listdir.patch

___
Python tracker 

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



[issue13233] os.acces documentation error

2011-10-20 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 8bf9724dcd49 by Ezio Melotti in branch '2.7':
#13233: fix typo.
http://hg.python.org/cpython/rev/8bf9724dcd49

--

___
Python tracker 

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



[issue13233] os.acces documentation error

2011-10-20 Thread Ezio Melotti

Ezio Melotti  added the comment:

Fixed, thanks for the report!

--
assignee: docs@python -> ezio.melotti
nosy: +ezio.melotti
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed
versions: +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



[issue12753] \N{...} neglects formal aliases and named sequences from Unicode charnames namespace

2011-10-20 Thread Ezio Melotti

Ezio Melotti  added the comment:

If the latest patch is fine I'll commit it shortly.

--
stage: patch review -> commit review

___
Python tracker 

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



[issue13219] re module doc has minor inaccuracy in character sets

2011-10-20 Thread Florent Xicluna

Florent Xicluna  added the comment:

Well, the actual behavior is a little bit more complex to describe.

>>> re.match('[.-_a-z]', '-')
>>> re.match('[._-a-z]', '-')
<_sre.SRE_Match object at 0x100418e80>


>>> re.match('[.-_a-z]', 'b')
<_sre.SRE_Match object at 0x100418b88>
>>> re.match('[._-a-z]', 'b')

However, I don't think it is worth changing again the documentation.

--
nosy: +flox
type:  -> behavior

___
Python tracker 

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



[issue12753] \N{...} neglects formal aliases and named sequences from Unicode charnames namespace

2011-10-20 Thread Tom Christiansen

Tom Christiansen  added the comment:

Yes, it looks good.  Thank you very much.

-tom

--

___
Python tracker 

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



[issue13219] re module doc has minor inaccuracy in character sets

2011-10-20 Thread Ezio Melotti

Ezio Melotti  added the comment:

Indeed.
The "tricks" of putting '-' at the beginning/end and ']' at the beginning are 
well known and works with most of the implementations afaik, but I would 
consider the behavior of [._-a-z] as an implementation detail and don't expect 
it to work elsewhere.

--

___
Python tracker 

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



[issue7322] Socket timeout can cause file-like readline() method to lose data

2011-10-20 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> One could then continue processing, sending new transactions to the POP 
> server and getting responses. 

That's optimistic. You don't know how much data has been lost in readline(). 
Sure, again your test server, it happens to work :) But again other kinds of 
failing servers, your protocol session would end up confused.
So the only robust option is the following:

> tearing down the
> connection and rebuilding it, and restarting the POP processing from
> the beginning

--

___
Python tracker 

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



[issue13234] os.listdir breaks with literal paths

2011-10-20 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +brian.curtin, pitrou, tim.golden
stage:  -> patch review
versions: +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



[issue13234] os.listdir breaks with literal paths

2011-10-20 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +haypo

___
Python tracker 

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



[issue13235] logging.warn() is not documented

2011-10-20 Thread anatoly techtonik

New submission from anatoly techtonik :

No docs for logging.warn() alias.

--
assignee: docs@python
components: Documentation
messages: 146039
nosy: docs@python, techtonik
priority: normal
severity: normal
status: open
title: logging.warn() is not documented
versions: Python 2.7, Python 3.3

___
Python tracker 

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



[issue13235] logging.warn() is not documented

2011-10-20 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue7322] Socket timeout can cause file-like readline() method to lose data

2011-10-20 Thread R. David Murray

R. David Murray  added the comment:

I don't think it is optimistic.  The poplib transaction pattern is: send a 
command, get a response.  If the response is not properly terminated, throw it 
away.  Send a new command, get a response.  There's no ambiguity there.  In 
addition, this is a common tcp client-server model, so I think it applies more 
widely than just poplib.

Please note that the timeout is *not* because the socket data transmission has 
timed out and data was lost in transit.  There are no partially filled readline 
buffers in this scenario.  The timeout is because the client is waiting for a 
*line* of data that the server never sends.  Again, this is likely to be a 
common failure mode in tcp client/server applications, and to my mind is 
exactly what the timeout parameter to the constructor is most useful for.

--

___
Python tracker 

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



[issue6397] Implementing Solaris "poll" in the "select" module

2011-10-20 Thread Jesús Cea Avión

Jesús Cea Avión  added the comment:

I want to move this forward.

Apparently, "/dev/poll" could be actually used transparently in python 
"select.poll()" implementation. The semantics seems to be the same, so we could 
use the "poll" syscall or "/dev/poll" statically at compiling time, or 
dinamically at poll object creation time (try to open /dev/poll and go to 
"poll" syscall if that fails).

Some details:

http://developers.sun.com/solaris/articles/using_devpoll.html
http://developers.sun.com/solaris/articles/polling_efficient.html

I agree that Solaris 10 event framework would be nice to support too, but that 
would be another feature request.

--

___
Python tracker 

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



[issue6397] Implementing Solaris "poll" in the "select" module

2011-10-20 Thread Jesús Cea Avión

Changes by Jesús Cea Avión :


--
versions: +Python 3.3 -Python 2.7, Python 3.2

___
Python tracker 

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



[issue13235] logging.warn() is not documented

2011-10-20 Thread Vinay Sajip

Vinay Sajip  added the comment:

That's deliberate. The original code (before incorporation into Python) had 
warn(), which was kept for backward compatibility. The docs refer to warning() 
because that's what everyone is supposed to use. The method names map to the 
lower case of the appropriate logging level name.

--
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue13236] unittest needs more flush calls

2011-10-20 Thread Peter Eisentraut

New submission from Peter Eisentraut :

I'm using the TextTestRunner class in unittest/runner.py with a special 
file-like object passed in as stream.  Doing this loses some output, because 
the run() method (and some lower-level methods) don't always call flush() on 
the stream.  There is also no obvious cleanup method in the runner class that 
might do this, so I assume run() should do that itself.

Right now, it looks like it assumes that either the stream is effectively 
unbuffered, like stderr, or that the end of the program might flush things, but 
that doesn't always apply.

It looks like the best fix would be a self.stream.flush() call at the end of 
run().  Another flush() call at the end of printErrorList() would also help.

(In the meantime, I have fixed up my special file-like class to flush its 
internal buffers when a newline is seen, which kind of works, but a proper 
cleanup of this matter would still be nice.)

--
components: Library (Lib)
messages: 146043
nosy: petere
priority: normal
severity: normal
status: open
title: unittest needs more flush calls
type: behavior
versions: 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



[issue13236] unittest needs more flush calls

2011-10-20 Thread R. David Murray

R. David Murray  added the comment:

How can a lack of flushes lose output?  Delay it maybe, but unless your file 
class is broken I don't see how data would be lost.

--
nosy: +r.david.murray
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



[issue13235] logging.warn() is not documented

2011-10-20 Thread anatoly techtonik

anatoly techtonik  added the comment:

I've got a traceback, because forgot to implement this method in logging 
wrapper. It should be either deprecated and removed or documented.

--
status: closed -> open

___
Python tracker 

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



[issue13226] Expose RTLD_* constants in the posix module

2011-10-20 Thread STINNER Victor

STINNER Victor  added the comment:

Updated patch: remove "either" in the documentation. Thanks neologix par the 
review.

--
Added file: http://bugs.python.org/file23483/posix_rtld-2.patch

___
Python tracker 

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



[issue12753] \N{...} neglects formal aliases and named sequences from Unicode charnames namespace

2011-10-20 Thread Florent Xicluna

Changes by Florent Xicluna :


--
nosy: +flox

___
Python tracker 

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



[issue7322] Socket timeout can cause file-like readline() method to lose data

2011-10-20 Thread Florent Xicluna

Changes by Florent Xicluna :


--
nosy: +flox

___
Python tracker 

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



[issue13235] logging.warn() is not documented

2011-10-20 Thread Vinay Sajip

Vinay Sajip  added the comment:

It is deprecated by not being documented. It certainly isn't going to have 
documentation added for it.

Which code was calling the warn() method? Is it not possible to change this to 
call warning()?

- Original Message -
> From: anatoly techtonik 
> To: vinay_sa...@yahoo.co.uk
> Cc: 
> Sent: Thursday, 20 October 2011, 20:32
> Subject: [issue13235] logging.warn() is not documented
> 
> 
> anatoly techtonik  added the comment:
> 
> I've got a traceback, because forgot to implement this method in logging 
> wrapper. It should be either deprecated and removed or documented.
> 
> --
> status: closed -> open
> 
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue7322] Socket timeout can cause file-like readline() method to lose data

2011-10-20 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

If the server failed to close a transaction the protocol stream is over
unless you mime relying on hope and luck. Poplib has a nasty set of server
implementation bugs to work around here.

Readline as defined today no longer suits its needs but I still strongly
believe the behavior of shutting reading down after a timeout is a good one.

One thing that would solve your common case: don't shut down reading on a
readline timeout if zero data was received into the internal line buffer.
Readline could indicate this by modifying the timeout exception being raised
to indicate if it can recover or not. The flag should only be set if it was
unrecoverable.
On Oct 20, 2011 11:01 AM, "R. David Murray"  wrote:

>
> R. David Murray  added the comment:
>
> I don't think it is optimistic.  The poplib transaction pattern is: send a
> command, get a response.  If the response is not properly terminated, throw
> it away.  Send a new command, get a response.  There's no ambiguity there.
>  In addition, this is a common tcp client-server model, so I think it
> applies more widely than just poplib.
>
> Please note that the timeout is *not* because the socket data transmission
> has timed out and data was lost in transit.  There are no partially filled
> readline buffers in this scenario.  The timeout is because the client is
> waiting for a *line* of data that the server never sends.  Again, this is
> likely to be a common failure mode in tcp client/server applications, and to
> my mind is exactly what the timeout parameter to the constructor is most
> useful for.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue7322] Socket timeout can cause file-like readline() method to lose data

2011-10-20 Thread R. David Murray

R. David Murray  added the comment:

Your suggestion sounds good to me.

I still think that it is a common failure mode in a client server transaction 
for the server to fail to send a (complete) line that the client is expecting, 
and vice versa, requiring a timeout, but not necessarily a "restart from 
scratch".  Often the client/server protocol has a useful checkpoint to restart 
from short of start from scratch.  In the case of many protocols, that would be 
"client issues a new command".

--

___
Python tracker 

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



[issue13125] test_all_project_files() expected failure

2011-10-20 Thread Mikhail Novikov

Mikhail Novikov  added the comment:

Updated patch to work properly with verbosity.

--
Added file: http://bugs.python.org/file23484/i13125-2.patch

___
Python tracker 

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




[issue13236] unittest needs more flush calls

2011-10-20 Thread Ezio Melotti

Ezio Melotti  added the comment:

Can you provide a minimal test case to reproduce the issue?

--
nosy: +ezio.melotti
stage:  -> test needed
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



[issue9168] setuid in smtp.py sheds privileges before binding port

2011-10-20 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 7d92b94b0eec by Florent Xicluna in branch '3.2':
Issue #9168: now smtpd is able to bind privileged port.
http://hg.python.org/cpython/rev/7d92b94b0eec

New changeset bbd92b42508e by Florent Xicluna in branch 'default':
Issue #9168: now smtpd is able to bind privileged port.
http://hg.python.org/cpython/rev/bbd92b42508e

--
nosy: +python-dev

___
Python tracker 

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



[issue9168] setuid in smtp.py sheds privileges before binding port

2011-10-20 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset d2f303861c98 by Florent Xicluna in branch '2.7':
Issue #9168: now smtpd is able to bind privileged port.
http://hg.python.org/cpython/rev/d2f303861c98

--

___
Python tracker 

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



[issue9168] setuid in smtp.py sheds privileges before binding port

2011-10-20 Thread Florent Xicluna

Florent Xicluna  added the comment:

Fixed. Thank you for the patch.

--
nosy: +flox
resolution:  -> fixed
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



[issue12170] index() and count() methods of bytes and bytearray should accept byte ints

2011-10-20 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset c1effa2cdd20 by Antoine Pitrou in branch 'default':
Issue #12170: The count(), find(), rfind(), index() and rindex() methods
http://hg.python.org/cpython/rev/c1effa2cdd20

--
nosy: +python-dev

___
Python tracker 

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



[issue12170] index() and count() methods of bytes and bytearray should accept byte ints

2011-10-20 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Patch committed, thank you!

--
assignee: rhettinger -> 
resolution:  -> fixed
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



[issue13235] logging.warn() is not documented

2011-10-20 Thread anatoly techtonik

anatoly techtonik  added the comment:

./trac/env.py:self.log.warn('base_url option not set in 
configuration, '
./trac/env.py:self.log.warn('Couldn\'t write sample configuration 
file (%s)', e,
./trac/web/main.py:##env.log.warn("%d uncollectable objects 
found.", uncollectable)
./trac/web/main.py:env.log.warn(exception_to_unicode(e))
./trac/web/.svn/text-base/main.py.svn-base:##env.log.warn("%d 
uncollectable objects found.", uncollectable)
./trac/web/.svn/text-base/main.py.svn-base:
env.log.warn(exception_to_unicode(e))
./trac/wiki/formatter.py:self.env.log.warn(e)
./trac/wiki/.svn/text-base/formatter.py.svn-base:
self.env.log.warn(e)
./trac/versioncontrol/api.py:self.log.warn("Discarding 
duplicate repository '%s'",
./trac/versioncontrol/api.py:self.log.warn("Found no repositories 
matching '%s' base.",
./trac/versioncontrol/svn_prop.py:
self.log.warn("svn:externals entry %s doesn't contain "
./trac/versioncontrol/.svn/text-base/api.py.svn-base:
self.log.warn("Discarding duplicate repository '%s'",
./trac/versioncontrol/.svn/text-base/api.py.svn-base:
self.log.warn("Found no repositories matching '%s' base.",
./trac/versioncontrol/.svn/text-base/svn_prop.py.svn-base:
self.log.warn("svn:externals entry %s doesn't contain "
./trac/ticket/roadmap.py:def warn(msg):
./trac/ticket/roadmap.py:warn(_('Milestone "%(name)s" already 
exists, please '
./trac/ticket/roadmap.py:warn(_('You must provide a name for 
the milestone.'))
./trac/ticket/roadmap.py:warn(_('Completion date may not be in 
the future'))
./trac/ticket/.svn/text-base/roadmap.py.svn-base:def warn(msg):
./trac/ticket/.svn/text-base/roadmap.py.svn-base:
warn(_('Milestone "%(name)s" already exists, please '
./trac/ticket/.svn/text-base/roadmap.py.svn-base:warn(_('You 
must provide a name for the milestone.'))
./trac/ticket/.svn/text-base/roadmap.py.svn-base:
warn(_('Completion date may not be in the future'))
./trac/admin/web_ui.py:self.env.log.warn("Adding %s to 
group %s: " \
./trac/admin/.svn/text-base/web_ui.py.svn-base:
self.env.log.warn("Adding %s to group %s: " \
./trac/prefs/web_ui.py:self.log.warn('Unknown preference panel %r', 
panel_id)
./trac/prefs/.svn/text-base/web_ui.py.svn-base:
self.log.warn('Unknown preference panel %r', panel_id)
./trac/.svn/text-base/env.py.svn-base:self.log.warn('base_url 
option not set in configuration, '
./trac/.svn/text-base/env.py.svn-base:self.log.warn('Couldn\'t 
write sample configuration file (%s)', e,


quite a lot + probably trac plugins. So it's better to go through deprecation 
cycle and show appropriate message (but frankly - I don't mind against 
convenience alias - we already have some in testing modules).

--

___
Python tracker 

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



[issue13235] logging.warn() is not documented

2011-10-20 Thread Ezio Melotti

Ezio Melotti  added the comment:

I think it's better to avoid "deprecations by missing documentation" and 
document explicitly if something is deprecated.
What happens is that people working on some old code find the deprecated 
method, check the doc to see what it does, don't find anything, get puzzled for 
a while until they figure out how it works, and then use it.
If they find it and see that is deprecated they will stop using it and start 
using the right method.
While it's true that new users don't need to know that there's a deprecated 
method, it's unlikely that they will start using it, so documenting deprecated 
methods makes more good than harm.
If you want to remove it eventually you'll also have to go through an actual 
deprecation process with warnings.

--
nosy: +ezio.melotti
resolution: invalid -> 
stage:  -> needs patch
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



[issue13237] subprocess docs should use emphasise convenience functions

2011-10-20 Thread Nick Coghlan

New submission from Nick Coghlan :

Many typical subprocess use cases can now be handled simply via the convenience 
functions:

  subprocess.call()
  subprocess.check_call()
  subprocess.check_output()

However, readers of the documentation could be forgiven for not realising that, 
since the docs dive right in with Popen() and will scare most readers away in 
search of more user friendly APIs (or even other languages).

The module documentation should be reordered to introduce the helper function 
first, then Popen afterwards.

The "subprocess replacements" [1] section would ideally help address this, but 
it hasn't been updated to use the convenience function, instead using confusing 
direct calls to Popen.

[1] http://docs.python.org/library/subprocess.html#subprocess-replacements

--
assignee: docs@python
components: Documentation
messages: 146059
nosy: docs@python, ncoghlan
priority: normal
severity: normal
stage: needs patch
status: open
title: subprocess docs should use emphasise convenience functions
versions: Python 2.7, 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



[issue13237] subprocess docs should use emphasise convenience functions

2011-10-20 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue13214] Cmd: list available completions from the cmd.Cmd subclass and filter out EOF handler(s)

2011-10-20 Thread Garrett Cooper

Garrett Cooper  added the comment:

Here's a version incorporating your suggestion and better documenting the 
choices and the method for overriding purposes. I have a few reservations with 
the current implementation:

1. As noted, the information for the class really could be and should be cached 
as the attributes of a given cmd.Cmd derived class don't change all that 
frequently.
2. One has to override the entire function in order to get what I consider 
standard functionality (filtering).. so I don't know if that's a good idea.
3. I've thought about the do_EOF handler stuff, and it would be nice if that 
was shoved into the completer method(s) as a keyword argument, defaulting to 
False -- that way one could avoid having to explicitly install an EOF handler 
when dealing with ^D, etc, but this can be hashed out better in a different 
issue, over IRC, email, etc.

This module could be better cleaned up (isn't PEP8 compliant, overrides 
built-ins, is pythonic but not super pythonic, etc), but I'll see what other 
modules exist out there that could be used in its place, because they could 
have resolved some of these issues. There is some value that can be obtained 
from pexpect, some of the other cmd module variants, etc .. I just like this 
module because it's nice, simple, and standard -- it just needs a little love 
and it will be awesome.

Anyhow -- thanks again for the work :).

--
Added file: http://bugs.python.org/file23485/python-cmd-better-filtering.patch

___
Python tracker 

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



[issue13238] Add shell command helpers to shutil module

2011-10-20 Thread Nick Coghlan

New submission from Nick Coghlan :

I've been doing a few systems administration tasks with Python recently, and 
shell command invocation directly via the subprocess module is annoyingly 
clunky (even with the new convenience APIs).

Since subprocess needs to avoid the shell by default for security reasons, I 
suggest we add the following simple helper functions to shutil:

def call(cmd, *args, **kwds):
if args or kwds:
cmd = cmd.format(*args, **kwds)
return subprocess.call(cmd, shell=True)

def check_call(cmd, *args, **kwds):
if args or kwds:
cmd = cmd.format(*args, **kwds)
return subprocess.check_call(cmd, shell=True)

def check_output(cmd, *args, **kwds):
if args or kwds:
cmd = cmd.format(*args, **kwds)
return subprocess.check_output(cmd, shell=True)


Initially posted at:
http://code.activestate.com/recipes/577891-simple-invocation-of-shell-commands/

Of course, even if others agree in principle, documentation and tests are still 
needed before this change can go anywhere.

--
components: Library (Lib)
messages: 146061
nosy: ncoghlan
priority: normal
severity: normal
status: open
title: Add shell command helpers to shutil module
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



[issue13238] Add shell command helpers to shutil module

2011-10-20 Thread Alex Gaynor

Alex Gaynor  added the comment:

These feel like a shell injection waiting to happen to me.

--
nosy: +alex

___
Python tracker 

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



[issue13237] subprocess docs should emphasise convenience functions

2011-10-20 Thread Nick Coghlan

Changes by Nick Coghlan :


--
title: subprocess docs should use emphasise convenience functions -> subprocess 
docs should emphasise convenience functions

___
Python tracker 

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



[issue13235] logging.warn() is not documented

2011-10-20 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 37479f0f68bc by Vinay Sajip in branch 'default':
Closes #13235: Added deprecation for warn() methods and function in logging.
http://hg.python.org/cpython/rev/37479f0f68bc

--
nosy: +python-dev
resolution:  -> fixed
stage: needs patch -> 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



[issue13232] Logging: Unicode Error

2011-10-20 Thread Thomas Guettler

Changes by Thomas Guettler :


Added file: http://bugs.python.org/file23486/unicodedecodeerror-in-logging.py

___
Python tracker 

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



[issue13238] Add shell command helpers to shutil module

2011-10-20 Thread Nick Coghlan

Nick Coghlan  added the comment:

And that's exactly the problem - a web developer's or security auditor's "shell 
injection" is a system administrator's "this language sucks".

These wrappers are the kind of thing you want for shell invocations when using 
Python as a replacement for a shell script or rewriting something that was 
originally written in Perl, but they're a terrible idea if anything you're 
interpolating came from an untrusted data source.

Currently, requiring "shell=True" in the arguments to the subprocess calls is 
considered a sufficient deterrent against people doing the wrong thing. I'm 
suggesting that requiring "import shutil" instead of "import subprocess" may be 
a similarly acceptable compromise that better serves the system administrators 
that choose to use Python for system automation tasks.

--

___
Python tracker 

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



[issue13232] Logging: Unicode Error

2011-10-20 Thread Thomas Guettler

Thomas Guettler  added the comment:

I attached a testcase (unicodedecodeerror-in-logging.py). If the 
filesystemencoding is UTF-8 and the source code is encoded in latin1, then the 
logging fails. It happens because there is a German umlaut in the comment 
behind 1/0.

I added 'replace' to the decode() in __init__.py and the it works. The German 
umlaut gets displayed as inverted question mark. But this is better than no 
logging message.

--

___
Python tracker 

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



[issue13238] Add shell command helpers to shutil module

2011-10-20 Thread Nick Coghlan

Nick Coghlan  added the comment:

Perhaps a better idea would be to use different names, so it's clearer at the 
point of invocation that the shell is being invoked (and hence shell injection 
attacks are a potential concern). For example:

  shell_call
  check_shell_call
  check_shell_output

That would make large applications easier to audit (just search for 'shell_') 
while still making life easier for sysadmins.

--

___
Python tracker 

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