[issue10503] os.getuid() documentation should be clear on what kind of uid it is referring

2010-11-22 Thread Giampaolo Rodola'

New submission from Giampaolo Rodola' g.rod...@gmail.com:

http://docs.python.org/library/os.html#os.getuid
os.getuid() documentation just states:

 Return the current process’s user id.

It is not clear, however, whether user id refers to real, effective or saved 
user id.

As per:
http://linux.about.com/library/cmd/blcmdl2_getuid.htm
...it should refer to _real_ user id.

--
assignee: d...@python
components: Documentation
messages: 122117
nosy: d...@python, giampaolo.rodola
priority: normal
severity: normal
status: open
title: os.getuid() documentation should be clear on what kind of uid it is 
referring
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2

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



[issue10503] os.getuid() documentation should be clear on what kind of uid it is referring

2010-11-22 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

Update: I think also os.getlogin() doc is wrong.
This is what it states (2.7 doc):


 Return the name of the user logged in on the controlling terminal of 
 the process. For most purposes, it is more useful to use the 
 environment variable LOGNAME to find out who the user is, or 
 pwd.getpwuid(os.getuid())[0] to get the login name of the currently 
 effective user id.

Since os.getuid() refers to _real_ uid the last sentence should be changed as 
such:

- ... to get the login name of the currently effective user id.
+ ... to get the login name of the currently real user id.

--

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



[issue10503] os.getuid() documentation should be clear on what kind of uid it is referring

2010-11-22 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

Indeed, now that I google for getlogin, it's not easy to figure out what kind 
of user it is supposed to return exactly.

For getuid() it seems pretty clear that we're talking about _real_ uid, though.
http://www.manpagez.com/man/2/getuid/
http://linux.die.net/man/2/getuid

--

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



[issue1745035] DoS smtpd vulnerability

2010-11-23 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

I think data_size_limit and command_size_limit should be class attributes 
instead of instance attributes.

--

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




[issue1745035] DoS smtpd vulnerability

2010-11-23 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

AFAICT patch looks ok to me.

--

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



[issue10516] Add list.clear() and list.copy()

2010-11-24 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
nosy: +giampaolo.rodola

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



[issue2001] Pydoc interactive browsing enhancement

2010-12-03 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
nosy:  -giampaolo.rodola

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



[issue9129] DoS smtpd module vulnerability

2010-12-07 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

Fixed for Python 2.6 in r87123.
Closing out as fixed.

--
resolution:  - fixed
status: open - closed

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



[issue10711] Rip out HTTP 0.9 support

2010-12-15 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
nosy: +giampaolo.rodola

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



[issue10784] os.getpriority() and os.setpriority()

2010-12-27 Thread Giampaolo Rodola'

New submission from Giampaolo Rodola' g.rod...@gmail.com:

