[issue10254] unicodedata.normalize('NFC', s) regression

2010-12-22 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Committed to py3k in revision 87442. -- versions: -Python 3.2 ___ Python tracker <http://bugs.python.org/issue10

[issue8863] Display Python backtrace on SIGSEGV, SIGFPE and fatal error

2010-12-22 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Wed, Dec 22, 2010 at 9:27 PM, Scott Dial wrote: > > Scott Dial added the comment: > > On 12/22/2010 8:52 PM, STINNER Victor wrote: > > Amaury asked for a sys.setsegfaultenabled() option: I think that the > > command line op

[issue10587] Document the meaning of str methods

2010-12-22 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Committed r87443 (3.2) and r87444 (3.1). -- resolution: -> fixed stage: commit review -> committed/rejected status: open -> closed ___ Python tracker <http://bugs.python.or

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

2010-12-23 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- status: pending -> closed ___ Python tracker <http://bugs.python.org/issue6280> ___ ___ Python-bugs-list mailing list Un

[issue9063] TZ examples in datetime.rst are incorrect

2010-12-23 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Committed in r87463 (3.2), r87464 (2.7) and r87465 (3.1). -- resolution: -> fixed stage: commit review -> committed/rejected status: open -> closed versions: +Python 3.1 ___ Python track

[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2010-12-23 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I would like to start reviewing this code, but dated zip files on a tracker make a very inefficient VC setup. Would you consider exporting your development history to some public VC system? -- nosy: +belopolsky

[issue10767] Lib/test/crashers/README is out of date

2010-12-23 Thread Alexander Belopolsky
New submission from Alexander Belopolsky : Among other things, README says: """ Each test should have a link to the bug report: # http://python.org/sf/BUG# """ but the only such link is found in crashers/infinite_loop_re.py and points to a closed iss

[issue10254] unicodedata.normalize('NFC', s) regression

2010-12-28 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Committed backports: r87540 (3.1) r87541 (2.7) r87546 (2.6) -- resolution: -> fixed stage: commit review -> committed/rejected status: open -> closed versions: +Python 3.2 ___ Python track

[issue10785] parser: store the filename as an unicode object

2010-12-28 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I like the idea, but I don't like the trend that parser code continues to diverge from pgen. I understand that most of the Python runtime is not available to pgen, but maybe a more elegant solution than changing the type conditional on PGEN c

[issue10542] Py_UNICODE_NEXT and other macros for surrogates

2010-12-28 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Sat, Nov 27, 2010 at 5:03 PM, Marc-Andre Lemburg wrote: .. >  * this version should be slightly faster and is also easier to read: > > #define Py_UCS4_READ_CODE_POINT(ptr, end) \ .. >      Py_UNICODE_JOIN_SURROGATES((ptr)++, (ptr)++)

[issue10542] Py_UNICODE_NEXT and other macros for surrogates

2010-12-28 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I am attaching a patch for commit review. I added an underscore prefix to all new macros. This way I am not introducing new features and we will have a full release cycle to come up with better names. i would just note that "next" term

[issue10542] Py_UNICODE_NEXT and other macros for surrogates

2010-12-29 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Wed, Dec 29, 2010 at 10:00 AM, Georg Brandl wrote: .. > >> Let's wait for 3.3 with the change. > > Definitely. Does this also mean that the numerous surrogates related bugs should wait until 3.3 as well? (See issues #9200 and #105

[issue10542] Py_UNICODE_NEXT and other macros for surrogates

2010-12-29 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Wed, Dec 29, 2010 at 7:19 AM, Marc-Andre Lemburg wrote: .. > * The macros still need some more attention to enhance their performance. > Although I made your suggested change from '-' to '&', I seriously doubt that thi

[issue10542] Py_UNICODE_NEXT and other macros for surrogates

2010-12-29 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Sat, Nov 27, 2010 at 5:24 PM, Marc-Andre Lemburg wrote: .. > Perhaps we should allow ord() to work on surrogates in > UCS4 builds as well. That would reduce the number of > surprises. > This is an interesting idea, however, having surrog

[issue10542] Py_UNICODE_NEXT and other macros for surrogates

2010-12-29 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: The example in my previous message should have been: >>> '\U0001' == '\uD800\uDC00' True -- ___ Python tracker <h

[issue10542] Py_UNICODE_NEXT and other macros for surrogates

2010-12-29 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Wed, Dec 29, 2010 at 11:36 AM, Georg Brandl wrote: .. > That bug already strikes me as quite exotic. > Would it look as exotic if presented like this? File "", line 1 𐌀 = 5 ^ SyntaxError: invalid character in identifier

[issue10542] Py_UNICODE_NEXT and other macros for surrogates

2010-12-29 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I should stop using e-mail to reply to bug reports! The mangled example was >>> 𐌀 = 5 File "", line 1 𐌀 = 5 ^ SyntaxError: invalid character in identifier -- ___ Py

[issue10542] Py_UNICODE_NEXT and other macros for surrogates

2010-12-29 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : Added file: http://bugs.python.org/file20190/issue10542a.diff ___ Python tracker <http://bugs.python.org/issue10542> ___ ___ Python-bug

[issue10542] Py_UNICODE_NEXT and other macros for surrogates

2010-12-29 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Wed, Dec 29, 2010 at 3:36 PM, STINNER Victor wrote: .. > Use non-ASCII identifiers is exotic. Use non-BMP identifiers is > crazy :-) Hmm, we clearly disagree on what crosses the boundary of the mental norm. IMHO, it is crazy to require us

[issue8271] str.decode('utf8', 'replace') -- conformance with Unicode 5.2.0

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

[issue8821] Range check on unicode repr

2010-12-29 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: [MAL] > * Unicode objects are NUL-terminated, but only very external APIs >rely on this (e.g. code using the Windows Unicode API). Please >don't make the code in unicodeobject.c itself rely on this >subtle detail. I would

[issue3232] Wrong str->bytes conversion in Lib/encodings/idna.py

2010-12-29 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Martin's original code (r32301) was pretty clear: 32301 loewis # IDNA allows decoding to operate on Unicode strings, too. 32301 loewis if isinstance(input, unicode): 32301 loewis labels = dots.split(

[issue3232] Wrong str->bytes conversion in Lib/encodings/idna.py

2010-12-29 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Arguably, it is not a bug if codec's decode method rejects unicode strings with a TypeError. The 2.x implementation seems to allow decoding of ASCII-only unicode labels joined by arbitrary RFC 3490 separators. I am not sure what the use case for

[issue10542] Py_UNICODE_NEXT and other macros for surrogates

2010-12-29 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Wed, Dec 29, 2010 at 8:02 PM, Martin v. Löwis wrote: .. > > I plan to propose a complete redesign of the representation of Unicode > strings, which may well make this entire set of changes obsolete. > Are you serious? This sounds like

[issue10542] Py_UNICODE_NEXT and other macros for surrogates

2010-12-29 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Wed, Dec 29, 2010 at 9:38 PM, Alexander Belopolsky wrote: .. > Given that until recently (r87433) the PEP and the reference manual > disagreed on the definition, Actually, it looks like PEP 3131 and the Language Reference [1] still disagree

[issue6632] Include more fullwidth chars in the decimal codec

2010-12-30 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I wonder if the issues raised here can be neatly addressed by applying NFKC normalization before string to number conversion. This will convert full-width variants to ASCII and also eliminate digit/decimal differences. For example superscript and

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

2011-01-02 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Sun, Jan 2, 2011 at 10:52 AM, Georg Brandl wrote: .. > Well, then I would have no problem with checking for that condition > beforehand and raising > ValueError. > IIRC, there was a similar bug report about ctime where pre-condition

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

2011-01-02 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Sun, Jan 2, 2011 at 1:52 PM, Alexander Belopolsky wrote: .. >> Well, then I would have no problem with checking for that condition >> beforehand and raising >> ValueError. >> > > IIRC, there was a similar bug report a

[issue10807] `b'dGVzdA==\n'.decode('base64')` raise exception

2011-01-02 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- nosy: +belopolsky ___ Python tracker <http://bugs.python.org/issue10807> ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2011-01-02 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Sun, Jan 2, 2011 at 1:59 PM, Alexander Belopolsky wrote: .. > Hmm. My search brought up issue 10563, but the last message on that > issue says that "a change has been recently made to time.asctime() to > reject year > .  See r85

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

2011-01-02 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Committed in revision 87648. -- ___ Python tracker <http://bugs.python.org/issue8013> ___ ___ Python-bugs-list mailin

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

2011-01-02 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Sun, Jan 2, 2011 at 5:35 PM, Georg Brandl wrote: .. > Both asctime() and ctime() fixed to remove newline no matter how many > digits the year has in r87657.  I also took the liberty of making the error > messages consistent. Georg, I disa

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

2011-01-02 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Sun, Jan 2, 2011 at 6:01 PM, Georg Brandl wrote: .. > > Since all implementations we have or can test have a defined behavior in one > way or the other, > I think an example of an implementation that exhibits such undefined behavior &

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

2011-01-02 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Sun, Jan 2, 2011 at 6:10 PM, Georg Brandl wrote: .. > All right, then I wonder why your checktm() doesn't check the tm_year? It is not mine. I thought it did. I might have missed that when I reviewed the patch or there was a reason for tha

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

2011-01-02 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Sun, Jan 2, 2011 at 6:17 PM, Georg Brandl wrote: .. > (What I mean is that overwriting \n or not, the code is unsafe, so the check > must be > done beforehand.  Why should that be left to 3.3?) Reading beyond a buffer is somewhat safer tha

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

2011-01-02 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Sun, Jan 2, 2011 at 6:29 PM, Georg Brandl wrote: .. > You cannot have both: a safe implementation and the correct behavior with > glibc > (not Linux!) -- except if you start special-casing.  Not sure that's worth it. > That's t

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

2011-01-02 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: .. > My plan was to pick the low-hanging fruit (the null check) for 3.3 and s/3.3/3.2/ -- ___ Python tracker <http://bugs.python.org/iss

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

2011-01-02 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Sun, Jan 2, 2011 at 6:46 PM, Georg Brandl wrote: .. > I don't see the range checking as particularly challenging; I'm sure you can > get it done in time for 3.2. Will do. -- ___ Pytho

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

2011-01-02 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Backported in r87664 (2.6), r87663 (2.7) and r87662 (3.1). Reopening to implement bounds checking for 3.2. Note that for time.asctime, checking the year range is trivial, but for time.ctime it is not because year is not computed in python code. One

[issue10814] assertion failed on Windows buildbots

2011-01-03 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- assignee: -> belopolsky ___ Python tracker <http://bugs.python.org/issue10814> ___ ___ Python-bugs-list mailing list Un

[issue10814] assertion failed on Windows buildbots

2011-01-03 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Can someone with a windows box test >>> time.asctime((12345, 1, 1, 0, 0, 0, 0, 0, 0))? If that crashes as well, can you tell which part of ( ( tb->tm_mday >= 1 ) && ( ( ( _days[ tb->tm_mon + 1 ] - _days[ tb-&

[issue10814] assertion failed on Windows buildbots

2011-01-03 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Mon, Jan 3, 2011 at 11:26 AM, Brian Curtin wrote: .. >>PCbuild\amd64\python_d.exe > Python 3.2b2+ (py3k, Jan  3 2011, 10:24:18) [MSC v.1500 64 bit (AMD64)] on > win32 > Type "help", "copyright", "cr

[issue10814] assertion failed on Windows buildbots

2011-01-03 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Mon, Jan 3, 2011 at 11:43 AM, Brian Curtin wrote: .. > No crash on 0-day or 300,000. I bumped it up to 3,000,000 and got a > UnicodeDecodeError, although > I'm not sure of the relevance of that to this issue. It looks like we need an

[issue10814] assertion failed on Windows buildbots

2011-01-03 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I committed a a fix for the test in r87690. If this fixes the buildbot, I'll backport to 2.7 and call it a day for < 3.2. For 3.2 a proper year range check will be added to close issue 8013. -- __

[issue10814] assertion failed on Windows buildbots

2011-01-03 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Mon, Jan 3, 2011 at 12:30 PM, Amaury Forgeot d'Arc wrote: .. > Btw, I have a failed assertion in the test suite, with "time.ctime(1e12)" This is from r87657. I commented on that change in msg125117. Hopefully a range check wil

[issue10814] assertion failed on Windows buildbots

2011-01-03 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: The 3.1 buildbot is green: http://www.python.org/dev/buildbot/all/builders/x86%20XP-4%203.1/builds/1591 Committed 2.7 backport in r87692. -- ___ Python tracker <http://bugs.python.org/issue10

[issue10814] assertion failed on Windows buildbots

2011-01-03 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: 2.7 buildbot is green as well. Closing. http://www.python.org/dev/buildbot/all/builders/x86%20XP-4%202.7 -- resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed _

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

2011-01-03 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Attached patch, issue8013-pre-check.diff, checks for year range before calling system asctime and replaces a call to ctime with a asctime(localtime(..)). -- stage: needs patch -> commit review Added file: http://bugs.python.org/file20

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

2011-01-03 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Following Guido's response [1] to my inquiry on python-dev, I am attaching a new patch that makes time.asctime and time.ctime produce longer than 24-character strings for large years. [1] http://mail.python.org/pipermail/python-dev/2011-January/1

[issue10827] Functions in time module should support year < 1900 when accept2dyear = 0

2011-01-04 Thread Alexander Belopolsky
New submission from Alexander Belopolsky : """ > http://docs.python.org/library/time.html#time-y2kissues > "Values 100–1899 are always illegal." Why are these values illegal? The GNU libc accepts year in [1900-2^31; 2^31-1] (tm_year in [-2147483648; 2147481747]).

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

2011-01-04 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Committed in r87736. I opened a separate issue #10827 to address the lower bound. -- resolution: -> fixed stage: commit review -> committed/rejected status: open -> closed ___ Python track

[issue10827] Functions in time module should support year < 1900 when accept2dyear = 0

2011-01-04 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > The system libc would raise an error (return NULL) if it doesn't know > how to format years older than 1900. As experience with asctime has shown, system libc can do whatever it pleases with out of range values including overrunning a

[issue10827] Functions in time module should support year < 1900 when accept2dyear = 0

2011-01-04 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I am attaching a patch. While working on the patch, I noticed that although time.accept2dyear is documented as boolean, the current code expects int and treats any non-int including True as 0: >>> time.accept2dyear = True; time.asctime((99,)

[issue10827] Functions in time module should support year < 1900 when accept2dyear = 0

2011-01-04 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Tue, Jan 4, 2011 at 1:30 PM, Alexander Belopolsky wrote: .. > This is clearly a bug.  (Although Y2K note contradicts time.accept2dyear > documentation.) > PyObject_IsTrue() may fail - this is probably the reason for the current odd logic.

[issue10827] Functions in time module should support year < 1900 when accept2dyear = 0

2011-01-04 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Tue, Jan 4, 2011 at 1:49 PM, Georg Brandl wrote: .. > But if it fails, why not just let it fail? > Sure. That's what I meant by fixing the patch. See new patch attached. -- Added file: http://bugs.python.org/file20261/issue

[issue9738] Document the encoding of functions bytes arguments of the C API

2011-01-04 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Victor, Here is an interesting case for your collection: PyDict_GetItemString. Note that it is documented as not setting error, but in fact it may if encoding fails. This rarely an issue because most uses of PyDict_GetItemString are with an ASCII

[issue10827] Functions in time module should support year < 1900 when accept2dyear = 0

2011-01-05 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Attached patch, issue10827b.diff, fixes the accept2dyear = True issue and removes unnecessary struct_time to tuple conversion, but otherwise does not change the Y2K behavior. The code handling accept2dyear is refactored so that it is now easy to

[issue10812] Add some posix functions

2011-01-05 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: The patch contains a lot of repeated boilerplate code. I wonder if some of it can be factored out and reused. For example iov buffer allocation code appears to be identical in writev and readv. -- nosy: +belopolsky

[issue1777412] Python's strftime dislikes years before 1900

2011-01-05 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I would like to push this for 3.2. Recent discussions at issue10827 and on python-dev seem to favor removal of arbitrary limits on year range. -- nosy: +georg.brandl ___ Python tracker <h

[issue1777412] datetime.strftime dislikes years before 1900

2011-01-05 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- title: Python's strftime dislikes years before 1900 -> datetime.strftime dislikes years before 1900 ___ Python tracker <http://bugs.python.org/i

[issue9909] request for calendar.dayofyear() function

2011-01-06 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: This is yet another request for functionality that can be implemented as a simple expression using datetime arithmetics. Also, issue #9864 is not a compelling use case because "the parsedate() function now returns a datetime object." See

[issue10833] Replace %.100s by %s in PyErr_Format(): the arbitrary limit of 500 bytes is outdated

2011-01-06 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I agree with Eric. Limiting field width when formatting error messages is a good safety measure. It is not only the amount of garbage that can be spitted in error logs, if garbage is not null-terminated, you may get a SEGV instead of a somewhat

[issue10833] Replace %.100s by %s in PyErr_Format(): the arbitrary limit of 500 bytes is outdated

2011-01-06 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > /* Caller is responsible for limiting the format */ Note that it is a good idea to avoid memory allocation during exception processing. Think of out of memory errors: how would you report those if you need more memory to format the error mess

[issue3173] external strftime for Python?

2011-01-06 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Maybe rather than spending the effort maintaining a legacy API such as strftime, someone could look into implementing localized date formatting as defined by recent Unicode standards: http://unicode.org/reports/tr35/#Date_Format_Patterns Apparently

[issue3173] external strftime for Python?

2011-01-06 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Thu, Jan 6, 2011 at 2:56 PM, Eric Smith wrote: .. > If we're going to take this on (re-writing strftime), I think the way to do > it is to have it take the locale info as a > parameter, and if that parameter is NULL then look up t

[issue10833] Replace %.100s by %s in PyErr_Format(): the arbitrary limit of 500 bytes is outdated

2011-01-06 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Thu, Jan 6, 2011 at 3:49 PM, STINNER Victor wrote: .. > eric> I always thought that one of the reasons for specifying the length > eric> was in case a pointer pointed to garbage: at least you'd be limiting > eric> how much tr

[issue10849] Backport test/__main__

2011-01-06 Thread Alexander Belopolsky
New submission from Alexander Belopolsky : It is much easier to remember and to type -m test instead of -m test.regrtest, but the usefulness of this feature is limited by the fact that it only works with the latest version. Since this does not require any user-visible changes, I think it

[issue10849] Backport test/__main__

2011-01-06 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- nosy: +michael.foord ___ Python tracker <http://bugs.python.org/issue10849> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue10849] Backport test/__main__

2011-01-06 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > -0 we don't backport new features New tests are routinely backported when they accompany bug fixes, so new features under Lib/test are probably a fair game. Given that this feature is implemented entirely in a file that is not used for a

[issue10827] Functions in time module should support year < 1900 when accept2dyear = 0

2011-01-06 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Attached patch, issue10827c.diff, implements the following logic in gettmarg: /* If year is specified with less that 4 digits, its interpretation

[issue10827] Functions in time module should support year < 1900 when accept2dyear = 0

2011-01-06 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : Added file: http://bugs.python.org/file20295/issue10827c.diff ___ Python tracker <http://bugs.python.org/issue10827> ___ ___ Python-bug

[issue1559549] ImportError needs attributes for module and file name

2011-01-07 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > I think we should investigate deeper why this enhancement > request didn't get into Python 3. There is nothing to investigate here. This is a request for a marginal improvement and OP did not follow up even though a core developer respon

[issue10827] Functions in time module should support year < 1900 when accept2dyear = 0

2011-01-07 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Committed in 87829. I added a year >= 1900 check in time.strftime for now because removing or relaxing this limit should be done in coordination with similar datetime module issue. See #1777412. See also python-dev discussion starting at h

[issue10827] Functions in time module should support year < 1900 when accept2dyear = 0

2011-01-07 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Commit link: r87829 -- status: open -> closed ___ Python tracker <http://bugs.python.org/issue10827> ___ ___ Python-

[issue10858] Make source code links less prominent

2011-01-07 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: As Raymond explained, he added these links as a kind of social experiment and this issue itself shows that it works. :-) I have a few suggestions on how to make these links more useful: 1. A ViewVC link is the simplest solution to present the source

[issue10858] Make source code links less prominent

2011-01-07 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Fri, Jan 7, 2011 at 4:32 PM, Éric Araujo wrote: .. > 3: Not all modules are good examples (see threading for some unelegant code), > so I support ad-hoc selection. The problem with ad-hoc selection is that it adds maintenance burden (someone

[issue1777412] datetime.strftime dislikes years before 1900

2011-01-07 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: After r87829 (see issue10827), the insane Y2K behavior of time module functions does not extend beyond year 999. Hopefully in Python 3.3, accept2dyear will be removed completely and datetime.strftime() will be able to support the full intersection of

[issue1777412] datetime.strftime dislikes years before 1900

2011-01-07 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Fri, Jan 7, 2011 at 7:26 PM, STINNER Victor wrote: .. > Here is a patch removing the arbitrary datetime.strftime() limit on year: it > adds an > option "accept2dyear" to time.strftime() and datetime just sets this option > to

[issue1777412] datetime.strftime dislikes years before 1900

2011-01-07 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: -- --Guido van Rossum (python.org/~guido) """ -- http://mail.python.org/pipermail/python-dev/2011-January/107246.html ^^^ the last lines of msg125738 cut by roundup ^^^ -- ___ Python

[issue1777412] datetime.strftime dislikes years before 1900

2011-01-07 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I like strftime_1_.patch, but it really belongs to #10827. Please leave a note there once you commit and mention the issue in commit log. -- ___ Python tracker <http://bugs.python.org/issue1777

[issue1475397] time.asctime_tz, time.strftime %z %C

2011-01-07 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- resolution: -> rejected stage: unit test needed -> committed/rejected status: open -> pending superseder: -> Add aware local time support to datetime module ___ Python tracker <http://

[issue10225] Fix doctest runable examples in python manual

2011-01-10 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Sun, Jan 9, 2011 at 3:52 PM, Terry J. Reedy wrote: > .. It would be nice to get the fixes into 3.2. Yes, it would be nice, but I don't have a 3.2 patch (yet). As you can see from my last comment, I ran into a bug in the alpha version of sph

[issue2568] Seconds range in time unit

2011-01-10 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: The C89 draft as available through a Wikipedia link, http://flash-gordon.me.uk/ansi.c.txt, specifies tm_sec range as [0, 60]. Although it looks like the range has been extended in the published version. A discussion on comp.std.c describes the

[issue2568] Seconds range in time unit

2011-01-10 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Committed in revision 87910. -- resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed ___ Python tracker <http://bugs.python.o

[issue5979] strptime() gives inconsistent exceptions

2011-01-10 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- stage: unit test needed -> needs patch versions: +Python 3.3 -Python 3.2 ___ Python tracker <http://bugs.python.org/iss

[issue1667546] Time zone-capable variant of time.localtime

2011-01-10 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I am going to close this as superseded by #9527. In order to properly implement #9527 in datetime.py, some kind of tm_gmtoff support will need to be added to the time module, but I don't want this to become a feature that is exclusively available

[issue8915] Use locale.nl_langinfo in _strptime

2011-01-10 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I would also like to consider using OS strptime on platforms with a decent implementation. -- stage: -> needs patch type: -> feature request versions: +Python 3.3 -Python 3.2 ___ Python tracker

[issue7739] time.strftime may hung while trying to open /etc/localtime but does not release GIL

2011-01-10 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: -1 on releasing the GIL around strftime(). Until we have an implementation that can support multiple locales and multiple timezones, people will work around this limitation by messing up with the TZ environment variable or global locale settings

[issue8957] strptime('%c', ..) fails to parse output of strftime('%c', ..) in non-English locale

2011-01-10 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Adding #8915 as a dependency because deducing D_T_FMT locale setting from strftime output seems impossible: >>> locale.nl_langinfo(locale.D_T_FMT) '%a %b %e %H:%M:%S %Y' -- dependencies: +Use locale.nl_langinfo in _strptim

[issue8957] strptime('%c', ..) fails to parse output of strftime('%c', ..) in non-English locale

2011-01-10 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Victor, You may be interested because your native language is implicated. :-) -- nosy: +haypo ___ Python tracker <http://bugs.python.org/issue8

[issue1726687] Bug found in datetime for Epoch time = -1

2011-01-10 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Committed in revision 87919. If bots are happy about the unit test, this should be backported to 3.1 and 2.7. -- resolution: -> fixed stage: unit test needed -> committed/rejected ___ Python tracker

[issue2267] datetime.datetime operator methods are not subclass-friendly

2011-01-10 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Note that before r82065, python prototype, now available as Lib/datetime.py had binary operations implemented to return subclass instances. Here is annotated pre-r82065 code: 39876 gvanrossum def __add__(self, other): 39876 gvanrossum

[issue9034] datetime module should use int32_t for date/time components

2011-01-10 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- versions: +Python 3.3 -Python 3.2 ___ Python tracker <http://bugs.python.org/issue9034> ___ ___ Python-bugs-list mailin

[issue9004] datetime.utctimetuple() should not set tm_isdst flag to 0

2011-01-10 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- versions: +Python 3.3 -Python 3.2 ___ Python tracker <http://bugs.python.org/issue9004> ___ ___ Python-bugs-list mailin

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

2011-01-10 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I am going to reject this. None of the proposed changes seem to be better than the current documentation. The time.daylight variable has the same meaning as eponymous C variable defined in time.h header. The latter is described in widely available

[issue1667546] Time zone-capable variant of time.localtime

2011-01-11 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Tue, Jan 11, 2011 at 5:06 AM, anatoly techtonik wrote: .. > IIUC #9527 is about datetime and this request is about time.localtime, This is correct, but did you notice what I wrote in my last message? """ In order to properly

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

2011-01-11 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Tue, Jan 11, 2011 at 4:55 AM, anatoly techtonik wrote: .. > I propose the following change: .. > http://docs.python.org/library/time.html#time.daylight > -  Nonzero if a DST timezone is defined. > + .. To check if DST is currently

[issue9051] Improve pickle format for aware datetime instances

2011-01-11 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- versions: +Python 3.3 -Python 3.2 ___ Python tracker <http://bugs.python.org/issue9051> ___ ___ Python-bugs-list mailin

[issue9118] help() on a property descriptor launches interactive help

2011-01-11 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Backported to 3.1 (r87934) and 2.7 (r87935). -- resolution: accepted -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/

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

2011-01-11 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: New patch needed to address the issue of time.strftime() accepting %Y when year is 1900 and other similar oddities. See msg107402 above. Also a patch for datetime.py is needed. -- stage: patch review -> needs patch versions: +Python

<    4   5   6   7   8   9   10   11   12   13   >