[issue4362] FileIO object in io module

2008-11-20 Thread David M. Beazley
New submission from David M. Beazley <[EMAIL PROTECTED]>: The FileIO object defined in the new io library has "name" and "mode" properties. However, attempts to access either value result in an AttributeError exception. The C source code in _fileio.c doesn't e

[issue4017] Tkinter cannot find Tcl/Tk on Mac OS X

2008-11-20 Thread David M. Beazley
David M. Beazley <[EMAIL PROTECTED]> added the comment: Just a quick comment from the Python training universe--this bug makes it impossible to use Python 2.6 in any kind of Python teaching environment where IDLE tends to be used a lot. I'm having to tell students to stick with P

[issue4428] io.BufferedWriter does not observe buffer size limits

2008-11-25 Thread David M. Beazley
New submission from David M. Beazley <[EMAIL PROTECTED]>: The Buffered I/O interface in the io module has the user specify buffer limits such as size and max_buffer_size. The first limit (size) is easy to understand as a buffering threshold at which writes will occur. However, no ap

[issue4447] exec inside a function

2008-11-27 Thread David M. Beazley
New submission from David M. Beazley <[EMAIL PROTECTED]>: Is the following code valid Python 3 or not? def foo(): x = 1 exec("x = 42") print(x)# Prints 1 (exec has no effect) I know there are a variety of issues surrounding exec(), function bodies, and other

[issue4447] exec inside a function

2008-11-27 Thread David M. Beazley
David M. Beazley <[EMAIL PROTECTED]> added the comment: For what it's worth, I hope this behavior gets well-documented. Thanks. ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.

[issue4428] io.BufferedWriter does not observe buffer size limits

2008-11-29 Thread David M. Beazley
David M. Beazley <[EMAIL PROTECTED]> added the comment: I agree with previous comments that write() should definitely write all data when in blocking mode. ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.pytho

[issue4561] Optimize new io library

2008-12-06 Thread David M. Beazley
David M. Beazley <[EMAIL PROTECTED]> added the comment: I've done some profiling and the performance of reading line-by-line is considerably worse in Python 3 than in Python 2. For example, this code: for line in open("somefile.txt"): pass Ran 35 times slower in P

[issue4561] Optimize new io library