After having implemented a similar thing in psutil ( 
http://code.google.com/p/psutil/issues/detail?id=142 ) I decided to contribute 
a patch for Python which exposes getpriority() and setpriority() POSIX calls in 
the os module.

They can be used to get/set process niceness/priority in a fashion similar to 
os.nice() but extended to *all* processes instead of just os.getpid():
http://linux.die.net/man/2/setpriority

--
assignee: giampaolo.rodola
keywords: patch
messages: 124751
nosy: giampaolo.rodola, loewis, pitrou
priority: normal
severity: normal
status: open
title: os.getpriority() and os.setpriority()
versions: Python 3.3

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



[issue10784] os.getpriority() and os.setpriority()

2010-12-27 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

Forgot to attach the patch.

--
Added file: http://bugs.python.org/file20177/getsetpriority.patch

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



[issue10784] os.getpriority() and os.setpriority()

2010-12-27 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
nosy: +christian.heimes

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



[issue5672] Implement a way to change the python process name

2010-12-28 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

 If somebody would provide a patch that adds prctl to the posix module,
 that would be fine with me - we have a long tradition of exposing all
 available system calls if somebody wants them.

Just for the record, I was about to try to do this, when I realized that 
exposing prctl requires expecting a variable number of arguments with variable 
types.
It turns out providing a Python wrapper for such a kind of C API is just a pain.
There's an implementation though, handling 2 args only (instead of 5):
https://github.com/seveas/python-prctl/blob/master/_prctlmodule.c#L9
Considering that this also Linux-only, I don't think it really worths the 
effort.

--

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



[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0

2011-01-03 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
nosy:  -giampaolo.rodola

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



[issue1559549] ImportError needs attributes for module and file name

2011-01-07 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
nosy: +giampaolo.rodola

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



[issue10878] asyncore does not react properly on close()

2011-01-09 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

Problem is you have to return False right after close().
There's an open issue to add a scheduler to asyncore:
http://bugs.python.org/issue1641
Closing this out as invalid.

--
nosy: +giampaolo.rodola
resolution:  - invalid
status: open - closed

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



[issue10784] os.getpriority() and os.setpriority()

2011-01-10 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

Question: should Py_BEGIN/END_ALLOW_THREADS be used around getpriority() and 
setpriority() calls? It's still not clear to me when to use them exactly.

--

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



[issue10878] asyncore does not react properly on close()

2011-01-10 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

What if you return False also in writable method?

--

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



[issue10882] Add os.sendfile()

2011-01-11 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

Thanks for writing this.
Follows my comments.

I would focus on trying to provide a unique interface across all platforms. 
Being sendfile() not a standard POSIX I think we should not worry about 
providing a strict one-to-one interface.

headers and trailers arguments should be available everywhere as they are 
crucial in different protocols such as HTTP.
On Linux this is possible by using the TCP_CORK option.
man sendfile on Linux provides some information. Also you might find useful 
to see how medusa did this (/medusa-20010416/sendfile/sendfilemodule.c):
http://www.nightmare.com/medusa/

The offset parameter should be available everywhere, Linux included (in your 
patch you dropped Linux support).
Also, I think it should be optional since when it's NULL, sendfile() implicitly 
assumes the current offset (file's tell() return value).
This is true on Linux, at least. Not sure about other platforms but my best 
guess is that it should not be mandatory.

It turns out the only peculiar argument is flags, available only on *BSD.
I'm not sure what's best to do here. Maybe it makes sense to provide it across 
all platforms, defaulting to 0 and raise ValueError when specified on systems 
!= *BSD.
In summary, the function might look like this:

sendfile(out, in, count, offset=None, headers=None, trailers=None, flags=0)

--

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



[issue10882] Add os.sendfile()

2011-01-11 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

 Also, I think it should be optional since when it's NULL, sendfile() 
 implicitly assumes the current offset (file's tell() return value).
 This is true on Linux, at least. Not sure about other platforms but my 
 best guess is that it should not be mandatory.

I'm not so sure about this anymore. Please ignore this.

--

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



[issue10882] Add os.sendfile()

2011-01-11 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

I agree then, although I'm not sure there are other functions in the os module 
(or anywhere else) having a variable number of args depending on the platform.
I wanted to try your patch but it does not apply cleanly (python 3.2, revision 
87930).

--

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



[issue10882] Add os.sendfile()

2011-01-11 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

I agree then, although I'm not sure having a function with a variable number of 
args depending on the platform is acceptable.
I wanted to try your patch but it does not apply cleanly (python 3.2, revision 
87930).

--

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



[issue10882] Add os.sendfile()

2011-01-11 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
Removed message: http://bugs.python.org/msg126007

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



[issue4112] Subprocess: Popen'ed children hang due to open pipes

2011-01-11 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
nosy: +giampaolo.rodola

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



[issue10882] Add os.sendfile()

2011-01-11 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

The patch as-is did not work on Linux. 
I had to add entries in pyconfig.h.in and configure files in order to make 
os.sendfile available.
Patch is in attachment.

--
Added file: http://bugs.python.org/file20357/sendfile_v2.patch

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



[issue2292] Missing *-unpacking generalizations

2011-01-13 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
nosy: +giampaolo.rodola

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



[issue1615158] POSIX capabilities support

2011-01-17 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
nosy: +giampaolo.rodola
versions: +Python 3.3 -Python 3.2

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



[issue9344] please add posix.getgrouplist()

2011-01-17 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
nosy: +giampaolo.rodola

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



[issue4761] create Python wrappers for openat() and others

2011-01-20 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
nosy: +giampaolo.rodola

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



[issue10982] asyncore timeouts do not work correctly

2011-01-22 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

You have misinterpreted the purpose of timeout argument.
timeout argument tells select() or poll() how long they have to wait before 
returning in case no file descriptors are ready.
This has nothing to do with asyncore.loop() which is supposed to keep running 
except when:

- all file descriptors have been closed/extinguished
- the count argument is provided

...in which case it finally returns.
Closing out as invalid.

--
resolution:  - invalid
status: open - closed

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



[issue10968] threading.Timer should be a class so that it can be derived

2011-01-22 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
nosy: +giampaolo.rodola

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



[issue10852] SSL/TLS sni use in smtp, pop, imap, nntp, ftp client libs by default

2011-01-24 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
nosy: +giampaolo.rodola

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



[issue10963] subprocess can raise OSError (EPIPE) when communicating with short-lived processes

2011-01-24 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
nosy: +giampaolo.rodola

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



[issue10882] Add os.sendfile()

2011-01-25 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

Please note that on FreeBSD things work a little bit differently for 
non-blocking sockets:
http://www.freebsd.org/cgi/man.cgi?query=sendfilesektion=2

In details I'm talking about:

 When using a socket marked for non-blocking I/O, sendfile() may send
 fewer bytes than requested.  In this case, the number of bytes 
 success-fully written is returned in *sbytes (if specified), and the 
 error EAGAIN is returned.

...and the similar note about EBUSY, later in the page.
Something like this should work:


ret = sendfile(in, out, offset, sbytes, sf, flags);

...

if (ret == -1) {
if ((errno == EAGAIN) || (errno == EBUSY)) {
return Py_BuildValue(ll, sbytes, offset + sbytes);
} 
return posix_error();
}

--

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



[issue5097] asyncore.dispatcher_with_send undocumented

2011-01-27 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

I documented this some months ago:
http://docs.python.org/library/asyncore.html#asyncore.dispatcher_with_send
Being asynchat's push() method more convenient for such kind of task I 
expressively avoided to be too specific about dispatcher_with_send.

--
resolution:  - fixed
status: open - closed
versions:  -Python 2.6, Python 3.1

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



[issue1191964] asynchronous Subprocess

2011-01-27 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
versions: +Python 3.3 -Python 3.2

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



[issue10882] Add os.sendfile()

2011-01-28 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

Could you please also add support for offset argument on Linux?
Also, headers, trailers and flags could be turned in keyword args for 
simplicity.

--

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



[issue3561] Windows installer should add Python and Scripts directories to the PATH environment variable

2011-01-28 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
nosy: +giampaolo.rodola

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



[issue10882] Add os.sendfile()

2011-01-28 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

 Copy *count* bytes from file descriptor *in* to file descriptor 
 *out*, starting at *offset* and continuing for *count* bytes.

The latter part is incorrect as it is not guaranteed that all bytes specified 
in count argument are going to be sent and it also sounds like the function 
is blocking.
I'd change that in just Copy *count* bytes from file descriptor *in* to file 
descriptor *out*.

Also, I'd be for using the BSD notation and rename the count argument to 
nbytes, which is more clear.

Docstring should be changed to reflect the keyword arguments:
- sendfile(out, in, offset, count, headers, trailers, flags)\n\
+ sendfile(out, in, offset, count[, headers[, trailers], flags]]])\n\

Finally, tests for header and trailer arguments should be written.

The rest of the patch looks ok to me.

--

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



[issue10882] Add os.sendfile()

2011-01-28 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

 I'm pretty sure that Solaris isn't the only platform that supports non-
 socket file descriptors here, Linux (the platform I'm using), is one 
 such case. 

No, sendfile() on Linux supports only socket file descriptors:
http://linux.die.net/man/2/sendfile

--

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



[issue11049] add tests for test.support

2011-01-28 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

Attached is a patch which tests about half the API.
Certain functions are not documented and/or it's not clear what they do, for 
others it seems unlikely they are actually used nowadays (although I haven't 
checked).
Also, it probably makes sense to get rid of some functions which look very old 
or completely useless.

--
keywords: +patch
nosy: +giampaolo.rodola
Added file: http://bugs.python.org/file20596/test_support.patch

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



[issue11015] Bring test.support docs up to date

2011-01-29 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
nosy: +giampaolo.rodola

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



[issue11049] add tests for test.support

2011-01-29 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

 * class TestCase(unittest.TestCase): - why not give the test class a 
 more useful name?

done

 * import_fresh_module is tested similarly to import_module - can't a 
 test be added that it indeed performs its special sauce?

Even by reading the source code I'm not sure what import_fresh_module does 
exactly.
Feel free to write a test for it if you want.

 * test_DirsOnSysPath: you may want to use assertIn and assertNotIn here. 
 [these 
 were added to Python in 3.1]

done

 * test_python_is_optimized: you may want to use assertIsInstance here.

done

 +os.mkdir(os.path.join(TESTFN, TESTFN))
 Please don't. This will break the day TESTFN becomes a non-trivial path.

done

 You should also check that the errno is EBADF.

Done. I just hope it's gonna be reliable on all platforms.

--
Added file: http://bugs.python.org/file20602/test_support.patch

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



[issue11051] system calls per import

2011-01-30 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
nosy: +giampaolo.rodola

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



[issue11072] Add MLSD command support to ftplib

2011-01-30 Thread Giampaolo Rodola'

New submission from Giampaolo Rodola' g.rod...@gmail.com:

From RFC-3659:

   The MLST and MLSD commands are intended to standardize the file and
   directory information returned by the server-FTP process.  These
   commands differ from the LIST command in that the format of the
   replies is strictly defined although extensible.

The patch in attachment adds support for MLSD command.
This should ease the development of ftp clients which are forced to parse 
un-standardized LIST responses via dir() or retrlines() methods to obtain 
meaningful data for the directory listing.

Example:


 import ftplib
 from pprint import pprint as pp
 f = ftplib.FTP()
 f.connect(localhost)
 f.login(anonymous)
 ls = f.mlsd()
 pp(ls)
 {'modify': 20100814164724,
  'name': 'svnmerge.py',
  'perm': 'r',
  'size': 90850,
  'type': 'file',
  'unique': '80718b568'},
 {'modify': 20101207185033,
  'name': 'README',
  'perm': 'r',
  'size': 53731,
  'type': 'file',
  'unique': '80718aafe'},
 {'modify': 20100417183215,
  'name': 'install-sh',
  'perm': 'r',
  'size': 7122,
  'type': 'file',
  'unique': '80718b2d2'},
 {'modify': 20110129210053,
  'name': 'Include',
  'perm': 'el',
  'size': 4096,
  'type': 'dir',
  'unique': '8071a2bc4'}]


--
files: ftplib_mlsd.patch
keywords: patch
messages: 127562
nosy: giampaolo.rodola, pitrou
priority: normal
severity: normal
status: open
title: Add MLSD command support to ftplib
versions: Python 3.3
Added file: http://bugs.python.org/file20623/ftplib_mlsd.patch

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



[issue10882] Add os.sendfile()

2011-01-30 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

In case someone is interested in statistics, I wrote a sendfile() wrapper by 
using ctypes for pyftpdlib and benchmark results are quite impressive:
http://code.google.com/p/pyftpdlib/issues/detail?id=152#c5

--

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



[issue11117] Implementing Async IO

2011-02-04 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
nosy: +giampaolo.rodola

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



[issue11127] sockets should not be pickleable

2011-02-05 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
nosy: +giampaolo.rodola

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



[issue11109] socketserver.ForkingMixIn leaves zombies

2011-02-05 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
nosy: +giampaolo.rodola

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



[issue10882] Add os.sendfile()

2011-02-05 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

Patch in attachment provides a complete test suite.
It also fixes a problem which occurred on BSD platforms when using non-blocking 
sockets: EAGAIN/EBUSY are now raised if the transmitted data == 0 bytes 
reflecting socket's send() behavior:

+if (ret  0) {
+if ((errno == EAGAIN) || (errno == EBUSY)) {
+if (sbytes != 0) {
+// some data has been sent
+goto done;
+}
+else {
+// no data has been sent; upper application is supposed
+// to retry on EAGAIN or EBUSY
+return posix_error();
+}
+}
+return posix_error();
+}
+goto done;

The test suite shows that trailer argument does not work.
I couldn't manage to figure out what's wrong though.

--
Added file: http://bugs.python.org/file20688/sendfile_v6.patch

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



[issue10882] Add os.sendfile()

2011-02-06 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

You're right, that line is certainly wrong as it should compare for bytes but 
the trailer data still doesn't get appended.
Do you have a BSD box in order to figure out what's wrong?

--

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



[issue10882] Add os.sendfile()

2011-02-07 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

I was testing against FreeBSD 7.0 RC1 and I confirm the problem doesn't occur 
on 8.1 version. Patch in attachment adds test for flags argument and skips 
headers/trailers tests on linux and solaris.
I'm ok for committing this as-is in 3.3.

--
resolution:  - accepted
status: open - pending
Added file: http://bugs.python.org/file20708/sendfile_v7.patch

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



[issue10882] Add os.sendfile()

2011-02-09 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

On a second thought I have two complaints.

There is no reason to return the file offset, also because this is only 
supported on Linux. On all other platforms we are calculating the file offset 
by making a sum of offset + number of bytes sent. Despite this would normally 
work it no longer makes sense when headers/trailers arguments are specified.

 sendfile(in, out, offset, 4096, headers=[b])
(5000, 5000)

In this case the right offset is supposed to be 4096.
We might adjust this in the code but in my opinion knowing the file offset is 
not really necessary as what the user really needs is the number of bytes sent, 
as when using socket.send().

My second complaint is about headers/trailers data type.
Currently we are passing a sequence of buffers (tipically a list) but I think 
we should pass plain bytes instead.

--

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



[issue10882] Add os.sendfile()

2011-02-10 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

Patch in attachment removes offset and return just the number of bytes sent as 
an integer.
Tests and documentation are updated accordingly.

--
Added file: http://bugs.python.org/file20733/sendfile_v8.patch

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



[issue11177] Set asyncore create_socket default argument

2011-02-10 Thread Giampaolo Rodola'

New submission from Giampaolo Rodola' g.rod...@gmail.com:

At the current state asyncore implicitly supports TCP (SOCK_STREAM) sockets 
only, despite UDP support might be added in the future.
For simplicity, create_socket() should assume TCP/IP by default.
This would avoid the user to import socket and specify the two constants 
every time, which is annoying.

--
files: asyncore_create_socket.patch
keywords: patch
messages: 128327
nosy: giampaolo.rodola
priority: normal
severity: normal
status: open
title: Set asyncore create_socket default argument
versions: Python 3.3
Added file: http://bugs.python.org/file20735/asyncore_create_socket.patch

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



[issue11177] Set asyncore create_socket default argument

2011-02-10 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
assignee:  - giampaolo.rodola

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



[issue11181] TLS end connection not detected properly in retrbinary

2011-02-11 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

Please provide more information.
Have you actually seen this happen?
retrlines method isn't currently looking for EOF.

--

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



[issue10084] SSL support for asyncore

2011-02-12 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

Initial draft of a patch including tests and a new ssl_dispatcher subclass.
asynchat needs to be changed as well, probably by using a mixin class.

--
keywords: +patch
Added file: http://bugs.python.org/file20752/asyncore_ssl_v1.patch

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



[issue11214] test_asyncore fails on AIX

2011-02-14 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

I'd say the test can be removed. It's not really important.

--
assignee:  - giampaolo.rodola

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



[issue11227] [DOC] asyncore - use 'Host' header in HTTP example

2011-02-16 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

Patch looks fine to me.

--

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



[issue11232] asyncore - don't throw a traceback when a client disconnects in echo server example

2011-02-17 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

+1

--

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



[issue11257] asyncore stores unnecessary object references

2011-02-20 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

 Such code should be rewritten via weakref.

Can you write a patch?

--

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



[issue11259] asynchat does not check if terminator is negative integer

2011-02-20 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

What do you mean by constructions like self.ac_in_buffer[:n] will lead to 
misbehaviour.?
Please try to be more precise (e.g. by providing a piece of code which 
demonstrates the issue).

--

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



[issue11274] asyncore does not support epoll

2011-02-21 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

This is not easy to do. See:
http://bugs.python.org/issue6692
Closing out as duplicate.

--
nosy: +giampaolo.rodola
resolution:  - duplicate
status: open - closed

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



[issue11273] asyncore creates selec (or poll) on every iteration

2011-02-21 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
nosy: +giampaolo.rodola

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



[issue11257] asyncore stores unnecessary object references

2011-02-21 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

I'd be fine with this. My only concern are performances.
I've tried this:
http://code.google.com/p/pyftpdlib/issues/attachmentText?id=152aid=-7106494857544071944name=bench.pytoken=bd350bbd6909c7c2a70da55db15d24ed

Results:

plain dict: 722.26 Mb/sec
WeakValueDictionary: 659.76 Mb/sec

--

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



[issue11281] smtplib: add ability to bind to specific source IP address/port

2011-02-22 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

+1, this has been done for other modules such as ftplib as well and probably 
could be done for others such as httplib and poplib.

--
nosy: +giampaolo.rodola

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



[issue11281] smtplib: add ability to bind to specific source IP address/port

2011-02-22 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

 I would like to add source_ip and source_port parameters to 
 smtplib.SMTP, default to '' and 0 respectively.

It would be better to provide a unique source_address parameter defaulting to 
None, for consistency with socket.create_connection() expecting a (addr, port) 
tuple.

--

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



[issue11289] smtplib context manager

2011-02-22 Thread Giampaolo Rodola'

New submission from Giampaolo Rodola' g.rod...@gmail.com:

Patch in attachment provides a context manager for SMTP class so that it can be 
used with the with statement.

--
messages: 129096
nosy: giampaolo.rodola, pitrou
priority: normal
severity: normal
status: open
title: smtplib context manager
versions: Python 3.3

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



[issue11281] smtplib: add ability to bind to specific source IP address/port

2011-02-22 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

 Seems like the signature of Lib.test.mock_socket.create_connection does 
 not match socket.create_connection since 2.7.

You can add a fake parameter which does nothing.

 What is the notation for the new keyword arguments?

fun(a, b, c=None, d=None)

--

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



[issue11289] smtplib context manager

2011-02-22 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

Ouch! Here. =)

--
keywords: +patch
Added file: http://bugs.python.org/file20845/smtplib_context_manager.patch

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



[issue11289] smtplib context manager

2011-02-22 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

 is print really necessary in the test?

no, my mistake

--

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



[issue11281] smtplib: add ability to bind to specific source IP address/port

2011-02-22 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

Yes, you must update  Doc/library/smtplib.rst and write tests.
If you're not the one who's gonna commit the patch you can ignore 
Doc/whatsnew/3.3.srt and Misc/NEWS changes.

Updating the docstring is usually optional but I see smtplib module is already 
well documented so I'd update docstrings as well.

As for how to write a patch see:
http://www.python.org/dev/faq/#patches
...or search in the bug tracker for committed patches, such as:
http://bugs.python.org/issue8807
http://svn.python.org/view?view=revisionrevision=84144

--

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



[issue11287] Add context manager support to dbm modules

2011-02-22 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
nosy: +giampaolo.rodola

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



[issue11281] smtplib: add ability to bind to specific source IP address/port

2011-02-22 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

We already have 3 places where a tuple is used:

socket.socket.bind
socket.create_connection
http.client.HTTPConnection

Changing this notation in smtplib for such a rarely used feature is not worth 
the effort, imo.
Also, I would not add two new SMTP attributes. Passing a tuple to 
socket.create_connection() is just fine. If you want to know the source address 
afterwards you can use socket.getsockname().

PS - I modified smtplib.py in meantime. Please update your local copy.

--

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



[issue11291] poplib suppresses exception on QUIT

2011-02-22 Thread Giampaolo Rodola'

New submission from Giampaolo Rodola' g.rod...@gmail.com:

Unlike ftplib, smtplib and probably others, poplib suppresses error_proto 
exceptions on quit().
I'm not sure in what circumstances a POP3 server can return a negative response 
on QUIT but if this happens poplib should raise an exception.
Users who don't care about QUIT response can use the new close() method.
For backward compatibility patch should only be applied to Python 3.3 .

--
files: poplib_quit.patch
keywords: patch
messages: 129114
nosy: giampaolo.rodola, pitrou
priority: normal
severity: normal
status: open
title: poplib suppresses exception on QUIT
versions: Python 3.3
Added file: http://bugs.python.org/file20846/poplib_quit.patch

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



[issue11049] add tests for test.support

2011-02-22 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

Can we commit this patch?

--

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



[issue11281] smtplib: add ability to bind to specific source IP address/port

2011-02-22 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

Follow my comments:

 + source_address=('', 0)):

