[issue6280] calendar.timegm() belongs in time module, next to time.gmtime()

2010-02-20 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Francesco, You have my +1 for implementing both 1 and 2 below. """ 1. Use timegm(3) function where HAVE_TIMEGM is defined (i have a working patch for it) 2. Implement a more portable timegm function with tzset and mktime where

[issue7900] posix.getgroups() failure on Mac OS X

2010-02-21 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Sun, Feb 21, 2010 at 1:58 PM, Martin v. Löwis wrote: .. > I would propose a different strategy: if _SC_NGROUPS_MAX is defined, use > that to find out how much memory to allocate, otherwise, fall back to > the current max array size. Can you

[issue7900] posix.getgroups() failure on Mac OS X

2010-02-22 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Here is another interesting fact: Mac OS 10.6 comes with python 2.5 and 2.6 preinstalled: $ python2.5 -V Python 2.5.3c1 $ python2.6 -V Python 2.6.1 Neither of these exhibit the same bug, but both are broken in some way. Given $ cat tg.py import os g

[issue7900] posix.getgroups() failure on Mac OS X

2010-02-22 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Apparently, Apple patches posix_[gs]etgroups functions as follows: for 2.5: http://www.opensource.apple.com/source/python/python-44/2.5/fix/posixmodule.c.ed for 2.6: http://www.opensource.apple.com/source/python/python-44/2.6/fix/posixmodule.c.ed

[issue7900] posix.getgroups() failure on Mac OS X

2010-02-22 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I've converted apple patches to unified diffs, but I cannot reproduce 2.5 behavior. -- Added file: http://bugs.python.org/file16309/apple-2.5-fix-posixmodule.c.diff ___ Python tracker <http://bugs.py

[issue7900] posix.getgroups() failure on Mac OS X

2010-02-22 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: After some head-scratching, I figured out how to reproduce stock python2.5 behavior. It turns out that defining _DARWIN_C_SOURCE not only allows getgroups() output to exceed NGROUPS_MAX (as documented), but also effectively disables setgroups() which

[issue7900] posix.getgroups() failure on Mac OS X

2010-02-22 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I am reclassifying this as a crash because os.getgroups() crashes the interpreter when python is running as root on an unmodified system: $ sudo ./python.exe -c "import os; os.getgroups()" Traceback (most recent call last): File &quo

[issue7900] posix.getgroups() failure on Mac OS X

2010-02-23 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Tue, Feb 23, 2010 at 2:20 AM, Ronald Oussoren wrote: > .. > Alexander:  What makes you think r63955 introduced the problem? That revision introduced _DARWIN_C_SOURCE which, as I explained, has two effects on get/setgroups: ""&qu

[issue7900] posix.getgroups() failure on Mac OS X

2010-02-23 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Ronald, Have you tested your patch with issue7900-tests.diff? On my system: $ ./python.exe Lib/test/test_posix.py testNoArgFunctions (__main__.PosixTester) ... Segmentation fault and $ sudo ./python.exe Lib/test/test_posix.py .. FAIL

[issue7900] posix.getgroups() failure on Mac OS X

2010-02-23 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Tue, Feb 23, 2010 at 8:46 AM, Ronald Oussoren wrote: .. > What I did notice though is that the tests don't actually test the issue at > hand: > having more than 16 secondairy groups on OSX. This is easy to fix: just add another e

[issue7900] posix.getgroups() failure on Mac OS X

2010-02-23 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Tue, Feb 23, 2010 at 8:46 AM, Ronald Oussoren wrote: > .. > I get test failures, but no crashes, when I do run the additional tests. The crash that I see is apparently due to underallocated memory: alt_grouplist = PyMem_Malloc(n); sho

[issue7900] posix.getgroups() failure on Mac OS X

2010-02-23 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: E-mail to tracker handling still seems to remove '>' quoted lines. I am reposting a couple of comments that got clobbered: -- > * allocate an array of groupcount gid_t's and call getgroups(groupcount) > This is more or less wh

[issue7900] posix.getgroups() failure on Mac OS X

2010-02-23 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I think I finally understand what is going on and ready to make what I believe is a reasonable proposal. Setting _DARWIN_C_SOURCE (or _DARWIN_UNLIMITED_GETGROUPS) replaces getgroups with a Darwin extension, but does not change setgroups: $ nm tg1

[issue6280] calendar.timegm() belongs in time module, next to time.gmtime()

2010-02-23 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: The patch (I reviewed timemodule-gmtime-trunk.diff) looks mostly correct. One problem that I see is that it will likely produce compiler warnings on the systems without timegm and mktime. The warnings will be due to unused static function time_timegm

[issue7900] posix.getgroups() failure on Mac OS X

2010-02-23 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Tue, Feb 23, 2010 at 12:16 PM, Ronald Oussoren wrote: .. > How did you detect that the modern getgroups implementation doesn't > query the kernel? That would be very odd. I wish I could say that I mastered dtrace under OSX, but I am no

[issue7900] posix.getgroups() failure on Mac OS X

2010-02-23 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: David, Can you unset "normal" priority from this issue. Regardless of whether it is a crash or not a crash, this is a regression for which there is no user work-around. It looks like "normal" priority makes the issue disappear fr

[issue7736] os.listdir hangs since opendir() and closedir() do not release GIL

2010-02-23 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Another "+1" on the patch if it is needed. Posix module consistently releases the GIL while making system calls and this is a good idea independent of this particular issue. Looking at the patch made me wonder whethe

[issue6280] calendar.timegm() belongs in time module, next to time.gmtime()

2010-02-24 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Looks good. A documentation typo: gmtime() -- convert seconds since Epoch to UTC tuple\n\ +timegm() - Convert a UTC tuple to seconds since the Epoch.\n\ Note the use of -- in the existing items. I understand that the choice of float for return value

[issue8013] time.asctime segfaults when given a time in the far future

2010-02-24 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Looks like a case of missing null check. Patch attached. -- keywords: +patch nosy: +Alexander.Belopolsky Added file: http://bugs.python.org/file16359/issue8013.diff ___ Python tracker <http://bugs.python.

[issue7900] posix.getgroups() failure on Mac OS X

2010-02-24 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Wed, Feb 24, 2010 at 12:45 PM, Martin v. Löwis wrote: .. > I still think that the sysconf version should be the correct one. If OSX > fails to work correctly under > that version, and causes Python to raise an exception - then that's

[issue7150] datetime operations spanning MINYEAR give bad results

2010-02-25 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Given assert(*m > 0); assert(*d > 0); at the end of normalize_y_m_d(), it looks like at lest 1 <=*month and 1 <=*day are redundant. A closer look also reveals assert(1 <= *m && *m <= 12); in the

[issue7150] datetime operations spanning MINYEAR give bad results

2010-02-25 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Aha! My reliance on asserts() was misguided. With the debug build: >>> t0-d2 Assertion failed: (ordinal >= 1), function ord_to_ymd, file /Users/sasha/Work/python-svn/trunk/Modules/datetimemodule.c, line 269. Abort trap Should we reclass

[issue8015] pdb "commands" command throws you into postmortem if you enter an empty command

2010-02-25 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I am attaching the patch that fixes the issue by ignoring empty and all space lines during commands' entry. Note that as written the patch also makes pdb ignore shell escapes unless it is extended with do_shell method. I think this is the

[issue7999] setregid does not work with -1 as argument

2010-02-25 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I reproduced this bug on OSX 10.6: >>> os.setregid(-1,-1) Traceback (most recent call last): File "", line 1, in OverflowError: group id too big Since -1 has special meaning as an argument to POSIX setregid(rgid, egid), "&q

[issue8027] distutils fail to determine c++ linker with unixcompiler if using ccache

2010-02-27 Thread Alexander Sulfrian
New submission from Alexander Sulfrian : Hi, if using ccache (CC="ccache gcc --flags", CXX="g++") distutils will try to execute something like "g++ gcc --flags" as linker for c++ libraries. Patch attached. Alex -- assignee: tarek components: Distu

[issue887237] Machine integers

2010-03-04 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I would like to hear from Thomas before introducing macros in this code. I tried to follow the style of cfield.c which shows similar code duplication. There are also some questions that need to be answered before polishing the code. 1. Should mixed

[issue8065] Memory leak in readline.get_current_history_length

2010-03-05 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Note the following comment elsewhere in Modules/readline.c: /* the history docs don't say so, but the address of state changes each

[issue8065] Memory leak in readline.get_current_history_length

2010-03-05 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Not directly related to the issue at hand, but I've noticed that while readline.get_current_history_length() is tested in the unittests, readline.get_history_length() is not. Attached patch adds tests for reading and writing history files. Al

[issue887237] Machine integers

2010-03-05 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Attaching a patch that is equivalent toissue887237.diff, but uses preprocessor to generate repetitive code. -- Added file: http://bugs.python.org/file16466/issue887237-macro.diff ___ Python tracker <h

[issue6953] readline documenation needs work

2010-03-06 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- nosy: +Alexander.Belopolsky ___ Python tracker <http://bugs.python.org/issue6953> ___ ___ Python-bugs-list mailing list Unsub

[issue8065] Memory leak in readline.get_current_history_length

2010-03-06 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: It appears that the tests that I attached fail when libedit is used. This is clearly due to bugs in libedits readline emulation: 1. read_history does not update history_length 2. history_truncate_file does not preserver the history cookie

[issue6953] readline documenation needs work

2010-03-09 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Tue, Mar 9, 2010 at 4:24 PM, stefanholek wrote: .. > To be zero-based, get_history_item would need to look like: .. > +       if ((hist_ent = history_get(history_base + idx))) Did you test this with l

[issue8065] Memory leak in readline.get_current_history_length

2010-03-09 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I my experience, reporting bugs in open source components of OSX to bugreport.apple.com is a waste of time. Such reports are largely ignored and they are not visible to upstream developers. I believe the upstream for libedit is NetBSD, http

[issue8065] Memory leak in readline.get_current_history_length

2010-03-09 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I submitted two bug reports: 7734961 libedit history_truncate_file () fails to preserve magic line Mac OS X Other Bug 09-Mar-2010 05:48 PM Open 7734839 libedit read_history() does not update history_length Mac OS X Other Bug 09-Mar-2010 05:39 PM Open

[issue4376] Nested ctypes 'BigEndianStructure' fails

2010-03-11 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: theller> - Should 'part' be inserted as is, [possibly] leading theller> to a total structure of fields with mixed byte order? +1 for this option. -- nosy: +Alexander.Belopolsky ___ Pytho

[issue8154] os.execlp('true') crashes the interpreter on 2.x

2010-03-16 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: As far as I can tell, it does not *crash* the interpreter. Instead, it replaces the python interpreter process with a "true" utility. $ ./python.exe Python 2.7a4+ (trunk:78816M, Mar 9 2010, 18:57:13) [GCC 4.2.1 (Apple Inc. build 5646) (

[issue8154] os.execlp('true') crashes the interpreter on 2.x

2010-03-16 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I forgot to add that this behavior is documented: os.execlp = execlp(file, *args) execlp(file, *args) Execute the executable file (which is searched for along $PATH) with argument list args, replacing the current process

[issue8154] os.execlp('true') crashes the interpreter on 2.x

2010-03-16 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: The original report, issue1039 has a better problem description: "In a windows debug build, an assertion is triggered when os.execvpe is called with an empty argument list: self.assertRaises(OSError, os.execvpe, 'no such app-', [], No

[issue8154] os.execlp('true') crashes the interpreter on 2.x

2010-03-16 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Adding Thomas. Thomas, Do you remember why your patch for issue1039 was not backported? -- nosy: +theller ___ Python tracker <http://bugs.python.org/issue8

[issue8154] os.execlp('true') crashes the interpreter on 2.x

2010-03-16 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Tue, Mar 16, 2010 at 7:46 PM, Matthias Klose wrote: .. > it does crash: Strange. Can you report your Linux version and the stack trace from the crash? On Ubuntu, 2.6.24-27-generic #1 SMP Wed Jan 27 23:54:28 UTC 2010 i686 GNU/Linux, I see no cr

[issue8154] os.execlp('true') crashes the interpreter on 2.x

2010-03-18 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Thu, Mar 18, 2010 at 3:32 PM, R. David Murray wrote: .. > I agree that this should be fixed, since we presumably want to be "strictly > conforming" to the posix standards, > but it looks like this is a regression in either linux

[issue3135] inspect.getcallargs()

2010-03-18 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- nosy: +Alexander.Belopolsky ___ Python tracker <http://bugs.python.org/issue3135> ___ ___ Python-bugs-list mailing list Unsub

[issue6474] Inconsistent TypeError message on function calls with wrong number of arguments

2010-03-18 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- nosy: +Alexander.Belopolsky ___ Python tracker <http://bugs.python.org/issue6474> ___ ___ Python-bugs-list mailing list Unsub

[issue8174] Misleading reported number of given arguments on function call TypeError

2010-03-18 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- nosy: +Alexander.Belopolsky ___ Python tracker <http://bugs.python.org/issue8174> ___ ___ Python-bugs-list mailing list Unsub

[issue3690] sys.getsizeof wrong for Py3k bool objects

2010-03-18 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- nosy: +Alexander.Belopolsky ___ Python tracker <http://bugs.python.org/issue3690> ___ ___ Python-bugs-list mailing list Unsub

[issue8191] Make arg0 required argument in os.execl* functions

2010-03-21 Thread Alexander Belopolsky
New submission from Alexander Belopolsky : Since issue1039 made it illegal to pass empty argument list to execv*, I suggest to change signature of os.execl* functions and make arg0 a required positional argument. This is not a backward compatible change because os.execlp('true&#x

[issue8154] os.execlp('true') crashes the interpreter on 2.x

2010-03-21 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Please see related issue8191. -- ___ Python tracker <http://bugs.python.org/issue8154> ___ ___ Python-bugs-list mailin

[issue1039] Asssertion in Windows debug build

2010-03-21 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Link to revision: r57731 -- nosy: +Alexander.Belopolsky ___ Python tracker <http://bugs.python.org/issue1039> ___ ___

[issue1039] Asssertion in Windows debug build

2010-03-21 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: This issue was misclassified as an interpreter crash while in fact it was a bug in the underlying OS utility. Please see discussion in issue8154. Since the fix changes behavior, it should be documented and a NEWS entry added. -- type: crash

[issue8191] Make arg0 required argument in os.execl* functions

2010-03-21 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Sun, Mar 21, 2010 at 2:52 PM, Matthias Klose wrote: .. > os.execlp('true') does raise ValueError on released 3.x versions. sorry if I > do misunderstand something. My bad. I thought it was a more recent change. However as far as I

[issue8176] Interpreter crash with "double free or corruption" message

2010-03-21 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Clearly not enough information, but I have a few observations: 1. Clearly the crash occurs on exit (in Py_Finalize) during a module cleanup. (Unfortunately it looks like a non-debug build of Python was used so figuring out which module is involved may

[issue8026] strftime bug when timedelta is negative

2010-04-12 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: This is not a bug. The issue boils down to the following: >>> from datetime import * >>> d = datetime(2010, 1, 1) >>> d, d.strftime("%G") (datetime.datetime(2010, 1, 1, 0, 0), '2009') and OP expects '

[issue2706] datetime: define division timedelta/timedelta

2010-04-12 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Is there a good reason why this issue is languishing? The requested functionality seems to be well motivated, simple to implement with few objections resolved in the discussion. I wonder if it would be helpful to limit this patch to 3.x series. That

[issue8191] Make arg0 required argument in os.execl* functions

2010-04-19 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Google code search for os.execlp\([^*,]+\) lang:python returns 15 hits, two of which are the same as Matthias found. I am not sure what these results mean for the issue (and Matthias does not reach a conclusion either.) Note that the status quo in 3

[issue8154] os.execlp('true') crashes the interpreter on 2.x

2010-04-19 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: If this new feature stays in 3.x, shouldn't 2.7 have a -3 warning? Also, I would consider adding os.execlp(path) -> os.execlp(path, os.path.basename(path)) transformation to 2to3. -- ___ Python

[issue8154] os.execlp('true') crashes the interpreter on 2.x

2010-04-19 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I noticed that the change is still present in 2.7a. For what it's worth, I agree with David: """ Since it does trigger a crash on the windows equivalent API, the check should be conditional on platform. And it should generate a p