2008-12-06 Thread David M. Beazley
David M. Beazley <[EMAIL PROTECTED]> added the comment: Tried this using projects/python/branches/release30-maint and using the patch that was just attached. With a 66MB input file, here are the results of this code fragment: for line in open("BIGFILE): pass Python 2.6: 0

[issue4561] Optimize new io library

2008-12-06 Thread David M. Beazley
David M. Beazley <[EMAIL PROTECTED]> added the comment: Just as one other followup, if you change the code in the last example to use binary mode like this: for line in open("BIG","rb"): pass You get the following results: Python 2.6: 0.64s Python 3.0:

[issue4561] Optimize new io library

2008-12-06 Thread David M. Beazley
David M. Beazley <[EMAIL PROTECTED]> added the comment: Just checked it with branches/py3k and the performance is the same. ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.pytho

[issue4561] Optimize new io library

2008-12-06 Thread David M. Beazley
David M. Beazley <[EMAIL PROTECTED]> added the comment: bash-3.2$ uname -a Darwin david-beazleys-macbook.local 9.5.1 Darwin Kernel Version 9.5.1: Fri Sep 19 16:19:24 PDT 2008; root:xnu-1228.8.30~1/RELEASE_I386 i386 bash-3.2$ ./python.exe -c "import sys; print(sys.version)" 3

[issue4593] Documentation for multiprocessing - Pool.apply()

2008-12-08 Thread David M. Beazley
New submission from David M. Beazley <[EMAIL PROTECTED]>: The documentation for the apply() and apply_async() methods of a Pool object might emphasize that these operations execute func(*args,**kwargs) in only one of the pool workers and that func() is not being executed in parallel

[issue4593] Documentation for multiprocessing - Pool.apply()

2008-12-08 Thread David M. Beazley
David M. Beazley <[EMAIL PROTECTED]> added the comment: Actually, you shouldn't discount the potential usefulness of running apply() in all of the worker nodes. A lot of people coming from parallel programming know about things like global broadcasts, reductions, and so forth.

[issue4561] Optimize new io library

2008-12-16 Thread David M. Beazley
David M. Beazley added the comment: I wish I shared your optimism about this, but I don't. Here's a short explanation why. The problem of I/O and the associated interface between hardware, the operating system kernel, and user applications is one of the most fundamental and

[issue4561] Optimize new io library

2008-12-16 Thread David M. Beazley
David M. Beazley added the comment: Good luck with that. Most people who get bright ideas such as "gee, maybe I'll write my own version of X" where "X" is some part of the standard C library pertaining to I/O, end up fighting a losing battle. Of course, I'd

[issue4561] Optimize new io library

2008-12-16 Thread David M. Beazley
David M. Beazley added the comment: I agree with Raymond. For binary reads, I'll go farther and say that even a 10% slowdown in performance would be surprising if not unacceptable to some people. I know that as hard as it might be for everyone to believe, there are a lot of peopl

[issue4686] Exceptions in ConfigParser don't set .args

2008-12-17 Thread David M. Beazley
New submission from David M. Beazley : The ConfigParser module defines a variety of custom exceptions, many of which take more than one argument (e.g., InterpolationError, NoOptionError, etc.). However, none of these exceptions properly set the .args attribute. For example, shouldn&#

[issue4694] _call_method() in multiprocessing documentation

2008-12-18 Thread David M. Beazley
New submission from David M. Beazley : The documentation for "Proxy Objects" in the multiprocessing module describes a method "_call_method" and gives various examples. The only problem is that the method is actually called "_callmethod" (i.e., no undersc

[issue4694] _call_method() in multiprocessing documentation

2008-12-18 Thread David M. Beazley
David M. Beazley added the comment: The _get_value() method is also in error. It's called "_getvalue()" in the source code. ___ Python tracker <http://bugs.py

[issue4695] Bad AF_PIPE address in multiprocessing documentation

2008-12-18 Thread David M. Beazley
New submission from David M. Beazley : In the "Address Formats" part of the "Listeners and Clients" section of the documentation for the multiprocessing module, AF_PIPE addresses are described as having this format: r'ServerName\\pipe\\PipeName'

[issue1194378] sendmsg() and recvmsg() for C socket module

2008-12-24 Thread David M. Beazley
David M. Beazley added the comment: Bump. This functionality seems to be needed if anyone is going to be messing around with advanced features of IPv6. As it stands, the socket module in Python 2.6/3.0 is incomplete without this. -- nosy: +beazley

[issue4744] asynchat documentation needs to be more precise

2008-12-24 Thread David M. Beazley
New submission from David M. Beazley : The documentation for asynchat needs to be more precise in its use of strings vs. bytes. Unless the undocumented use_encoding attribute is set, it seems that all data should be bytes throughout (e.g., the terminator, inputs to push methods, etc.). I

[issue1194378] sendmsg() and recvmsg() for C socket module

2008-12-27 Thread David M. Beazley
David M. Beazley added the comment: Just a followup comment to note that adding support for sendmsg()/recvmsg() is what you need to do "file descriptor passing" between processes on Unix---another technique for writing network servers. ___ Pyth

[issue4758] Python 3.0 internet documentation needs work

2008-12-27 Thread David M. Beazley
New submission from David M. Beazley : I have recently completed a pretty thorough survey of library documentation for Python 3.0 in conjunction with an update I'm making to my book. This issue is not so much a bug as a documentation request. For all of the library modules relat

[issue4766] email documentation needs to be precise about strings/bytes

2008-12-29 Thread David M. Beazley
New submission from David M. Beazley : Documentation for the email package needs to be more clear about the usage of strings and bytes. In particular: 1. All operations that parse email messages such as message_from_file() or message_from_string() operate on *text*, not binary data. So

[issue4767] email.mime incorrectly documented (or implemented)

2008-12-29 Thread David M. Beazley
New submission from David M. Beazley : The documentation describes classes such as email.mime.MIMEText() email.mime.MIMEMultipart() email.mime.MIMEApplication() etc... However, it's confusing because none of these classes are actually found in email.mime. Suggest either using the full p

[issue4768] email.generator.Generator object bytes/str crash - b64encode() bug?

2008-12-29 Thread David M. Beazley
New submission from David M. Beazley : The email.generator.Generator class does not work correctly message objects created with binary data (MIMEImage, MIMEAudio, MIMEApplication, etc.). For example: >>> from email.mime.image import MIMEImage >>> data = open("IMG.

[issue4769] b64decode should accept strings or bytes

2008-12-29 Thread David M. Beazley
New submission from David M. Beazley : The whole point of base64 encoding is to safely encode binary data into text characters. Thus, the base64.b64decode() function should equally accept text strings or binary strings as input. For example, there is a reasonable expectation that something

[issue4769] b64decode should accept strings or bytes

2008-12-29 Thread David M. Beazley
David M. Beazley added the comment: Note: This problem applies to all of the other decoders/encoders in the base64 too (b16, b32, etc.) ___ Python tracker <http://bugs.python.org/issue4

[issue4770] binascii module, crazy error messages, unexpected behavior

2008-12-29 Thread David M. Beazley
New submission from David M. Beazley : See Issue 4869 for a related bug. Most of the functions in binascii are meant to go from binary data to textual representations (hex digits, base64, binhex, etc.). There are numerous problems: 1. Misleading error messages. For example

[issue4770] binascii module, crazy error messages, unexpected behavior

2008-12-29 Thread David M. Beazley
David M. Beazley added the comment: Given the low-level nature of this module, I can understand the motivation to make it all bytes. However, I'm going to respectfully disagree with that and claim that making binascii all bytes really goes against the whole spirit of what Python 3.

[issue4771] Bad examples in hashlib documentation

2008-12-29 Thread David M. Beazley
New submission from David M. Beazley : The hashlib documentation has incorrect examples showing the use of the hexdigest() method: >>> hashlib.sha224(b"Nobody inspects the spammish repetition").hexdigest() b'a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2&#

[issue4771] Bad examples in hashlib documentation

2008-12-29 Thread David M. Beazley
David M. Beazley added the comment: The digest() method of hashes does produce bytes (correct). The hexdigest() method produces a string, but it is also shown as producing bytes in the examples. ___ Python tracker <http://bugs.python.org/issue4

[issue4773] HTTPMessage not documented and has inconsistent API across 2.6/3.0

2008-12-29 Thread David M. Beazley
New submission from David M. Beazley : A file-like object u returned by the urlopen() function in both Python 2.6/3.0 has a method info() that returns a 'HTTPMessage' object. For example: ::: Python 2.6 >>> from urllib2 import urlopen >>> u = urlopen("ht

[issue4773] HTTPMessage not documented and has inconsistent API across 2.6/3.0

2008-12-29 Thread David M. Beazley
David M. Beazley added the comment: Verified that 2to3 does not fix this. ___ Python tracker <http://bugs.python.org/issue4773> ___ ___ Python-bugs-list mailing list Unsub

[issue4782] json documentation missing load(), loads()

2008-12-30 Thread David M. Beazley
New submission from David M. Beazley : Documentation for the json module in Python 2.6 and Python 3.0 doesn't have any description for load() or loads() even though both functions are used in the examples. -- assignee: georg.brandl components: Documentation messages: 78542

[issue4783] json documentation needs a BAWM (Big A** Warning Message)

2008-12-30 Thread David M. Beazley
New submission from David M. Beazley : The json module is described as having an interface similar to pickle: json.dump() json.dumps() json.load() json.loads() I think it would be a WISE idea to add a huge warning message to the documentation that these functions should *NOT

[issue4785] json.JSONDecoder() strict argument undocumented and potentially confusing

2008-12-30 Thread David M. Beazley
New submission from David M. Beazley : The strict parameter to JSONDecoder() is undocumented and is confusing because someone might assume it has something to do with the encoding parameter or the general handling of parsing errors (which it doesn't). As far as I can determine by readin

[issue4769] b64decode should accept strings or bytes

2008-12-30 Thread David M. Beazley
David M. Beazley added the comment: One more followup. The quopri module (which is highly related to base64 in that quopri and base64 are often used together within MIME) does accept both unicode and byte strings when decoding. For example, this works: >>> quopri.decodestri

[issue4783] json documentation needs a BAWM (Big A** Warning Message)

2008-12-30 Thread David M. Beazley
David M. Beazley added the comment: Just consider me to be an impartial outside reviewer. Hypothetically, let's say I'm a Python programmer who knows a thing or two about standard library modules (like pickle), but I'm new to JSON so I come looking at the json module docum

[issue4783] json documentation needs a BAWM (Big A** Warning Message)

2008-12-30 Thread David M. Beazley
David M. Beazley added the comment: Thanks! Hopefully I'm not giving you too much work to do :-). Cheers, Dave ___ Python tracker <http://bugs.python.org/i

[issue4786] xml.etree.ElementTree module name in Python 3

2008-12-30 Thread David M. Beazley
New submission from David M. Beazley : Not a bug, but a question to developers: Is xml.etree.ElementTree going to be the only standard library module in Python 3.0 that doesn't follow the standard Python 3.0 module naming conventions? (e.g., socketserver, configparser, etc.). Are ther

[issue4820] ctypes.util.find_library incorrectly documented

2009-01-03 Thread David M. Beazley
New submission from David M. Beazley : In the "ctypes reference / Finding shared libraries" section of the ctypes documentation, the find_library() function is described as being located in ctypes.util. However, it's formal description right below that lists it as ctyp

[issue4831] exec() behavior - revisited

2009-01-04 Thread David M. Beazley
David M. Beazley added the comment: One further followup just to make sure I'm clear. Is it always safe to pass the result of locals() into exec and extract the result as shown in my example? Since I'm writing about this in a book, I just want to make absolutely certain I k

[issue4831] exec() behavior - revisited

2009-01-04 Thread David M. Beazley
New submission from David M. Beazley : Please forgive me, but I'm really trying to wrap my brain around the behavior of exec() in Python 3. Here's a quote from the documentation: "In all cases, if the optional parts are omitted, the code is executed in the current s

[issue4903] binascii.crc32()

2009-01-09 Thread David M. Beazley
New submission from David M. Beazley : The result of binascii.crc32() is different on the same input in Python 2.6/3.0. For example: Python 2.6: >>> binascii.crc32('Hello') -137262718 Python 3.0: >>> binascii.crc32(b'Hello') 4157704578 -- com

[issue4903] binascii.crc32()

2009-01-09 Thread David M. Beazley
David M. Beazley added the comment: Can someone PLEASE make sure this gets documented someplace. ___ Python tracker <http://bugs.python.org/issue4903> ___ ___ Python-bug

[issue4903] binascii.crc32()

2009-01-10 Thread David M. Beazley
David M. Beazley added the comment: Placing a note in the standard library documentation would be a start. Just say in Python 3.0 it always returns the result as an unsigned integer whereas in Python 2.6 a 32-bit signed integer is returned. Although the numerical value may differ between

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

2009-11-14 Thread David M. Beazley
New submission from David M. Beazley : Consider a socket that has had a file-like wrapper placed around it using makefile() # s is a socket created previously f = s.makefile() Now, suppose that this socket has had a timeout placed on it. s.settimeout(15) If you try to read data from f, but

[issue4758] Python 3.x internet documentation needs work

2009-12-28 Thread David M. Beazley
David M. Beazley added the comment: An apology on the delay. Things have been rather hectic. Regarding a patch, I don't really have a patch so much as a suggested procedure. Basically, I'm suggesting that the maintainers of the library documentation simply do a quick survey