Make that default to None instead and pass it as-is to 
socket.create_connection().

 +self.source_address = source_address

There's no need to store the source address as an instance attribute. 
Just pass it as-is to socket.create_connection() in __init__ and connect 
methods and then get rid of it.


I think source_address no longer makes sense in UNIX sockets / LMTP class. 
Or at least, this is what I get if I try to bind() a UNIX socket:

 import socket
 sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
 sock.bind((, 0))
Traceback (most recent call last):
  File stdin, line 1, in module
  File string, line 1, in bind
TypeError: argument must be string or read-only character buffer, not tuple


--

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



[issue10882] Add os.sendfile()

2011-02-24 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

I'm going to commit the patch and then watch whether some of the buildbots turn 
red.

--

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



[issue10882] Add os.sendfile()

2011-02-25 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

Committed in r88580.

--

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



[issue11232] asyncore - don't throw a traceback when a client disconnects in echo server example

2011-02-25 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

Fixed.

--
resolution:  - fixed
status: open - closed

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



[issue11259] asynchat does not check if terminator is negative integer

2011-02-25 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

Can you provide a patch including a test case?

--

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



[issue11314] Subprocess suffers 40% process creation overhead penalty

2011-02-25 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
nosy: +giampaolo.rodola

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



[issue10882] Add os.sendfile()

