[issue9079] Make gettimeofday available in time module

2010-07-16 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : Added file: http://bugs.python.org/file18030/issue9079-fail.diff ___ Python tracker <http://bugs.python.org/issue9079> ___ ___ Python-bug

[issue9079] Make gettimeofday available in time module

2010-07-16 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Antoine, you must be building on Windows. I'll try to guess where ftime is defined and repost the patch. -- ___ Python tracker <http://bugs.python.org/i

[issue9079] Make gettimeofday available in time module

2010-07-16 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I fixed the ftime issue (I hope), but the build still fails. I did not test on Linux, but I tested on OSX with HAVE_FTIME. Replacing the failing patch. -- Added file: http://bugs.python.org/file18031/issue9079-fail.diff

[issue9079] Make gettimeofday available in time module

2010-07-16 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : Removed file: http://bugs.python.org/file18030/issue9079-fail.diff ___ Python tracker <http://bugs.python.org/issue9079> ___ ___ Pytho

[issue9079] Make gettimeofday available in time module

2010-07-16 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Removing spurious configure change from the "fail" patch. -- Added file: http://bugs.python.org/file18032/issue9079-fail.diff ___ Python tracker <http://bugs.python.

[issue9079] Make gettimeofday available in time module

2010-07-16 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : Removed file: http://bugs.python.org/file18031/issue9079-fail.diff ___ Python tracker <http://bugs.python.org/issue9079> ___ ___ Pytho

[issue9079] Make gettimeofday available in time module

2010-07-16 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: It looks like my reluctance to add gettimeofday to core without using it there was well founded. Simply adding a dummy call to _PyTime_gettimeofday in main() fixed the build problem. This is a hack, of course, so I am still looking for suggestions on

[issue9079] Make gettimeofday available in time module

2010-07-16 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Reid, I am leaning towards reverting to Plan A (issue9079.diff). Would your use case be served well by a _time module exposing C API via a capsule? This what datetime does currently. -- ___ Python tracker

[issue1617161] Instance methods compare equal when their self's are equal

2010-07-16 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I believe "Confirmed in trunk and py3k." means that the issue was verified to exist in trunk and py3k branches at the time of the message. -- ___ Python tracker <http://bugs.python.org

[issue1677872] Efficient reverse line iterator

2010-07-16 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > The OP has done everything asked of him. Not quite. He split out the documentation part of his patch and it was accepted and committed. Guido raised an issue with the code. OP raised more questions. The code was never updated. Now the patch

[issue9079] Make gettimeofday available in time module

2010-07-16 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: It turns out I misunderstood how date.today() worked [1] and issue9079.diff introduced significant change in behavior. Bringing timeofday into core rather than _time.c also introduced several complications. As a result it makes sense to start with

[issue5180] 3.1 cannot unpickle 2.7-created pickle

2010-07-16 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Antoine said on IRC that he is ok with the latest approach. Does anyone want to review the patch before it goes in? -- resolution: -> accepted stage: patch review -> commit review ___ Python tracker

[issue728815] test_timeout updates

2010-07-16 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- superseder: -> test_timeout refactoring ___ Python tracker <http://bugs.python.org/issue728815> ___ ___ Python-bugs-lis

[issue5180] 3.1 cannot unpickle 2.7-created pickle

2010-07-17 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Alexandre, I am not sure your change form PyObject_Size(args) to Py_SIZE(args) is correct. As far as I can tell, args come from pickle machine stack without any type checks. The equivalent code in 2.x cPickle uses PyObject_Size and checks for errors

[issue9268] Add annotation option to pickletools.dis

2010-07-17 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Committed in r82931 with small changes based on comments here and on IRC: 1. Annotations are separated from disassembly by spaces without '|'. 2. Made a small improvement to the annotation alignment algorithm. Excessively long lines do not

[issue9268] Add annotation option to pickletools.dis

2010-07-17 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- resolution: -> fixed stage: unit test needed -> committed/rejected status: open -> closed ___ Python tracker <http://bugs.python.o

