[issue4220] Builtins treated as free variables?

2008-10-31 Thread Terry J. Reedy
Changes by Terry J. Reedy <[EMAIL PROTECTED]>: -- versions: +Python 3.0 ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-bugs-list

[issue4220] Builtins treated as free variables?

2008-10-31 Thread Terry J. Reedy
Terry J. Reedy <[EMAIL PROTECTED]> added the comment: The request as stated is invalid. 'Int' and 'long' are built-in names, not keywords. The context of the cited sentence is "If a name is bound in a block, it is a local variable of that block, unless declared as nonlocal. If a name is bound at

[issue4233] open(0, closefd=False) prints 3 warnings

2008-10-31 Thread Christian Heimes
Christian Heimes <[EMAIL PROTECTED]> added the comment: Another patch based on Victor's patch. It adds some additional tests and exposes the internal attribute closefd. Added file: http://bugs.python.org/file11923/fileio_closefd3.patch ___ Python tracker <[EM

[issue4233] open(0, closefd=False) prints 3 warnings

2008-10-31 Thread STINNER Victor
Changes by STINNER Victor <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file11921/fileio_closefd.patch ___ Python tracker <[EMAIL PROTECTED]> ___ __

[issue4233] open(0, closefd=False) prints 3 warnings

2008-10-31 Thread STINNER Victor
STINNER Victor <[EMAIL PROTECTED]> added the comment: christian just told me that my svn repos was old. Here is an updated version of my patch. I now use io.open() instead of io.BufferedReader() in the tests. Added file: http://bugs.python.org/file11922/fileio_closefd-2.patch

[issue4233] open(0, closefd=False) prints 3 warnings

2008-10-31 Thread STINNER Victor
STINNER Victor <[EMAIL PROTECTED]> added the comment: @christian: Your patch doesn't work: if close() if called twice, the file is really closed :-/ Here is a new patch: - _FileIO.close() sets self->fd to -1 but don't show a warning anymore because the operation is valid: it does really close

[issue4242] Classify language vs. impl-detail tests, step 1

2008-10-31 Thread Nick Coghlan
Nick Coghlan <[EMAIL PROTECTED]> added the comment: My idea above won't really support Armin's idea of being able to exclude certain known-broken implementations. The check function would need to be handled differently to support that use case: # In test_support.py vm = platform.python_implement

[issue4243] has_key doc could be clearer

2008-10-31 Thread Martin v. Löwis
Martin v. Löwis <[EMAIL PROTECTED]> added the comment: Benjamin: Thanks for asking your teacher! It's curious that all the foreigners have no problems with the formulation, and all the native speakers do... There is clearly something to the English language that we haven't mastered yet.

[issue4211] frozen packages set an improper __path__ value

2008-10-31 Thread Brett Cannon
Brett Cannon <[EMAIL PROTECTED]> added the comment: I have an attached patch that fixes the reported problem. First, it adds a sanity check that no empty module name is checked for (crashes the interpreter otherwise). Second, the __path__ attribute is now a list. This does break backwards-compa

[issue4233] open(0, closefd=False) prints 3 warnings

2008-10-31 Thread Christian Heimes
Christian Heimes <[EMAIL PROTECTED]> added the comment: I don't see a good 'n easy way to fix the issue. close() is called in too many places and I don't wanna add more checks in Python code. This patch reduces the mass of warnings to one, but it also changes the semantic of close() a bit. Howe

[issue4176] segfault with pickle if 4th or 5th item of tuple returned by __reduce__ is not an iterator

2008-10-31 Thread Alexandre Vassalotti
Alexandre Vassalotti <[EMAIL PROTECTED]> added the comment: Amaury Forgeot d'Arc wrote: > Regarding the consistency between python and C, I don't think it is > necessary to be so strict. If the python version can allow a weaker > version of the "iterator" concept, let be it. I guess you're rig

[issue4225] unicode_literals doesn't work in exec

2008-10-31 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: This problem will still persist for anybody who uses PyParser_* APIs and then PyNode_Compile, but we can probably only document that. ___ Python tracker <[EMAIL PROTECTED]>

[issue4176] segfault with pickle if 4th or 5th item of tuple returned by __reduce__ is not an iterator