2011-02-25 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

Thanks Georg.

It seems we have a failure on Leopard:
http://www.python.org/dev/buildbot/all/builders/PPC%20Leopard%203.x/builds/1411/steps/test/logs/stdio

Also, I think I can add support for AIX if someone gives me SSH access over an 
AIX box.
I'm maintaining a separate project to port sendfile() on python 2:
http://code.google.com/p/py-sendfile/

--

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



[issue11232] asyncore - don't throw a traceback when a client disconnects in echo server example

2011-02-25 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

Sorry: fixed in r88581.

--

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



[issue11323] os.sendfile() bo failure on solaris

2011-02-25 Thread Giampaolo Rodola'

New submission from Giampaolo Rodola' g.rod...@gmail.com:

http://www.python.org/dev/buildbot/all/builders/sparc%20solaris10%20gcc%203.x/builds/2658/steps/test/logs/stdio

Patch in attachment.

--
files: sendfile-test.patch
keywords: patch
messages: 129411
nosy: giampaolo.rodola, loewis
priority: normal
severity: normal
status: open
title: os.sendfile() bo failure on solaris
versions: Python 3.3
Added file: http://bugs.python.org/file20892/sendfile-test.patch

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



[issue11214] test_asyncore fails on AIX

2011-02-25 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

Fixed in r88604, r88605, r88606

