[Python-Dev] Strange message error in socket.sendto() exception

2011-08-20 Thread Facundo Batista
Python 3.2 (r32:88445, Mar 25 2011, 19:28:28)
[GCC 4.5.2] on linux2
>>> import socket
>>> s = socket.socket()
>>> print(s.sendto.__doc__)
sendto(data[, flags], address) -> count
...
>>> s.sendto(b'data', ('localhost', 3))
Traceback (most recent call last):
  File "", line 1, in 
socket.error: [Errno 32] Broken pipe

This is ok, I expected this. However, note what happens if I send unicode:

>>> s.sendto('data', ('localhost', 3))
Traceback (most recent call last):
  File "", line 1, in 
TypeError: sendto() takes exactly 3 arguments (2 given)

An error regarding the argument quantity? what?

Furthermore, where this message comes from? I tried to find, but the
only hint I get is that it could come from
"./Modules/_ctypes/_ctypes.c"... are we using ctypes to access socket
methods? it's strange, because "sendto" is defined in socketmodule.c.

Ideas? Thanks!

-- 
.    Facundo

Blog: http://www.taniquetil.com.ar/plog/
PyAr: http://www.python.org/ar/
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Strange message error in socket.sendto() exception

2011-08-20 Thread Antoine Pitrou
On Sat, 20 Aug 2011 07:58:13 -0300
Facundo Batista  wrote:
> 
> This is ok, I expected this. However, note what happens if I send unicode:
> 
> >>> s.sendto('data', ('localhost', 3))
> Traceback (most recent call last):
>   File "", line 1, in 
> TypeError: sendto() takes exactly 3 arguments (2 given)
> 
> An error regarding the argument quantity? what?

Here I get (3.2.2, 3.3):

>>> s.sendto('data', ('localhost', 3))
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'str' does not support the buffer interface



___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Strange message error in socket.sendto() exception

2011-08-20 Thread Vinay Sajip
Facundo Batista  gmail.com> writes:


> An error regarding the argument quantity? what?
>
> Ideas? Thanks!
> 

I think this is the same as http://bugs.python.org/issue5421

tl;dr : fixed in recent versions.

Regards,

Vinay Sajip



___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] Buildbot failures

2011-08-20 Thread Paul Moore
My buildbot seems to have been failing for a while (I've been away on
holiday) - http://www.python.org/dev/buildbot/buildslaves/moore-windows

The failures seem to generally be in distutils and/or packaging. I see
quite a lot of reds in the waterfall display at the moment, and I
can't see any particular issue with my buildbot, so before I go
digging further, can anyone confirm (or otherwise) if
distutils/packaging is currently generating known failures (and hence,
the alerts can be ignored? (I'd only be looking for
environment-related problems, I'm afraid - I don't have any
distutils/packaging expertise to bring to bear on genuine code
issues...)

Thanks,
Paul.
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com