[issue9012] Separate compilation of time and datetime modules

2010-07-17 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I am merging in the nosy list from issue9079 after we had a lengthy discussion there and on IRC about the best way to share code between stdlib extension modules. For the issue9079, we decided to bring the shared code into python core, but this cannot

[issue9012] Separate compilation of time and datetime modules

2010-07-17 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- stage: committed/rejected -> needs patch ___ Python tracker <http://bugs.python.org/issue9012> ___ ___ Python-bugs-list mai

[issue5673] Add timeout option to subprocess.Popen

2010-07-17 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- nosy: +belopolsky ___ Python tracker <http://bugs.python.org/issue5673> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue9079] Make gettimeofday available in time module

2010-07-17 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Indeed. Replacing issue9079a.diff now. -- Added file: http://bugs.python.org/file18045/issue9079a.diff ___ Python tracker <http://bugs.python.org/issue9

[issue9079] Make gettimeofday available in time module

2010-07-17 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : Removed file: http://bugs.python.org/file18034/issue9079a.diff ___ Python tracker <http://bugs.python.org/issue9079> ___ ___ Python-bug

[issue1699259] replacing char* with const char* in sysmodule.c/.h

2010-07-17 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: 2.7 is not gone. It has entered an extended maintenance period. During this period, 2.7.x releases will incorporate bug fixes but will not get any new features. This particular issue is arguably a bug. I think Christian should make a call on

[issue1706039] Added clearerr() to clear EOF state

2010-07-17 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- assignee: -> belopolsky resolution: -> accepted stage: patch review -> commit review ___ Python tracker <http://bugs.python.org/

[issue5180] 3.1 cannot unpickle 2.7-created pickle