--
resolution:  - fixed
status: open - closed
versions: +Python 2.7, Python 3.3

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



[issue9795] nntplib.NNTP should support the context protocol

2011-02-25 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

Patch in attachment.

--
keywords: +patch
versions: +Python 3.3 -Python 3.2
Added file: http://bugs.python.org/file20894/nntplib-context-manager.patch

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



[issue10784] os.getpriority() and os.setpriority()

2011-02-25 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

Committed in r88608 including Py_RETURN_NONE and Py_BEGIN/END_ALLOW_THREADS 
changes.

--
resolution:  - fixed
status: open - closed

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



[issue10784] os.getpriority() and os.setpriority()

2011-02-25 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

Misc/NEWS updated in r88609.

--

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



[issue11323] os.sendfile() bo failure on solaris

2011-02-25 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

Committed in r88616.

--

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



[issue11177] Set asyncore create_socket default argument

2011-02-25 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

Fixed in r88619.

--
nosy: +josiah.carlson
resolution:  - fixed
status: open - closed

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



[issue11291] poplib suppresses exception on QUIT

2011-02-25 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

Fixed in r88620.

--
components: +Library (Lib)
resolution:  - fixed
status: open - closed

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



[issue11281] smtplib: add ability to bind to specific source IP address/port

2011-02-25 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

You are right, I haven't thought about that.

--

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



[issue9795] nntplib.NNTP should support the context protocol

2011-02-26 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

(socket.error, EOFError) after quit() indicates that the socket is 
disconnected, in which case we should not raise any error (or at least, this is 
the approach we're using in ftplib) while all other NNTPError related errors 
are not suppressed.

--

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



[issue11323] os.sendfile() bo failure on solaris

2011-02-26 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
nosy: +rosslagerwall

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



[issue11325] compilation warning with sendfile

2011-02-26 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

Thanks.

--

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



[issue11257] asyncore stores unnecessary object references

2011-02-26 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

Unless there's a way to automatically call close() when a dispatcher instance 
is no longer referenced (and I can't think of anything to do that) I'd say we 
better close this as rejected.

--

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



[issue4761] create Python wrappers for openat() and others

2011-02-26 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

What about Doc/whatsnew/3.3.rst?

--

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



[issue11333] Add empty __slots__ to collections.abc abstract base classes

2011-02-26 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
nosy: +giampaolo.rodola

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



  1   2   3   4   5   6   7   8   9   10   >