[issue2706] datetime: define division timedelta/timedelta

2010-04-19 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I am attaching a forward port of Victor's timedelta_true_divide_divmod.patch to py3k. -- nosy: +Alexander.Belopolsky Added file: http://bugs.python.org/file16990/issue2706.diff ___ Python tracker

[issue2706] datetime: define division timedelta/timedelta

2010-04-19 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- nosy: -belopolsky ___ Python tracker <http://bugs.python.org/issue2706> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue2706] datetime: define division timedelta/timedelta

2010-04-19 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Mon, Apr 19, 2010 at 4:09 PM, Mark Dickinson wrote: I noticed that as I was porting Victor's patch. I did not add timedelta % timedelta because I found out that timedelta % int is not supported in the released versions while timedelta // int i

[issue2706] datetime: define division timedelta/timedelta

2010-04-19 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I should be able to add timedelta % timedelta and fix the nits that Mark mentioned tonight. -- ___ Python tracker <http://bugs.python.org/issue2

[issue2706] datetime: define division timedelta/timedelta

2010-04-19 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: New patch, issue2706a.diff, implements timedelta % timedelta and addresses Mark's code review comments. With respect to Mark's """ One other thought: with this division operation added, it might be nice to add constants lik

[issue2706] datetime: define division timedelta/timedelta

2010-04-19 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : Removed file: http://bugs.python.org/file16990/issue2706.diff ___ Python tracker <http://bugs.python.org/issue2706> ___ ___ Python-bug

[issue8191] Make arg0 required argument in os.execl* functions

2010-04-19 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Mon, Apr 19, 2010 at 11:03 PM, R. David Murray wrote: > > Alexander, do you think it would be worthwhile to write up a summary of all > the issues > involved in these three releated bugs and post it to python-dev? Sure. I ranted abo

[issue8469] struct - please make sizes explicit

2010-04-20 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: It is very easy to generate the size table programmatically: >>> for c in "xcbB?hHiIlLqQfdspP": ... print(c, struct.calcsize(c)) ... x 1 c 1 b 1 B 1 ? 1 h 2 H 2 i 4 I 4 l 8 L 8 q 8 Q 8 f 4 d 8 s 1 p 1 P 8 However, all values abo

[issue7150] datetime operations spanning MINYEAR give bad results

2010-04-20 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: My patch includes unit tests and I tested it on Mac OS X. Anand, what kind of testing do you have in mind? -- versions: +Python 2.7, Python 3.2, Python 3.3 ___ Python tracker <http://bugs.python.

[issue8469] struct - please make sizes explicit

2010-04-20 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Tue, Apr 20, 2010 at 10:30 AM, Mark Dickinson wrote: .. > It would be possible to add the 'standard' sizes to that table (i.e. the > sizes that you get when using '<', '>', etc.);  would that be helpful? T

[issue1083] Confusing error message when dividing timedelta using /

2010-04-20 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: This is certainly not a bug, so I don't think targeting 2.7 is appropriate. I have explained in a comment on issue2706 (see msg75917) why I believe true division of timedelta by int should not be supported. In short, true division of timedelta b

[issue1100942] Add datetime.time.strptime and datetime.date.strptime

2010-04-20 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I am +1 for adding these features and I have only one comment on the code: It is documented in time.strptime() documentation that """ The default values used to fill in any missing data when more accurate values cannot be inferred are (1

[issue1100942] Add datetime.time.strptime and datetime.date.strptime

2010-04-20 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: BTW, it does not bother me that "date.strptime() seems a bit odd, given that it cannot accept a time part." To me "time" in strptime means time specification that may include date, time or even just month. If parsed specification

[issue8472] itertools.filterfalse() function missing

2010-04-20 Thread Alexander Myodov
New submission from Alexander Myodov : The documentation (eg at http://docs.python.org/release/2.6.5/library/functions.html#filter) tells that there should be an itertools.filterfalse() function complementary to builtin filter() function, that returns the list of elements (instead of the

[issue8472] itertools.filterfalse() function missing

2010-04-20 Thread Alexander Myodov
Changes by Alexander Myodov : -- type: -> behavior ___ Python tracker <http://bugs.python.org/issue8472> ___ ___ Python-bugs-list mailing list Unsubscri

[issue8472] itertools.filterfalse() function missing

2010-04-20 Thread Alexander Myodov
Alexander Myodov added the comment: In this case, I'd suggest to rephrase it to "See :func:`itertools.ifilterfalse` for the complementary function that returns the iterator over the elements of *iterable* for which *function* returns false.", or even remove this line a

[issue1289118] timedelta multiply and divide by floating point

2010-04-20 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: This is in a way more similar to issue1083 than to issue2706. I am -1 on this RFE for the same reason as I am opposing allowing true division of timedelta by an int. The timedelta type is fundamentally an integer type. A type delta is just a certain

[issue1289118] timedelta multiply and divide by floating point

2010-04-20 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I meant rejecting issue1083, of course. -- ___ Python tracker <http://bugs.python.org/issue1289118> ___ ___ Python-bug

[issue5516] equality not symmetric for subclasses of datetime.date and datetime.datetime

2010-04-21 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: There is another inconsistency that this patch does not seem to cure. With patch applied and D and DT defined as in OP, >>> D(1900,1,1) > DT(1900,1,1) True but >>> DT(1900,1,1) < D(1900,1,1) Traceback (most recent call last

[issue5516] equality not symmetric for subclasses of datetime.date and datetime.datetime

2010-04-21 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Upon further reflection I am -1 on this patch. First, as implemented this patch changes behavior of an explicit invocation of date.__eq__. The patch proposes to remove the following tests: -# Neverthelss, comparison should work with the base

[issue2706] datetime: define division timedelta/timedelta

2010-04-21 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Can someone (Mark?) add an acknowledgment for Victor Stinner to the NEWS file? My py3k patch was 90% code from Victor's trunk patch. -- ___ Python tracker <http://bugs.python.org/i

[issue1673409] datetime module missing some important methods

2010-04-21 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: With issue2706 accepted, I think this issue can now be rejected because proposed td.tosecs() can now be spelled simply as td/timedelta(seconds=1). The other RFE for a totimestamp() method is a duplicate of issue2736. -- nosy

[issue1673409] datetime module missing some important methods

2010-04-21 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Wed, Apr 21, 2010 at 2:03 PM, Mark Dickinson wrote: .. > (BTW, as well as the newly introduced division methods, td.tosecs already > exists, except that it's spelt td.total_seconds.) Aggrrr! How did that slip in? :-) 8639913600.0

[issue5516] equality not symmetric for subclasses of datetime.date and datetime.datetime

2010-04-21 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Wed, Apr 21, 2010 at 2:33 PM, Jess Austin wrote: .. > It might seem like the latter behavior is marginally better, but really this > is just a mess, since a date-datetime comparison TypeErrors in all > directions.  I appreciate Alexand

[issue6280] calendar.timegm() belongs in time module, next to time.gmtime()

2010-04-26 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: It is too late to get new features in 2.x. Francesco, Please double-check timemodule-gmtime-r312.diff, it does not seem to reflect your reported changes. ('-' vs '--' typo is still there) There is no need to submit multiple patche

[issue6280] calendar.timegm() belongs in time module, next to time.gmtime()

2010-04-26 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Some more comments: - Documentation needs a "versionadded" entry. - A fate of calendar.timegm() needs to be decided. If the decision is to deprecate it, deprecation warning need to be added to calendar module and docs updated accordingl

[issue8005] datetime's comparison methods do not return NotImplemented when they should

2010-04-27 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Is there a patch with a fix or just a patch with a test. If the later, maybe someone can remove a patch keyword. -- nosy: +Alexander.Belopolsky -belopolsky ___ Python tracker <http://bugs.python.

[issue8005] datetime's comparison methods do not return NotImplemented when they should

2010-04-27 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Before someone spends more time writing a patch, lets pause and consider whether this is a bug in the first place. My understanding of the issue is that given >>> class A(object): ... def __eq__(self, other): ...return True ... OP exp

[issue1636] Execfile unable to take arguments beyond 255!

2010-04-27 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I don't have much to contribute other than a simple test to reproduce the issue: >

[issue8442] Broken zipfile with python 3.2 on osx

2010-04-29 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I cannot reproduce this behavior on my MacBook running OSX 10.6.2. $ ./python.exe Lib/test/test_distutils.py ... -- Ran 168 tests in 3.850s OK (skipped=4) Also, cp437 appears to be a

[issue8404] Set operations don't work for dictionary views

2010-04-29 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: The patch looks fine. I verified that the new tests pass on trunk and py3k. I am attaching a patch for py3k with a forward port of set opereations and repr tests. -- nosy: +Alexander.Belopolsky Added file: http://bugs.python.org/file17127

[issue8413] String interpolation doesn't work with sys.version_info

2010-04-29 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I am not sure fixing this quirk of %-formatting is worth the trouble given that one simply use new style {}-formatting: $ python-c 'import sys; print("{}.{}.{}-{}-{}".format(*sys.version_info))' 3.2.0-alpha-0 or a work-around $ p

[issue8413] String interpolation doesn't work with sys.version_info

2010-04-29 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: The recommended way to check that an object is an instance of a namedtuple is to check for the _fields attribute. See issue7796, msg99869. -- ___ Python tracker <http://bugs.python.org/issue8

[issue8413] String interpolation doesn't work with sys.version_info

2010-04-29 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Thu, Apr 29, 2010 at 11:52 AM, Raymond Hettinger wrote: .. > IIRC, there is an open ticket to make structseq inherit from tuple to avoid > just this kind of problem. > Indeed, see

[issue665761] reduce() masks exception

2010-04-30 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I am attaching a patch with unit tests that implements the "middle-ground approach" making map and reduce behave the way zip is now. I my view this slightly preferable to the "all the way" approach of letting all exceptions

[issue1533] Bug in range() function for large values

2010-04-30 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I agree that this issue should be closed with no further action, but for historical accuracy the resolution should be "out of date" rather than "won't fix". The original bug was about range() behavior when it get argument

[issue5109] array.array constructor very slow when passed an array object.

2010-04-30 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Attached patch makes array(t, a) use memcpy when t == a.typecode. The code array_new can probably be refactored to eliminate redundant checks, but with a good C compiler this probably have no performance effect. While refactoring can simplify the code

[issue1533] Bug in range() function for large values

2010-05-01 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Sat, May 1, 2010 at 3:50 AM, Mark Dickinson wrote: > > Mark Dickinson added the comment: > > Alexander: range *does* still accept such arguments (in 2.7);  just not > floats: > >>>> from decimal import Decimal >

[issue1533] Bug in range() function for large values

2010-05-01 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Sat, May 1, 2010 at 10:59 AM, Mark Dickinson wrote: > > Mark Dickinson added the comment: > > Decimal is behaving in exactly the same way as MyInt, isn't it? > What do you get for range(MyInt(20), MyInt(20))? > Hmm, maybe

[issue1533] Bug in range() function for large values

2010-05-01 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Robert, Your patch segfaults on Lib/test/test_builtin.py, but I agree with the approach. I'll see if it is easy to fix. -- ___ Python tracker <http://bugs.python.org/i

[issue1533] Bug in range() function for large values

2010-05-01 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- assignee: -> belopolsky nosy: +belopolsky -Alexander.Belopolsky ___ Python tracker <http://bugs.python.org/iss

[issue1533] Bug in range() function for large values

2010-05-01 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I am attaching a patch which does not crash or leak (as tested with -R :) and adds a unit test for OP's case. The problem, however is that it does not work if new style classes are used in the test case. See disabled (with if 0) test in the

[issue1533] Bug in range() function for large values

2010-05-01 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Mark, I did not see your last comment before uploading the last patch. I think your suggestion to bypass PyNumber_Long will fix the new/old style classes discrepancy. -- ___ Python tracker <h

[issue1533] Bug in range() function for large values

2010-05-01 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: This patch, bltinmodule4.diff, seems to work for all cases. Mark, It looks like I came up with almost the same logic as you did. The only difference that I can see is that your code does not check that nb_int returns an integer. Also I put repeated

<    7   8   9   10   11   12   13   14   15   16   >