2010-07-17 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Committed issue5180b.diff with minor additions in r82937 (r82938 for 3.1): 1. Added an assert that args is a tuple in instantiate() with an explanation why it is true. 2. Added a test for the other code branch instantiate. (Not all conditions are

[issue9269] Cannot pickle self-referencing sets

2010-07-17 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Upon further investigation, I am no longer convinced that "reduce cycles" are necessarily fatal to pickling. I am attaching a script testcycle.py that allows creating cycles using various containers. It takes the name of container class as a

[issue4938] Pdb cannot access doctest source in postmortem

2010-07-18 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- assignee: -> belopolsky stage: -> needs patch type: -> behavior versions: +Python 3.2 ___ Python tracker <http://bugs.python.o

[issue4335] inspect.getsourcelines ignores last line in module

2010-07-18 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Martin, Was there a reason for not accepting this patch for the trunk? -- assignee: -> belopolsky keywords: +easy ___ Python tracker <http://bugs.python.org/iss

[issue4111] Add Systemtap/DTrace probes

2010-07-18 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: If any RedHat/Fedora people are tuned in, can you give us an update on Systemtap/DTrace support in RedHat/Fedora python? I understand that one of the main problems with bringing this upstream was the lack of uniformity between Apple and Sun approaches

[issue7962] Demo and Tools need to be tested and pruned

2010-07-18 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- dependencies: +Single-line option to pygettext.py ___ Python tracker <http://bugs.python.org/issue7962> ___ ___ Python-bug

[issue1098749] Single-line option to pygettext.py

2010-07-18 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: A rare example of a 5-year old patch that still applies with only a minor tweak. This is probably a sign that pygettext itself has not been kept up to date. In any case, I am attaching an updated patch which I did not test beyond running

[issue1098749] Single-line option to pygettext.py

2010-07-18 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : Added file: http://bugs.python.org/file18055/issue1098749.diff ___ Python tracker <http://bugs.python.org/issue1098749> ___ ___ Pytho

[issue1812] doctest _load_testfile function -- newline handling seems incorrect

2010-07-18 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Mark L, This could use some shaking. Please take a look. -- nosy: +BreamoreBoy, belopolsky ___ Python tracker <http://bugs.python.org/issue1

[issue1764286] inspect.getsource does not work with decorated functions

2010-07-18 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I did not test the patch, but if it really addresses the issue, I don't see why such a simple fix would not be applied. Guilherme, Can you add unit tests? Also, the second chunk in your patch is just a style fix which is a distraction for revi

[issue7229] Manual entry for time.daylight can be misleading

2010-07-18 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Georg, Do you mind if I take this over? While I have issues with east/west of UTC terminology, it is the accepted terminology throughout the manual and Brian's rewording is an improvement. -- ___ P

[issue665761] reduce() masks exception

2010-07-18 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- assignee: -> belopolsky nosy: +belopolsky -Alexander.Belopolsky versions: +Python 3.2 ___ Python tracker <http://bugs.python.org/issue

[issue7829] dis module documentation gives no indication of the dangers of bytecode inspection

2010-07-18 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- keywords: -needs review ___ Python tracker <http://bugs.python.org/issue7829> ___ ___ Python-bugs-list mailing list Unsub

[issue9105] pickle security note should be more prominent

2010-07-18 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: LGTM Unless someone objects, I will check that the patch generates reasonable HTML and apply. -- assignee: d...@python -> belopolsky resolution: -> accepted stage: needs patch -> commit review _

[issue9105] pickle security note should be more prominent

2010-07-19 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: The patch does not apply to py3k. Also, when you generate patches please do so from the root directory of the branch. For example, tutorial/inputoutput.rst should be patched as Doc/tutorial/inputoutput.rst. Thanks

[issue9305] Don't use east/west of UTC in date/time documentation

2010-07-19 Thread Alexander Belopolsky
New submission from Alexander Belopolsky : I am opening this to supersede issue7229. See discussion following msg107148. In many places offsets representing the difference between local time and UTC are described as minutes or seconds east or west of UTC. This is not correct because UTC is

[issue9305] Don't use east/west of UTC in date/time documentation

2010-07-19 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- dependencies: +Manual entry for time.daylight can be misleading ___ Python tracker <http://bugs.python.org/issue9305> ___ ___

[issue7229] Manual entry for time.daylight can be misleading

2010-07-19 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: After reading the new wording on a formatted page, I don't like the proposed changes: """ time.altzone When daylight is nonzero, altzone specifies the offset of the local DST timezone, in seconds west of UTC. This is negative if th

[issue9307] Py_TPFLAGS_LONG_SUBCLASS is not documented

2010-07-19 Thread Alexander Belopolsky
New submission from Alexander Belopolsky : Is there a reason for not documenting Py_TPFLAGS_LONG_SUBCLASS (Py_TPFLAGS_INT_SUBCLASS in 2.x)? This flag is used in PyLong_Check, but neither this flag or its inheritance properties are explained anywhere in the docs. See also issue5476

[issue5476] datetime: timedelta(minutes = i) silently fails with numpy.int32 input

2010-07-19 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: As I suspected, datetime not recognizing numpy.int_ as a valid input is a numpy issue. Unlike regular int subclasses, numpy.int_ does not have Py_TPFLAGS_INT_SUBCLASS flag set: >>> numpy.int_.__flags__ & (1<<23) 0 >&

[issue9307] Py_TPFLAGS_LONG_SUBCLASS is not documented

2010-07-19 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Here are other similar flags that are not documented: /* These flags are used to determine if a type is a subclass. */ #define Py_TPFLAGS_INT_SUBCLASS (1L<<23) #define Py_TPFLAGS_LONG_SUBCLASS(1L<<24) #define Py_TPFLAGS_L

[issue1777412] Python's strftime dislikes years before 1900

2010-07-19 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Adding issue7989 as a dependency because one of the stated reasons for not calling system strftime from datetime directly is because pure python implementations cannot do the same. This of course can be resolved by exposing raw strftime in separate

[issue1777412] Python's strftime dislikes years before 1900

2010-07-19 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- dependencies: +Add pure Python implementation of datetime module to CPython superseder: Add pure Python implementation of datetime module to CPython -> ___ Python tracker <http://bugs.python.org/issue1

[issue9307] Py_TPFLAGS_LONG_SUBCLASS is not documented

2010-07-19 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Mon, Jul 19, 2010 at 2:17 PM, Antoine Pitrou wrote: > .. These flags are primarily useful for C extension developers, there's > little point checking them from Python code. Of course there is: it helps debugging problems in types imple

[issue9308] Remove redundant coding cookies from 3.x stdlib

2010-07-19 Thread Alexander Belopolsky
New submission from Alexander Belopolsky : On Mon, Jul 19, 2010 at 2:45 AM, Guido van Rossum wrote: > Sounds like a good idea to try to remove redundant cookies *and* to > remove most occasional use of non-ASCII characters outside comments > (except for unittests specifically tryin

[issue9308] Remove redundant coding cookies from 3.x stdlib

2010-07-19 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: In the attached patch, I've removed encoding cookies in all files listed in the message above except >> Lib/test/bad_coding.py:# -*- coding: uft-8 -*- >> Lib/test/badsyntax_3131.py:# -*- coding: utf-8 -*- >> Lib/shlex.py:#

[issue9308] Remove redundant coding cookies from 3.x stdlib

2010-07-19 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: It turns out that test_imp tests that pydoc.py is in iso-8859-1. This is not right. The test should use a dedicated file under Lib/test for that. -- ___ Python tracker <http://bugs.python.org/issue9

[issue9309] Add environment variable complementing command line option -no-user-cfg

2010-07-19 Thread Alexander Dreyer
New submission from Alexander Dreyer : At the Sage Days 24 coding sprint the issue came up, that the setup.py install programs of several python-based tools pick the prefix-setting from ~/.pydistutils.cfg. http://trac.sagemath.org/sage_trac/ticket/9536 In order to get this right, we suggest

[issue9308] Remove redundant coding cookies from 3.x stdlib

2010-07-19 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Mon, Jul 19, 2010 at 4:33 PM, Éric Araujo wrote: .. > The shlex fix was reverted IIRC because Mark was unsure of the fix, since our > diff tools > try to be too clever and decode files, not showing us the bytes differences. Well, it is

[issue9308] Remove redundant coding cookies from 3.x stdlib

2010-07-19 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Tracker eating python prompt prefixed lines is truly annoying. Here are the missing lines: >>> len(shlex(posix=True).wordchars) - len(shlex().wordchars) 62 >>> len([chr(i) for i in range(128, 256) if chr

[issue9308] Remove redundant coding cookies from 3.x stdlib

2010-07-19 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > > Changes by Éric Araujo : > -- > nosy: +esr I don't think posix mode was added by ESR, but I cannot check ATM. -- nosy: +Alexander.Belopolsky ___ Python tracker <http://bugs.

[issue9308] Remove redundant coding cookies from 3.x stdlib

2010-07-19 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I wonder whether 3.x shlex working with unicode files is just incidental to 3.x string model and is not really correct. I think issue1170 is a better place to have this discussion. I'll add a comment there. -- nosy: -Alexander.Belop

[issue1170] shlex have problems with parsing unicode

2010-07-19 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: As discussed in msg110828 under issue9308, it is not clear whether logic identifying word characters in shlex is correct in presence of unicode. -- assignee: -> belopolsky keywords: +patch nosy: +belopol

[issue1170] shlex have problems with parsing unicode

2010-07-19 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : ___ Python tracker <http://bugs.python.org/issue1170> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/o

[issue1170] shlex have problems with parsing unicode

2010-07-19 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I believe the e-mail thread that culminated in r32284, "Implemented posix-mode parsing support in shlex.py", was "shellwords" from April 2003: http://mail.python.org/pipermail/python-dev/2003-April/034670.html I scanned through the

[issue9308] Remove redundant coding cookies from 3.x stdlib

2010-07-19 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I am attaching a new patch, issue9308a.diff which fixes test_imp by introducing a new package, test.encoded_modules which currently contains a module encoded with iso-8859-1 and another with a somewhat more interesting encoding, koi8-r. I think it

[issue9308] Remove redundant coding cookies from 3.x stdlib

2010-07-19 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- keywords: +needs review stage: commit review -> patch review ___ Python tracker <http://bugs.python.org/issue9308> ___ _

[issue5476] datetime: timedelta(minutes = i) silently fails with numpy.int32 input

2010-07-19 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > Does Numpy correctly call PyType_Ready()? As far as I can tell, it does: #define DUAL_INHERIT(child, parent1, parent2) \ Py##child##ArrType_Type.tp_base = &Py##parent2##ArrType_Type; \ Py

[issue1062277] Pickle breakage with reduction of recursive structures

2010-07-19 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: As I explained in msg110617 under issue9269, it is possible that we can do better than simply detect reduce cycles and bail out. I am torn between two options: 1. Reject this patch and wait until a proper solution is found. 2. Admit that better is the

[issue9309] Add environment variable complementing command line option -no-user-cfg

2010-07-20 Thread Alexander Dreyer
Changes by Alexander Dreyer : Added file: http://bugs.python.org/file18085/dist.py.patch ___ Python tracker <http://bugs.python.org/issue9309> ___ ___ Python-bugs-list m

[issue9309] Add environment variable complementing command line option -no-user-cfg

2010-07-20 Thread Alexander Dreyer
Alexander Dreyer added the comment: Added better patch (checks environment first). -- ___ Python tracker <http://bugs.python.org/issue9309> ___ ___ Python-bug

[issue9309] Add environment variable complementing command line option -no-user-cfg

2010-07-20 Thread Alexander Dreyer
Changes by Alexander Dreyer : Removed file: http://bugs.python.org/file18069/dist.py.patch ___ Python tracker <http://bugs.python.org/issue9309> ___ ___ Python-bugs-list m

[issue9309] Add environment variable complementing command line option -no-user-cfg

2010-07-20 Thread Alexander Dreyer
Alexander Dreyer added the comment: The patch is originating from Sage Days 24. Sage (http://www.sagemath.org) distributes a bunch of mathematical python-based software. The integration of the individual packages is done by individual people which might not use --no-user-cfg in their install

[issue9305] Don't use east/west of UTC in date/time documentation

2010-07-20 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Tue, Jul 20, 2010 at 10:46 AM, anatoly techtonik wrote: > .. Another > concern - if UTC is 0 reference point then there is no reason to add > something to it - you just can say - "Return timedelta equal to local > UTC offset.&quo

[issue9305] Don't use east/west of UTC in date/time documentation

2010-07-20 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Tue, Jul 20, 2010 at 11:39 AM, Tim Peters wrote: >..  As I recall it, the current wording was just to avoid saying "ahead of >UTC" or "behind UTC" (which was the original wording). Interesting. I actually like the origin

[issue9305] Don't use east/west of UTC in date/time documentation

2010-07-20 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Tue, Jul 20, 2010 at 12:14 PM, Alexander Belopolsky wrote: .. > Interesting.  I actually like the original wording better.  For me, > "my watch is 6 hours behind UTC" makes it clear that when the Big Ben > clock shows tea tim

[issue9308] Remove redundant coding cookies from 3.x stdlib

2010-07-20 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > Could you add comments in encoded_modules/__init__.py? Please see updated issue9308a.diff. -- Added file: http://bugs.python.org/file18093/issue9308a.diff ___ Python tracker <http://bugs.pyth

[issue9308] Remove redundant coding cookies from 3.x stdlib

2010-07-20 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : Removed file: http://bugs.python.org/file18077/issue9308a.diff ___ Python tracker <http://bugs.python.org/issue9308> ___ ___ Python-bug

[issue9305] Don't use east/west of UTC in date/time documentation

2010-07-20 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Tue, Jul 20, 2010 at 12:08 PM, anatoly techtonik wrote: .. > Ok. Sold. Good. All we need now is just a patch. :-) -- ___ Python tracker <http://bugs.python.org/iss

[issue4555] Smelly exports (global symbols in python not prefixed with Py or _Py)

2010-07-20 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- title: Smelly exports -> Smelly exports (global symbols in python not prefixed with Py or _Py) ___ Python tracker <http://bugs.python.org/iss

[issue9314] inconsistent result when concatenating list with iterators

2010-07-20 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > In other words, if iadd can deal with it, why can't add? Should ['a', 'b', 'c'] + 'def' return ['a, 'b', 'c', 'd' , 'e', 'f'] o

[issue9314] inconsistent result when concatenating list with iterators

2010-07-20 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > I don't understand is why a += b is different from a + b > in this respect. When a is mutable, a += b updates it in-place, so there is no ambiguity: the type of a cannot change. When you do a + b, there is no reason to treat a as more des

[issue9314] inconsistent result when concatenating list with iterators

2010-07-20 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- type: -> feature request versions: +Python 3.2 -Python 2.6 ___ Python tracker <http://bugs.python.org/issue9314> ___ _

[issue9314] inconsistent result when concatenating list with iterators

2010-07-20 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Note that immutable types are consistent: >>> x = tuple('abc') >>> x += 'def' Traceback (most recent call last): File "", line 1, in TypeError: can only concatenate tuple (not "str") to tupl

[issue9314] inconsistent result when concatenating list with iterators

2010-07-20 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- assignee: -> belopolsky resolution: -> rejected stage: -> committed/rejected status: open -> pending ___ Python tracker <http://bugs.pytho

[issue9282] Bug in --listfuncs option of trace.py

2010-07-20 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: This is clearly an artifact of porting to 3.x. In 2.x the code was calls = self.calledfuncs.keys() calls.sort() for filename, modulename, funcname in calls: which was translated to for filename

[issue9314] inconsistent result when concatenating list with iterators

2010-07-20 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > why the pending status? To me this is a way to say "I will close this next time I look unless someone will change my mind." "pending" has a nice property that it will change to "open" once someone adds a comment.

[issue9282] Bug in --listfuncs option of trace.py

2010-07-20 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Committed with a minor change to meet 80-character line limit. See r82997 (r82999 for 3.1). -- resolution: accepted -> fixed stage: commit review -> committed/rejected status: open -> closed _

[issue9314] inconsistent result when concatenating list with iterators

2010-07-20 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > I thought it was common to requalify a bug report into a doc bug. That's upto you and OP. My rule of thumb is if the title reads as either code or doc bug, it's ok to reclassify. If not, it is better to open a se

[issue9317] Incorrect coverage file from trace test_pickle.py

2010-07-20 Thread Alexander Belopolsky
New submission from Alexander Belopolsky : I am running the following command $ python -m trace -C pickle-trace.d -c -m Lib/test/test_pickle.py and getting attached file, pickle.cover, in the pickle-trace.d directory. This does not look right. From the very beginning, module level

[issue9317] Incorrect coverage file from trace test_pickle.py

2010-07-20 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- nosy: +eli.bendersky, tjreedy ___ Python tracker <http://bugs.python.org/issue9317> ___ ___ Python-bugs-list mailin

[issue9317] Incorrect coverage file from trace test_pickle.py

2010-07-20 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Does the trace module even work in 3.x? I created attached trivial traceme.py file. With python 2.7, I get $ python2 -m trace -c -s traceme.py lines cov% module (path) 1 100% threading (Lib/threading.py) 6 100% traceme

[issue9317] Incorrect coverage file from trace test_pickle.py

2010-07-20 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Tue, Jul 20, 2010 at 11:28 PM, Eli Bendersky wrote: > The problem indeed seems to be deeper. > .. or shallower. :-) -- ___ Python tracker <http://bugs.python.org/

[issue9317] Incorrect coverage file from trace test_pickle.py

2010-07-20 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Here is another problem: with no file x in cwd, $ ./python.exe -m trace -c -f x traceme.py Skipping counts file 'x': [Errno 2] No such file or directory: 'x' This one seems to exist in both 2.7 and 3.x. Creating emp

[issue9317] Incorrect coverage file from trace test_pickle.py

2010-07-20 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Comparison of count files produced by 2.7 and 3.x suggests that the problem is in finding the source file for the module: >>> pickle.load(open('x', 'rb')) ({('', 2): 2, ('', 1): 4, ('', 8): 20,

[issue9317] Incorrect coverage file from trace test_pickle.py

2010-07-20 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Wed, Jul 21, 2010 at 12:13 AM, Eli Bendersky wrote: .. > I'm investigating further, but this may very well be caused by different > behavior > of `f_code.co_filename` between Python 2 and 3. I am afraid I am a step ahead of you.

[issue9317] Incorrect coverage file from trace test_pickle.py

2010-07-20 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I am attaching a proof-of-concept patch, issue9317.diff, which fixes the file name problem at the expense of more spurious modules: $ ./python.exe -m trace -c -s traceme.py lines cov% module (path) 7 100% codecs (Lib/codecs.py) 10

[issue9317] Incorrect coverage file from trace test_pickle.py

2010-07-21 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Eli, Your new patch makes perfect sense, but can you check of regular python invocation uses runpy these days. If it does, it may make sense to include it in trace at least optionally. Also, does this fix the original problem? -- nosy

[issue9317] Incorrect coverage file from trace test_pickle.py

2010-07-21 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Jul 21, 2010, at 9:22 AM, Eli Bendersky wrote: > > Eli Bendersky added the comment: > > <<<< > Your new patch makes perfect sense, but can you check of regular > python invocation uses runpy these days. If it does,

[issue9317] Incorrect coverage file from trace test_pickle.py

2010-07-21 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Wed, Jul 21, 2010 at 9:45 AM, Eli Bendersky wrote: .. > As far as I understand, when you run: > >    py3d -m trace -C pickle-trace.d -c -m test_pickle.py > > The first -m flag applies to the trace module. Python uses > runpy.run_modu

[issue9317] Incorrect coverage file from trace test_pickle.py

2010-07-21 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Eli, At this point, I think it will be best to focus on unittests. I am adding #9315 as a dependency here and will add a comment there. I think once we have good unittest coverage the bug will become obvious. -- dependencies: +The trace

[issue9317] Incorrect coverage file from trace test_pickle.py

2010-07-21 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Also, when you get a chance, please separate the __main__ coverage bug into a separate issue and bring it up on python-dev. We should get profile guys involved and I don't want them to be distracted by trace specific i

[issue9315] The trace module lacks unit tests

2010-07-21 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I am adding 2.7. It is ok to add tests to the stable series release AFAIK. Moreover, I believe the unittests should be written for 2.7 first. Since 3.x port of trace was done without the benefit of a test suite, it is likely that there are many

[issue9314] inconsistent result when concatenating list with iterators

2010-07-21 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Wed, Jul 21, 2010 at 2:09 AM, Ray.Allen wrote: .. > Does this means "a += b" is not the same as "a = a + b"? For immutable a, the two are practically the same, for mutable, they are necessarily different. This is explained in

[issue9323] trace.py bug with the main file being traced

2010-07-21 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: [Copying msg111059 from issue9317] On Wed, Jul 21, 2010 at 9:45 AM, Eli Bendersky wrote: .. > As far as I understand, when you run: > >py3d -m trace -C pickle-trace.d -c -m test_pickle.py > > The first -m flag applies to the trace

[issue9323] trace.py bug with the main file being traced

2010-07-21 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Committed with a minor change. (There is no need to keep the source file open during the trace run.) See r83035 (r83037 in release31-maint.) I will open a separate issue to discuss a possible RFE related to msg111074. -- resolution: -> fi

[issue9314] inconsistent result when concatenating list with iterators

2010-07-21 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- status: open -> closed ___ Python tracker <http://bugs.python.org/issue9314> ___ ___ Python-bugs-list mailing list Un

<    28   29   30   31   32   33   34   35   36   37   >