2008-10-31 Thread Alexandre Vassalotti
Alexandre Vassalotti <[EMAIL PROTECTED]> added the comment: Hirokazu Yamamoto wrote > Hmm, but python document says, > (http://docs.python.org/library/stdtypes.html#typeiter) > > >The iterator objects themselves are required to support the > >following two methods, which together form the iterato

[issue4243] has_key doc could be clearer

2008-10-31 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: After consulting with an English teacher who agreed that the phrasing was awkward, I fix it up in r67070. -- nosy: +benjamin.peterson resolution: -> fixed status: open -> closed ___ Python trac

[issue1544339] _ctypes fails to build on Solaris x86 32-bit (Sun compiler)

2008-10-31 Thread Ed Summers
Changes by Ed Summers <[EMAIL PROTECTED]>: -- nosy: +edsu ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-bugs-list mailing lis

[issue1673409] datetime module missing some important methods

2008-10-31 Thread STINNER Victor
STINNER Victor <[EMAIL PROTECTED]> added the comment: New patch based on catlee's patch: add toseconds() method to timedelta but use the float type to keep the microseconds. The error between the exact value and IEEE754 value is small: the error is smaller than one second even with 9 d

[issue4176] segfault with pickle if 4th or 5th item of tuple returned by __reduce__ is not an iterator

2008-10-31 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment: I corrected the test in the py3k branch. I don't know why I did not make it similar to the one in trunk; I guess I ran the test suite on the wrong directory... Sorry for the inconvenience. Regarding the consistency between python and

[issue4243] has_key doc could be clearer

2008-10-31 Thread Terry J. Reedy
Terry J. Reedy <[EMAIL PROTECTED]> added the comment: I believe "deprecated" at the end is the sort of dangling modifier deprecated by English style books I have read. I felt it to be sufficiently awkward and potentially confusing, at least for a moment, to be worth a few minutes to report and ch

[issue1673409] datetime module missing some important methods

2008-10-31 Thread STINNER Victor
STINNER Victor <[EMAIL PROTECTED]> added the comment: I wrote this function is my program: def timedelta2seconds(delta): """ Convert a datetime.timedelta() objet to a number of second (floatting point number). >>> timedelta2seconds(timedelta(seconds=2, microseconds=4)) 2

[issue4245] threading documentation: reorder sections

2008-10-31 Thread Michael Hoffman
New submission from Michael Hoffman <[EMAIL PROTECTED]>: It is somewhat confusing that the meat of the threading module, the Thread object itself, is so far down in the documentation. It should be the first section after the module functions and objects. http://docs.python.org/library/threading

[issue4204] Cannot build _multiprocessing, math, mmap and readline of Python 2.6 on FreeBSD 4.11 w/ gcc 2.95.4

2008-10-31 Thread Akira Kitada
Akira Kitada <[EMAIL PROTECTED]> added the comment: Christian, Thank you for the review. Let me know if there is anything I could help with this. ___ Python tracker <[EMAIL PROTECTED]> ___

[issue3022] mailbox module, two small fixes

2008-10-31 Thread STINNER Victor
STINNER Victor <[EMAIL PROTECTED]> added the comment: @gpolo: your patch is correct, but I prefer line.rstrip() to line.strip(). My new patch combines your two patches + replace strip by rstrip + use itervalues() instead of items() in MH.pack(). -- nosy: +haypo Added file: http://bugs.

[issue4216] subprocess.Popen hangs at communicate() when child exits

2008-10-31 Thread STINNER Victor
STINNER Victor <[EMAIL PROTECTED]> added the comment: The bug should be fixed in Python 2.5 since it uses: while read_set or write_set: try: rlist, wlist, xlist = select.select(read_set, write_set, []) except select.error, e: if e[0] == errno.EINTR:

[issue4216] subprocess.Popen hangs at communicate() when child exits

2008-10-31 Thread Amy
Amy <[EMAIL PROTECTED]> added the comment: Yes, I can only replicate this issue with command to start firewall. Stopping firewall or other service commands don't have the problem. Check Point firewall is a kernel application. Somehow select system call is interrupted and can't terminate the PIP

[issue4243] has_key doc could be clearer

2008-10-31 Thread D'Arcy J.M. Cain
D'Arcy J.M. Cain <[EMAIL PROTECTED]> added the comment: The original is not technically ambiguous modulo the dict/d issue. The suggested text just makes it more obvious. We just don't want to reduce the possibility of no confusion. :-) -- nosy: [EMAIL PROTECTED] _

[issue4243] has_key doc could be clearer

2008-10-31 Thread David W. Lambert
David W. Lambert <[EMAIL PROTECTED]> added the comment: The D'Arcy J.M. Cain wording is clearer. "dict.has_key(key) is deprecated. Use "key in dict" instead." would improve python. -- nosy: +LambertDW ___ Python tracker <[EMAIL PROTECTED]>

[issue4242] Classify language vs. impl-detail tests, step 1

2008-10-31 Thread Armin Rigo
Armin Rigo <[EMAIL PROTECTED]> added the comment: Brett: in my experience the granularity is usually fine, and not coarse. A class decorator doesn't look too useful. A function decorator is useful, but not enough. We also need a flag that can be checked in the middle of a larger test. (See th

[issue4244] ihooks incompatible with absolute_import feature

2008-10-31 Thread Jean-Paul Calderone
New submission from Jean-Paul Calderone <[EMAIL PROTECTED]>: The __import__ function ihooks installs has a signature which is incompatible with the real __import__ function, breaking some things when ihooks is in use: [EMAIL PROTECTED]:~$ python2.5 Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52

[issue4176] segfault with pickle if 4th or 5th item of tuple returned by __reduce__ is not an iterator

2008-10-31 Thread Hirokazu Yamamoto
Hirokazu Yamamoto <[EMAIL PROTECTED]> added the comment: Thank you for review. >Iterators only need to provide a __next__() method. So, you don't have >to check __iter__. Hmm, but python document says, (http://docs.python.org/library/stdtypes.html#typeiter) >The iterator objects themselves are

[issue4176] segfault with pickle if 4th or 5th item of tuple returned by __reduce__ is not an iterator

2008-10-31 Thread Alexandre Vassalotti
Alexandre Vassalotti <[EMAIL PROTECTED]> added the comment: Iterators only need to provide a __next__() method. So, you don't have to check __iter__. Other than that, the patch looks good. ___ Python tracker <[EMAIL PROTECTED]>

[issue1673409] datetime module missing some important methods

2008-10-31 Thread Marc-Andre Lemburg
Marc-Andre Lemburg <[EMAIL PROTECTED]> added the comment: You can have all this by using the time module's functions. It is true that these don't work for all dates, but they are still useful to have. FWIW: mxDateTime has always had methods to convert the date/time values to ticks and back agai

[issue1673409] datetime module missing some important methods

2008-10-31 Thread Skip Montanaro
Skip Montanaro <[EMAIL PROTECTED]> added the comment: Unassigning. Haven't heard from Tim in quite awhile and he's made no input on this issue. Also bump to 2.7. -- assignee: tim_one -> versions: +Python 2.7 -Python 2.6 ___ Python tracker <[EMAIL

[issue4236] Crash when importing builtin module during interpreter shutdown

2008-10-31 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment: Setting builtins._=None is not enough. My example is very simple, but the crash I had initially was during the deletion of sys.last_tb: the C() object may be stored anywhere. I agree that the test in PyModule_Create2 is too strong: the

[issue1673409] datetime module missing some important methods

2008-10-31 Thread Steve Roberts
Steve Roberts <[EMAIL PROTECTED]> added the comment: I would like to add a use case, generating random dates. Especially generating random dates/times according to different probability distributions and within ranges. It would be nicest if operations could be done directly with datetime, date, t

[issue4176] segfault with pickle if 4th or 5th item of tuple returned by __reduce__ is not an iterator

2008-10-31 Thread Hirokazu Yamamoto
Changes by Hirokazu Yamamoto <[EMAIL PROTECTED]>: Added file: http://bugs.python.org/file11917/fix_pickle_consistency_on_trunk.patch ___ Python tracker <[EMAIL PROTECTED]> ___ ___