Skip to content

Instantly share code, notes, and snippets.

@leepa
Created March 4, 2014 03:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leepa/9339593 to your computer and use it in GitHub Desktop.
Save leepa/9339593 to your computer and use it in GitHub Desktop.
[leepa@joolzbsd ~]$ pkg info python27
python27-2.7.6_4
Name : python27
Version : 2.7.6_4
Installed on : Mon Mar 3 20:39:53 UTC 2014
Origin : lang/python27
Architecture : freebsd:10:x86:64
Prefix : /usr/local
Categories : python lang ipv6
Licenses : PSFL
Maintainer : python@FreeBSD.org
WWW : http://www.python.org/
Comment : Interpreted object-oriented programming language
Options :
EXAMPLES : on
FPECTL : off
IPV6 : on
NLS : on
PTH : off
PYMALLOC : on
SEM : off
THREADS : on
UCS2 : off
UCS4 : on
Shared Libs required:
libpython2.7.so
libintl.so.9
Flat size : 68.6MiB
Description :
Python is an interpreted object-oriented programming language, and is
often compared to Tcl, Perl or Scheme.
WWW: http://www.python.org/
[leepa@joolzbsd ~]$ pkg info python33
python33-3.3.3_3
Name : python33
Version : 3.3.3_3
Installed on : Mon Mar 3 19:59:34 UTC 2014
Origin : lang/python33
Architecture : freebsd:10:x86:64
Prefix : /usr/local
Categories : python lang ipv6
Licenses : PSFL
Maintainer : python@FreeBSD.org
WWW : http://www.python.org/
Comment : Interpreted object-oriented programming language
Options :
EXAMPLES : on
FPECTL : off
IPV6 : on
NLS : on
PYMALLOC : on
THREADS : on
Shared Libs required:
libpython3.3m.so
libintl.so.9
Flat size : 88.9MiB
Description :
Python is an interpreted object-oriented programming language, and is
often compared to Tcl, Perl or Scheme.
WWW: http://www.python.org/
[leepa@joolzbsd ~]$ cat testpy_zerolength.py
import socket
r, w = socket.socketpair()
w.send(b'X' * 1024)
r.recvfrom_into(bytearray(), 1024)
[leepa@joolzbsd ~]$ cat testpy_onelength.py
import socket
r, w = socket.socketpair()
w.send(b'X' * 1024)
r.recvfrom_into(bytearray(1), 1024)
[leepa@joolzbsd ~]$ python2.7 testpy_zerolength.py
Traceback (most recent call last):
File "testpy_zerolength.py", line 4, in <module>
r.recvfrom_into(bytearray(), 1024)
ValueError: nbytes is greater than the length of the buffer
[leepa@joolzbsd ~]$ python3.3 testpy_zerolength.py
Assertion failed: (buf != 0 && buflen > 0), function sock_recvfrom_into, file /wrkdirs/usr/ports/lang/python33/work/Python-3.3.3/Modules/socketmodule.c, line 2927.
Abort trap (core dumped)
[leepa@joolzbsd ~]$ python2.7 testpy_onelength.py
Traceback (most recent call last):
File "testpy_onelength.py", line 4, in <module>
r.recvfrom_into(bytearray(1), 1024)
ValueError: nbytes is greater than the length of the buffer
[leepa@joolzbsd ~]$ python3.3 testpy_onelength.py
Traceback (most recent call last):
File "testpy_onelength.py", line 4, in <module>
r.recvfrom_into(bytearray(1), 1024)
ValueError: nbytes is greater than the length of the buffer
[leepa@joolzbsd ~]$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment