[issue11303] b'x'.decode('latin1') is much slower than b'x'.decode('latin-1')

2011-02-24 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Thu, Feb 24, 2011 at 10:30 AM, Ezio Melotti wrote: .. > See also discussion on #5902. Mark has closed #5902 and indeed the discussion of how to efficiently normalize encoding names (without changing what is accepted) is beyond the scope of that

[issue11303] b'x'.decode('latin1') is much slower than b'x'.decode('latin-1')

2011-02-24 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Thu, Feb 24, 2011 at 11:01 AM, Marc-Andre Lemburg wrote: .. > On this ticker, we're discussing just one application area: that > of the builtin short cuts. > Fair enough. I was hoping to close this ticket by simply committing the posted

[issue11303] b'x'.decode('latin1') is much slower than b'x'.decode('latin-1')

2011-02-24 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Thu, Feb 24, 2011 at 11:31 AM, Marc-Andre Lemburg wrote: .. > I think rather than removing any hyphens, spaces, etc. the > function should additionally: > >  * add hyphens whenever (they are missing and) there's switch >   from [a

[issue11303] b'x'.decode('latin1') is much slower than b'x'.decode('latin-1')

2011-02-24 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Thu, Feb 24, 2011 at 11:39 AM, Marc-Andre Lemburg wrote: > > Marc-Andre Lemburg added the comment: .. > That won't work, Victor, since it makes invalid encoding > names valid, e.g. 'utf(=)-8'. > .. but this *is* valid:

[issue11303] b'x'.decode('latin1') is much slower than b'x'.decode('latin-1')

2011-02-24 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: >>> 'abc'.encode('utf(=)-8') b'abc' -- ___ Python tracker <http://bugs.python.org/issue11303> ___ ___

[issue11286] Some "trivial" python 2.x pickles fails to load in Python 3.2

2011-02-24 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Committed in r88546 (3.3) and r88548 (3.2). Note that a simple work-around before 3.2.1 is to spell encoding as 'latin-1' or 'iso-8859-1' in pickle.loads(). -- components: +Extension Modules -Library (Lib) resolution: -&

[issue11286] Some "trivial" python 2.x pickles fails to load in Python 3.2

2011-02-24 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Thu, Feb 24, 2011 at 3:54 PM, Antoine Pitrou wrote: .. > I've committed the part of the patch which disallows a NULL data pointer > with PyMemoryView_FromBuffer in r88550 and r88551. Is it possible to create such buffer in Python (ot

[issue11303] b'x'.decode('latin1') is much slower than b'x'.decode('latin-1')

2011-02-24 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: +char lower[strlen(encoding)*2]; Is this valid in C-89? -- ___ Python tracker <http://bugs.python.org/issue11

[issue11286] Some "trivial" python 2.x pickles fails to load in Python 3.2

2011-02-24 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: It seems appropriate to consult python-dev on this. I thought ValueError was for values that are valid Python objects but out of acceptable range of the function. Errors that can only be triggered in C code normally handled with either assert() or raise

[issue11313] Speed up default encode()/decode()

2011-02-24 Thread Alexander Belopolsky
New submission from Alexander Belopolsky : In Python 3.x default encoding is always utf-8, but encode()/decode() still try to look it up. Attached patch eliminates a call to normalize_encoding and several strcmp() calls. -- files: default-encode.diff keywords: patch messages: 129318

[issue11313] Speed up default encode()/decode()

2011-02-24 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Thanks for the review and the tests. I have found one more place that can be easily optimized. (See patch below.) The decode() methods in bytes and bytearray are not so easy unfortunately because for some reason they are written to accept any object

[issue11313] Speed up default encode()/decode()

2011-02-24 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Committed issue11313.diff in revision 88553. On the second thought, the getargs optimization is not worth the trouble because in existing sources 'e' code is used with constant encodings and one is unlikely to pass NULL as an encoding becau

[issue11315] Cookie.py breaks when passed unicode, fix included

2011-02-24 Thread Alexander Tsepkov
New submission from Alexander Tsepkov : in Lib/Cookie.py, BaseCookie load() method performs the following comparison on line 624: str(rawdata) == str("") This breaks when a unicode string is passed in for rawdata. I've included a patch that fixes this issue by using isi

[issue11322] encoding package's normalize_encoding() function is too slow

2011-02-25 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I don't think the normalize_encoding() function was the culprit for issue11303 because I measured timings with timeit which averages multiple runs while normalize_encoding() is called only the one time per encoding spelling due to ca

[issue11303] b'x'.decode('latin1') is much slower than b'x'.decode('latin-1')

2011-02-25 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Committed issue11303.diff and doc change in revision 88602. I think the remaining ideas are best addressed in issue11322. > Given that we are starting to have a whole set of such aliases > in the C code, I wonder whether it would be better to ma

[issue11303] b'x'.decode('latin1') is much slower than b'x'.decode('latin-1')

2011-02-25 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Fri, Feb 25, 2011 at 8:29 PM, Antoine Pitrou wrote: .. >> For other spellings like "utf8" or "latin1", I wonder if it would be >> useful to emit a warning/suggestion to use the standard spelling. > > No, it woul

[issue11303] b'x'.decode('latin1') is much slower than b'x'.decode('latin-1')

2011-02-25 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Fri, Feb 25, 2011 at 8:39 PM, Ezio Melotti wrote: .. > It would prefer to see the note added by Alexander in the doc mention *only* > the preferred spellings > (i.e. 'utf-8' and 'iso-8859-1') rather than all the

[issue9769] PyUnicode_FromFormatV() doesn't handle non-ascii text correctly

2011-03-01 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- assignee: -> belopolsky resolution: fixed -> type: -> feature request versions: +Python 3.3 -Python 3.2 ___ Python tracker <http://bugs.python.o

[issue9769] PyUnicode_FromFormatV() doesn't handle non-ascii text correctly

2011-03-01 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- priority: normal -> low ___ Python tracker <http://bugs.python.org/issue9769> ___ ___ Python-bugs-list mailing list Un

[issue1706039] Added clearerr() to clear EOF state

2011-03-11 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Wed, Mar 9, 2011 at 2:32 AM, Scott Dial wrote: .. > By rejecting unittests on the merits of its coding style, you are creating a > double-standard for people like > me (outside of the core committers), which eventually wears out my inter

[issue11457] Expose nanosecond precision from system calls

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

[issue11457] Expose nanosecond precision from system calls

2011-03-11 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: See also issue10812 which implements os.futimens(). -- ___ Python tracker <http://bugs.python.org/issue11457> ___ ___

[issue11462] Peephole creates duplicate and unused constants

2011-03-11 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Eugene, how does your optimization differ from the one proposed in issue2493? -- nosy: +belopolsky ___ Python tracker <http://bugs.python.org/issue11

[issue11489] json.dumps not parsable by json.loads (on Linux only)

2011-03-14 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > It appears this is an invalid unicode character. > Shouldn't this be caught by decode("utf8") It should and it is in Python 3.x: >>> b'\xed\xa8\x80'.decode("utf8") Traceback (most recent call last)

[issue11564] pickle not 64-bit ready

2011-03-16 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Tue, Mar 15, 2011 at 7:05 PM, Antoine Pitrou wrote: .. > - (bugfix) raise a proper exception when an object too large for handling by > pickle is given What would be the "proper exception" here? With _pickle acceleration d

[issue9384] Tkinter windows pop under the terminal in OSX

2011-03-16 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Wed, Mar 16, 2011 at 10:18 AM, Ronald Oussoren wrote: .. > This is not a bug in python, but is generic platform behavior (as Ned noted). Maybe not a bug in tkinter proper, but certainly an unexpected behavior when running tkinter demo scripts or

[issue11571] Turtle window pops under the terminal on OSX

2011-03-16 Thread Alexander Belopolsky
New submission from Alexander Belopolsky : If you have a large enough terminal window and run $ python -m turtle on OSX, you will see nothing because turtle screen pops under the terminal. Ned Deily suggested in msg130421 that this can be fixed by setting "-topmost" WM attribute o

[issue11571] Turtle window pops under the terminal on OSX

2011-03-16 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- dependencies: +Tkinter windows pop under the terminal in OSX ___ Python tracker <http://bugs.python.org/issue11571> ___ ___

[issue9384] Tkinter windows pop under the terminal in OSX

2011-03-16 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- superseder: -> Turtle window pops under the terminal on OSX ___ Python tracker <http://bugs.python.org/issue9384> ___ _

[issue9384] Tkinter windows pop under the terminal in OSX

2011-03-16 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Wed, Mar 16, 2011 at 10:42 AM, Ronald Oussoren wrote: > It is definitely something that will have to be determined for every case >separately > and is not something that should be worked around in Tkinter itself. I agree, but I don'

[issue11571] Turtle window pops under the terminal on OSX

2011-03-16 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Wed, Mar 16, 2011 at 11:26 AM, Ronald Oussoren wrote: .. > The attached patch forces the window to the front by first making the window > a topmost window and then resetting that flag. > > Could you test if this does want you'd like

[issue11572] bring Lib/copy.py to 100% coverage

2011-03-16 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > A bug in "coverage" results in its only reporting 99% at the moment It was concluded during discussion of issue2506 that this is not a bug. At least not a bug in "coverage" or the trace module. At most this is a peephole

[issue11564] pickle not 64-bit ready

2011-03-16 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Wed, Mar 16, 2011 at 6:59 PM, Antoine Pitrou wrote: .. >> >> What would be the "proper exception" here? > > OverflowError. This is the exception that gets raised when some > user-supplied value exceeds some in

[issue11572] bring Lib/copy.py to 100% coverage

2011-03-17 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Thu, Mar 17, 2011 at 8:03 PM, Antoine Pitrou wrote: .. > +1 for not having pragma statements in the stdlib, especially when they > target a third-party tool few of us know and use. "#pragma NO COVER" is recognized by stdlib trace

[issue11594] 2to3 tool does not preserve line-endings

2011-03-18 Thread Alexander Belchenko
New submission from Alexander Belchenko : I'm using LF-only line-endings for development of my IntelHex library. I'm working on Windows most of the time. After 2to3 tool has been ran on my library it has not only changed the Python syntax, but it also saved all files with CRLF li

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

2011-03-21 Thread Alexander Dreyer
Alexander Dreyer added the comment: If a another solution via virtualenv could do it, I'd prefer that, too. -- ___ Python tracker <http://bugs.python.org/i

[issue11594] 2to3 tool does not preserve line-endings

2011-03-21 Thread Alexander Belchenko
Alexander Belchenko added the comment: @Éric Araujo: I've ran tests with python 3.2. All tests have passed: -- Ran 540 tests in 37.688s OK -- ___ Python tracker

[issue11594] 2to3 does not preserve line endings

2011-03-21 Thread Alexander Belchenko
Alexander Belchenko added the comment: Éric, thank you for the proposal, but I'm not familiar enough with the codebase to work on it. The short scan over the tests reveals that there is at least one test which tries to test CRLF behavior, in the file test_refactor.py, but I

[issue10291] Clean-up turtledemo in-package documentation

2011-03-22 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Tue, Mar 22, 2011 at 2:55 PM, Éric Araujo wrote: .. > Agreed.  Which .py files would be appropriate? Lib/turtledemo/about_turtle.txt - seems to belong to turtle.py Lib/turtledemo/about_turtledemo.txt -> turtledemo/__init__.py and Lib/turt

[issue10291] Clean-up turtledemo in-package documentation

2011-03-22 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Tue, Mar 22, 2011 at 3:14 PM, Alexander Belopolsky wrote: .. > Lib/turtledemo/about_turtle.txt - seems to belong to turtle.py In fact, it looks like turtle docstring is already a copy (or almost a copy) of Lib/turtledemo/about_turtle.txt. Inst

[issue10291] Clean-up turtledemo in-package documentation

2011-03-22 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- type: -> feature request versions: +Python 3.3 -Python 3.2 ___ Python tracker <http://bugs.python.org/issue10291> ___ _

[issue10291] Clean-up turtledemo in-package documentation

2011-03-22 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- keywords: +patch Added file: http://bugs.python.org/file21340/issue10291.diff ___ Python tracker <http://bugs.python.org/issue10

[issue10291] Clean-up turtledemo in-package documentation

2011-03-22 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Tue, Mar 22, 2011 at 5:15 PM, Éric Araujo wrote: >.. > The patch contains one unrelated code change. > Yes, I noticed that, but it may not be that unrelated. Of course the two changes need to be committed separately, but the pop-un

[issue10291] Clean-up turtledemo in-package documentation

2011-03-22 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Tue, Mar 22, 2011 at 5:29 PM, Éric Araujo wrote: .. >> I would rather keep code and documentation changes separate. > I don’t follow; my comment about bad phrasing was about the text added to the > docstrings. The text added to docstring

[issue10225] Fix doctest runable examples in python manual

2011-03-24 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > Please leave the deployed code for named tuple as-is. Doctest may > have issues with trailing whitespace, but that is doctest's problem, > not named tuple's. I am curious, what was the reason to add trailing whitespace in the na

[issue9344] please add posix.getgrouplist()

2011-03-24 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Looks good to me as well. Just a nit-pick: in python code base "sizeof" is not separated from the opening parenthesis. I understand the desire to distinguish "sizeof" from a function, but it is probably better to be consistent.

[issue9909] request for calendar.dayofyear() function

2011-03-24 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- status: pending -> closed ___ Python tracker <http://bugs.python.org/issue9909> ___ ___ Python-bugs-list mailing list Un

[issue6498] Py_Main() does not return on SystemExit

2011-03-29 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: The SystemExit vs. SystemError is clearly a typo in the doc. The VC comment accompanying the addition of that note says "note that Py_Main doesnt return on SystemExit." See [e5d8f0c0d634] and #5227. -- nosy: +

[issue6498] Py_Main() does not return on SystemExit

2011-03-29 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: The updated doc patch is missing :exc: markup on one of "SystemExit"s. -- ___ Python tracker <http://bugs.python.

[issue2736] datetime needs an "epoch" method

2011-03-31 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Thu, Mar 31, 2011 at 2:52 PM, Ka-Ping Yee wrote: .. > I am extremely disappointed by what has happened here. > What exactly are you disappointed about? As far as I can tell, the feature request has not been rejected, just no one has come up

[issue2736] datetime needs an "epoch" method

2011-04-04 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Mon, Apr 4, 2011 at 5:42 PM, Jay Taylor wrote: .. > I couldn't agree more with ping's position on this. Adding votes to a tracker issue without a working patch will not move it any further. There are several committers besides me in

[issue2736] datetime needs an "epoch" method

2011-04-05 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Tue, Apr 5, 2011 at 4:33 AM, Marc-Andre Lemburg wrote: .. > mxDateTime, which in large parts inspired the Python datetime module, > has had a .ticks() method (for local time) and a .gmticks() method > (for UTC) for more than a decade

[issue2736] datetime needs an "epoch" method

2011-04-05 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: MAL> Since most of the datetime module was inspired by mxDateTime, MAL> I wonder why [ticks()/gmticks()] were left out. (msg75411) """ The datetime module intended to be an island of relative sanity. Because the range of dates "

[issue11576] timedelta subtraction glitch on big timedelta values

2011-04-05 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > What happens is the second value is negated (__neg__) > which causes it to become less than timedelta.min and > that is causing OverflowError. Yes, and running the test case without C acceleration makes this obvious: >>> import s

[issue2736] datetime needs an "epoch" method

2011-04-05 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Let me state my position on this issue once again. Converting datetime values to float is easy. If your dt is a naive instance representing UTC time: timestamp = (dt - datetime(1970, 1, 1)) / timedelta(seconds=1) If your dt is an aware instance

[issue2736] datetime needs an "epoch" method

2011-04-05 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Tue, Apr 5, 2011 at 1:45 PM, Marc-Andre Lemburg wrote: .. > BTW: A "timestamp" usually refers to the combination of date and > time. The time.time() return value is "seconds since the Epoch". > I usually call those val

[issue11576] timedelta subtraction glitch on big timedelta values

2011-04-05 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- components: +Extension Modules resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed versions: -Python 2.5, Python 2.6, Python 3.1 ___ Python tracker <http://bug

[issue11795] Better core dev guidelines for committing submitted patches

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

[issue11734] Add half-float (16-bit) support to struct module

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

[issue11571] Turtle window pops under the terminal on OSX

2011-04-07 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: While you are at it, can you also fix the same issue with "python -m tkinter"? -- ___ Python tracker <http://bugs.python.o

[issue11571] Turtle window pops under the terminal on OSX

2011-04-07 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: .. and "python -m turtledemo"? -- ___ Python tracker <http://bugs.python.org/issue11571> ___ ___ Python-bugs-l

[issue2736] datetime needs an "epoch" method

2011-04-07 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Thu, Apr 7, 2011 at 6:20 AM, Velko Ivanov wrote: .. >> Converting datetime values to float is easy.   If your dt is a naive >> instance representing UTC time: >> >>     timestamp = (dt - datetime(1970, 1, 1)) / timedelta(

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

2011-04-07 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- dependencies: -Add aware local time support to datetime module status: pending -> closed ___ Python tracker <http://bugs.python.org/issue1

[issue11791] python -m doctest has a -v flag that it ignores

2011-04-07 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Why do you say "doctest doesn't use a -v option"? Compare $ python -m doctest Lib/doctest.py and $ python -m doctest -v Lib/doctest.py Trying: runner = DebugRunner(verbose=False) Expecting nothing ok ... 66 tests in 112 items.

[issue10427] 24:00 Hour in DateTime

2011-04-07 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Is there still interest in pursuing this? Normalizing out of bounds arguments to datetime constructor is easy, but rather pointless. It is trivial to implement this functionality using existing timedelta constructor: def normdatetime(Y, M, D, h, m

[issue5907] repr of time.struct_time type does not eval

2011-04-08 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > Or whether to change it at all. It's hard to imagine that > applications may rely on that aspect of the behavior - they > have to use eval, after all. I would like to see this fixed. When working in interactive session, I find myself

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2011-04-08 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Hasn't this been fixed in the following changeset? changeset: 43509:384f73a104e9 user:Benjamin Peterson date:Wed Jul 07 20:54:01 2010 + summary: make struct sequences subclass tuple; kill lots of code --

[issue11816] Refactor the dis module to provide better building blocks for bytecode analysis

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

[issue11822] Improve disassembly to show embedded code objects

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

[issue11822] Improve disassembly to show embedded code objects

2011-04-11 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Would you like to display lambdas as well? >>> dis('lambda x: x**2') 1 0 LOAD_CONST 0 ( at 0x1005c9ad0, file "", line 1>) 3 MAKE_FUNCTION0 6 RETURN

[issue11823] disassembly needs to argument counts on calls with keyword args

2011-04-11 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I am posting an unfinished patch (needs additional tests and possibly documentation) to get feedback on whether it would make sense to wait for issue11816 refactoring before implementing this. Note the code duplication between disassemble and

[issue11822] Improve disassembly to show embedded code objects

2011-04-11 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Mon, Apr 11, 2011 at 5:21 PM, Antoine Pitrou wrote: .. Raymond>> If you disassemble a function, you typically want to see all the code Raymond>> [defined] in that function. +1 (with clarification in []) If the function calls a func

[issue11830] "import decimal" fails in Turkish locale

2011-04-12 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Shouldn't this be forward ported to 3.3? Even though there is no bug in 3.x, code using an explicit dict is cleaner and more robust than the current code that relies on introspection to find methods that start with '_round_'.

[issue11830] "import decimal" fails in Turkish locale

2011-04-12 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- stage: -> committed/rejected type: -> behavior versions: +Python 3.2, Python 3.3 ___ Python tracker <http://bugs.python.org/i

[issue11850] mktime - OverflowError: mktime argument out of range - on very specific time

2011-04-15 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Isn't this a duplicate of issue1726687? > -- nosy: +Alexander.Belopolsky title: mktime - OverflowError: mktime argument out of range - on very specific time -> mktime - OverflowError: mktime argument out of range - on very sp

[issue11850] mktime - OverflowError: mktime argument out of range - on very specific time

2011-04-15 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: If we can rely on the "versions" field, OP is using python 2.6. I don't think this can be classified as a security issue, so it won't be appropriate to backport issue1726687 to 2.6. -- assignee: -> belopolsky compone

[issue11844] Update json to upstream simplejson latest release

2011-04-15 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I am not sure anyone other that Bob Ippolito can contribute later versions of simplejson (or patches derived from those versions) to python. ISTM that simplejson distribution is covered by MIT license [1] which is not one of the valid "initial lic

[issue11844] Update json to upstream simplejson latest release

2011-04-15 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Fri, Apr 15, 2011 at 12:17 PM, Bob Ippolito wrote: .. > That's not a problem, I'm more than happy to give permission for any patch. > If it's easier I can consider dual-licensing in the simplejson source. Can someone who can spea

[issue10665] Expand unicodedata module documentation

2011-04-15 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > The "PDF generator" is PDFLaTeX, whose range of Unicode characters > is very limited, so no, I can't fix it. My search for pdflatex and unicode has quickly revealed this 4-year old howto: http://tclab.kaist.ac.kr/ipe/pdftex_2.

[issue10665] Expand unicodedata module documentation

2011-04-15 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Fri, Apr 15, 2011 at 1:10 PM, Marc-Andre Lemburg wrote: >.. > Why don't you use the standard literal escapes for the examples > and annotate the code points with the code point names ? A am neutral on how to enter unicode characters

[issue10665] Expand unicodedata module documentation

2011-04-15 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Fri, Apr 15, 2011 at 1:23 PM, Marc-Andre Lemburg wrote: >.. > Why not wrap the calls with a repr() ? > Won't help: "'Ӝ'" I think you meant ascii(), but that's ugly IMO: "'\\u04dc'" M

[issue11851] Flushing the standard input causes an error

2011-04-15 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I get the same: $ python2.7 Python 2.7.1 (r271:86882M, Nov 30 2010, 10:35:34) [GCC 4.2.1 (Apple Inc. build 5664)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>>

[issue11851] Flushing the standard input causes an error

2011-04-15 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: In python 2.x, sys.stdin.flush() is more or less equivalent to C fflush(stdin). The behavior of fflush() on streams that are open for reading only is undefined. [1] Python 3.x io does not use C stdio library and therefore it is not surprising that

[issue10042] total_ordering stack overflow

2011-04-18 Thread Alexander Boyd
Alexander Boyd added the comment: This is not fixed. The accepted fix doesn't take NotImplemented into account, with the result that comparing two mutually-incomparable objects whose ordering operations were generated with total_ordering causes a stack overflow instead of the exp

[issue10042] total_ordering stack overflow

2011-04-18 Thread Alexander Boyd
Alexander Boyd added the comment: But it seems pointless to force someone to implement all of the rich comparison methods when they may want to do something as simple as this: class Foo: ... def __lt__(self, other): if not isinstance(other, Foo): return

[issue10042] total_ordering

2011-04-18 Thread Alexander Boyd
Alexander Boyd added the comment: Ok. I did write that against Python 2, so I wasn't aware of __eq__ and __ne__. I'll keep that in mind. I am curious, however, as to how this could break existing code. It seems like code that relies on a stack overflow is already broke

[issue10042] total_ordering

2011-04-19 Thread Alexander Boyd
Alexander Boyd added the comment: I've attached a file demonstrating the stack overflow. It assumes total_ordering has been defined as per new_total_ordering.py. -- Added file: http://bugs.python.org/file21712/new_total_ordering_overfl

[issue10042] total_ordering

2011-04-19 Thread Alexander Boyd
Alexander Boyd added the comment: That's my point. My version, sane_total_ordering.py, fixes this by using traditional functions and explicit NotImplemented checks. -- ___ Python tracker <http://bugs.python.org/is

[issue10042] total_ordering

2011-04-19 Thread Alexander Boyd
Alexander Boyd added the comment: Ok. Yeah, I won't argue that it's pretty :-) -- ___ Python tracker <http://bugs.python.org/issue10042> ___ ___

[issue11886] test_time.test_tzset() fails on "x86 FreeBSD 7.2 3.x": AEST timezone called "EST"

2011-04-20 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Wed, Apr 20, 2011 at 9:53 AM, STINNER Victor wrote: .. > test_time.test_tzset() fails on "x86 FreeBSD 7.2 3.x": > 'AEST-10AEDT-11,M10.5.0,M3.5.0' timezone becomes 'EST'. I was able to reproduce this error by

[issue2736] datetime needs an "epoch" method

2011-04-25 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- components: +Documentation -Library (Lib) resolution: -> fixed stage: test needed -> committed/rejected status: open -> closed ___ Python tracker <http://bugs.python.o

[issue9614] _pickle is not entirely 64-bit safe

2011-04-26 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: See also issue 10640. -- nosy: +belopolsky ___ Python tracker <http://bugs.python.org/issue9614> ___ ___ Python-bug

[issue11929] Improve usage of PEP8 in Docs/includes/*

2011-04-26 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Another -1 from me. Similar changes to inline examples in the docs have been rejected in the past for the same reasons as Raymond wrote. See issue 4649. -- nosy: +belopolsky ___ Python tracker <h

[issue11929] Improve usage of PEP8 in Docs/includes/*

2011-04-26 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On the other hand, I would be +0 for the tzinfo-examples fixes of the form: foo(x=default) vs. foo(x = default) (This was also the fix suggested on the ML.) Overall, I think it is good to judicially point out to PEP 8 violations where fixes would

[issue11930] Remove time.accept2dyear

2011-04-26 Thread Alexander Belopolsky
New submission from Alexander Belopolsky : As implemented in issue 10827, use of 2-digits years in timetuples to mean 4-digit years straddling year 2000 is deprecated in 3.3. There is no mechanism for issuing deprecation warning for access to a module variable, but a deprecation note was

[issue9614] _pickle is not entirely 64-bit safe

2011-04-26 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > The warnings at lines 284, 301, 461, 647 are benign. I agree. There is no loss of data because Py_ssize_t variable bounds are checked before these lines are reached. > The attached patch fixes them. I don't like these changes: -Pda

[issue11930] Remove time.accept2dyear

2011-04-26 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Tue, Apr 26, 2011 at 6:09 PM, STINNER Victor wrote: > It looks like struct_time note is wrong: the year 70 is now 70 and not > interpreted as 1970 anymore. What makes you say so? 1970 -- ___

[issue11930] Remove time.accept2dyear

2011-04-26 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Tue, Apr 26, 2011 at 6:09 PM, STINNER Victor wrote: .. > > timemodule.c: > > PyDoc_STRVAR(module_doc, > "... > The tuple items are:\n\ >  year (four digits, e.g. 1998)\n\ > ...") > > => That's wrong.

[issue11930] Remove time.accept2dyear

2011-04-26 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Tue, Apr 26, 2011 at 6:30 PM, STINNER Victor wrote: > > STINNER Victor added the comment: > > "What makes you say so? > > 1970" > > Don't write ">>> " using the email interface :-) >

[issue11930] Remove time.accept2dyear

2011-04-26 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Tue, Apr 26, 2011 at 6:09 PM, STINNER Victor wrote: .. > .. class:: struct_time (...) A year value will be handled as described under > :ref:`Year 2000 (Y2K) issues ` above. This one needs to be removed.

<    1   2   3   4   5   6   7   8   9   10   >