[issue1222] locale.format bug if thousand separator is space (french separator as example)

2008-11-14 Thread Walter Doekes
Walter Doekes [EMAIL PROTECTED] added the comment: @Antoine Pitrou Regarding # XXX is the trailing space a bug?: I'm inclined to believe that it is. Man 7 locale does not mention that p_sep_by_space should be used for non-int currency symbols, nor that it shouldn't. However, it does say: char

[issue4323] Wrong encoding in files saved from IDLE (3.0rc2 on Windows)

2008-11-14 Thread André
New submission from André [EMAIL PROTECTED]: When saving a source file with non-ascii characters from an IDLE window, on Windows platform (XP and Server 2003 at least) with locale English US locale.getdefaultlocale() ('en_US', 'cp1252') IDLE prompts in IOBinding.py with the message non

[issue4323] Wrong encoding in files saved from IDLE (3.0rc2 on Windows)

2008-11-14 Thread STINNER Victor
STINNER Victor [EMAIL PROTECTED] added the comment: If accepted, the file is saved with the wrong encoding accept means click on the OK button. You have to click on the biggest button Edit my file to create a valid file. The problem here is the text in the dialog but also the possibility to

[issue4323] Wrong encoding in files saved from IDLE (3.0rc2 on Windows)

2008-11-14 Thread STINNER Victor
STINNER Victor [EMAIL PROTECTED] added the comment: Quick but ugly solution: force the #coding: header without asking the user for that. Added file: http://bugs.python.org/file12004/idle_remove_coding_dialog.py ___ Python tracker [EMAIL PROTECTED]

[issue4323] Wrong encoding in files saved from IDLE (3.0rc2 on Windows)

2008-11-14 Thread STINNER Victor
STINNER Victor [EMAIL PROTECTED] added the comment: Implementation of the second solution: replace Ok button by a Cancel button. Escape key is Cancel, whereas Return key is the default action: edit the file. -- keywords: +patch Added file:

[issue1673409] datetime module missing some important methods

2008-11-14 Thread STINNER Victor
STINNER Victor [EMAIL PROTECTED] added the comment: (t - epoch) // timedelta(seconds=1) I don't like this syntax, because I can't guess the result unit: datetime - datetime - timedelta but: timedelta / timedelta - seconds? days? nanoseconds? If you example, you used timedelta(seconds=1),

[issue1673409] datetime module missing some important methods

2008-11-14 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment: timedelta / timedelta - seconds? days? nanoseconds? The quotient of two timedelta is a dimensionless number with no unit: timedelta(hours=1) / timedelta(minutes=5) == 12.0 This seems well defined, where is the ambiguity? --

[issue4324] locale documentation is inconsistent

2008-11-14 Thread Kai Willadsen
New submission from Kai Willadsen [EMAIL PROTECTED]: The documentation for locale.getlocale is not consistent with the example given. The docs for getlocale([category]) say: category may be one of the LC_* values except LC_ALL. but the example at the bottom of the documentation starts with:

[issue4320] optparse: 1 2 3 should be seen as one string

2008-11-14 Thread Raghuram Devarakonda
Raghuram Devarakonda [EMAIL PROTECTED] added the comment: I had the same need in my small command line client (that uses Cmd.Cmd) and I solved it by using shlex.split() instead of regular string split. I haven't looked at optparse code lately and perhaps it can do the same. -- nosy:

[issue1673409] datetime module missing some important methods

2008-11-14 Thread Alexander Belopolsky
Alexander Belopolsky [EMAIL PROTECTED] added the comment: I was going to say the same as Amaury: timedelta / timedelta is dimensionless (time units cancel each other in division) and the advantage of this notation is that you get a way to express timedelta.toxxx for all units accepted in

[issue4325] Installer crash on cancel installation.

2008-11-14 Thread dreamlusion
New submission from dreamlusion [EMAIL PROTECTED]: Steps to reproduce: 1. Start the installer (python-2.6.msi) 2. Choose install for all users, next. 3. Select default directory, next. 4. Click Advanced. 5. Click Cancel and confirm (click yes). Bang. -- components: Installation

[issue4325] Installer crash on cancel installation.

2008-11-14 Thread dreamlusion
Changes by dreamlusion [EMAIL PROTECTED]: -- type: - crash ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4325 ___ ___ Python-bugs-list mailing list

[issue1767933] Badly formed XML using etree and utf-16

2008-11-14 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment: Would you provide a patch? -- nosy: +amaury.forgeotdarc ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue1767933 ___

[issue4289] Python 2.6 installer crashes when selecting 'advanced' and cancelling it

2008-11-14 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment: issue4325 describes the same crash, except that the user chose all users and did not change the destination directory. -- nosy: +amaury.forgeotdarc ___ Python tracker [EMAIL PROTECTED]

[issue4325] Installer crash on cancel installation.

2008-11-14 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment: It's a duplicate of issue4289, with almost the same sequence. -- nosy: +amaury.forgeotdarc resolution: - duplicate status: open - closed superseder: - Python 2.6 installer crashes when selecting 'advanced' and cancelling it

[issue4323] Wrong encoding in files saved from IDLE (3.0rc2 on Windows)

2008-11-14 Thread Martin v. Löwis
Martin v. Löwis [EMAIL PROTECTED] added the comment: The entire dialog should go away. The default source encoding is UTF-8 in Python 3.0, and IDLE should know that. The locale's encoding shouldn't ever be considered. -- nosy: +loewis ___ Python

[issue4289] Python 2.6 installer crashes when selecting 'advanced' and cancelling it

2008-11-14 Thread dreamlusion
Changes by dreamlusion [EMAIL PROTECTED]: -- nosy: +dreamlusion ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4289 ___ ___ Python-bugs-list mailing

[issue4313] IDLE segfault at exit

2008-11-14 Thread Hirokazu Yamamoto
Hirokazu Yamamoto [EMAIL PROTECTED] added the comment: After long random investigation, I found idle_crash_1.py can reproduce the crash. And I noticed in idle_crash_2.py WidgetRedirector#dispatch, last element of args cannot be printed. Here is result. 10 0 -foreground 1 black 2

[issue4313] IDLE segfault at exit

2008-11-14 Thread Hirokazu Yamamoto
Changes by Hirokazu Yamamoto [EMAIL PROTECTED]: Added file: http://bugs.python.org/file12007/idle_crash_2.py ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4313 ___

[issue4293] Thread Safe Py_AddPendingCall

2008-11-14 Thread Kristján Valur Jónsson
Kristján Valur Jónsson [EMAIL PROTECTED] added the comment: Here is a revised version. Since there is no portable way to block signals, and no way at all on windows (apparently) the simplest way is to simply use NOWAIT_LOCK when adding a new pending call. While this does not guarantee that we

[issue4313] IDLE segfault at exit

2008-11-14 Thread Hirokazu Yamamoto
Hirokazu Yamamoto [EMAIL PROTECTED] added the comment: Can I revert r57540 and reopen issue1028? ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4313 ___ ___

[issue4313] IDLE segfault at exit

2008-11-14 Thread STINNER Victor
STINNER Victor [EMAIL PROTECTED] added the comment: Can I revert r57540 and reopen issue1028? Would it be possible to revert and fix the issue in the same commit? :-) ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4313

[issue4313] IDLE segfault at exit

2008-11-14 Thread Hirokazu Yamamoto
Hirokazu Yamamoto [EMAIL PROTECTED] added the comment: Sorry, I cannot reproduce the bug described in issue1028, so it's difficult for me. ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4313 ___

[issue1767933] Badly formed XML using etree and utf-16

2008-11-14 Thread Richard urwin
Richard urwin [EMAIL PROTECTED] added the comment: Here is a patch of my quick hack, more for interest than any suggestion it gets used. Although it does produce good output so long as you avoid the BOM. The full solution is beyond my (very weak) Python skills. The character encoding is tied in

[issue2706] datetime: define division timedelta/timedelta

2008-11-14 Thread Alexander Belopolsky
Alexander Belopolsky [EMAIL PROTECTED] added the comment: I attaching webograph's patch updated to revision 67223 where I added a few tests. I am +1 on the floor divide changes (allowing timedelta // timedelta), but I am not sure how true division should work if at all. For the sake of

[issue2706] datetime: define division timedelta/timedelta

2008-11-14 Thread Alexander Belopolsky
Changes by Alexander Belopolsky [EMAIL PROTECTED]: -- nosy: +amaury.forgeotdarc, jribbens versions: +Python 2.7, Python 3.1 ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue2706 ___

[issue2706] datetime: define division timedelta/timedelta

2008-11-14 Thread STINNER Victor
STINNER Victor [EMAIL PROTECTED] added the comment: Why not also implementing divmod()? It's useful to split a timedelta into, for example, (hours, minutes, seconds): def formatTimedelta(delta): formatTimedelta(timedelta(hours=1, minutes=24, seconds=19)) '1h 24min 19sec'

[issue2706] datetime: define division timedelta/timedelta

2008-11-14 Thread Alexander Belopolsky
Alexander Belopolsky [EMAIL PROTECTED] added the comment: On Fri, Nov 14, 2008 at 12:51 PM, STINNER Victor [EMAIL PROTECTED] wrote: STINNER Victor [EMAIL PROTECTED] added the comment: Why not also implementing divmod()? It's useful to split a timedelta into, for example, (hours, minutes,

[issue4321] unintended syntax error with decorators, parenthesis, and dots?

2008-11-14 Thread Georg Brandl
Georg Brandl [EMAIL PROTECTED] added the comment: Closing; changing this will at least need a python-dev discussion, and thorough motivation. -- nosy: +georg.brandl resolution: - wont fix status: open - closed ___ Python tracker [EMAIL PROTECTED]

[issue2706] datetime: define division timedelta/timedelta

2008-11-14 Thread Alexander Belopolsky
Alexander Belopolsky [EMAIL PROTECTED] added the comment: Also, why not divmod(timedelta(3), 2) (datetime.timedelta(1), datetime.timedelta(1)) ? And where do we stop? :-) On Fri, Nov 14, 2008 at 1:02 PM, Alexander Belopolsky [EMAIL PROTECTED] wrote: On Fri, Nov 14, 2008 at 12:51 PM,

[issue2706] datetime: define division timedelta/timedelta

2008-11-14 Thread STINNER Victor
STINNER Victor [EMAIL PROTECTED] added the comment: Since timedelta(3) // 2 is already accepted, divmod should also accept integers (but not float). With the last patch and from __future__ import division, we support: timedelta // timedelta or int timedelta / timedelta divmod(timedelta,

[issue2706] datetime: define division timedelta/timedelta

2008-11-14 Thread Alexander Belopolsky
Alexander Belopolsky [EMAIL PROTECTED] added the comment: While I agree that divmod may be useful, your particular use case is not convincing. The same can be done easier without divmod: def formatTimedelta(delta): return {0}h {1}min {2}sec.format(*str(delta).split(':')) or you can convert

[issue2706] datetime: define division timedelta/timedelta

2008-11-14 Thread Alexander Belopolsky
Alexander Belopolsky [EMAIL PROTECTED] added the comment: On Fri, Nov 14, 2008 at 1:28 PM, STINNER Victor [EMAIL PROTECTED] wrote: .. What do you think about: timedelta / timedelta or int or float # only with __future__.divison timedelta // timedelta or int timedelta % timedelta or int

[issue2706] datetime: define division timedelta/timedelta

2008-11-14 Thread Alexander Belopolsky
Alexander Belopolsky [EMAIL PROTECTED] added the comment: Oops, the tracker ate some lines from e-mail. Reposting through the web: On Fri, Nov 14, 2008 at 1:28 PM, STINNER Victor [EMAIL PROTECTED] wrote: .. What do you think about: timedelta / timedelta or int or float # only with

[issue4326] type of UserList instance returns class instead of instance

2008-11-14 Thread chafporte
New submission from chafporte [EMAIL PROTECTED]: from UserList import UserList lu = UserList() type(lu) python2.6 prints: class 'UserList.UserList' python2.5 prints: type 'instance' -- components: None messages: 75885 nosy: chafporte severity: normal status: open title: type of

[issue4322] function with modified __name__ uses original name when there's an arg error

2008-11-14 Thread Benjamin Peterson
Benjamin Peterson [EMAIL PROTECTED] added the comment: This is because these errors use the code object's name attribute (f.func_code.co_name) for error messages. -- nosy: +benjamin.peterson priority: - normal ___ Python tracker [EMAIL PROTECTED]

[issue4326] type of UserList instance returns class instead of instance

2008-11-14 Thread Raymond Hettinger
Raymond Hettinger [EMAIL PROTECTED] added the comment: That is because UserList is now a new-style class as a result of it inheriting from the new abstract base classes. I believe this is the way Guido wanted it and do not see any deleterious impacts from the change. Recommend closing as won't

[issue4326] type of UserList instance returns class instead of instance

2008-11-14 Thread Benjamin Peterson
Benjamin Peterson [EMAIL PROTECTED] added the comment: Isn't policy to keep old-style classes around for compatibility in 2.x? Especially one like UserList which is meant to be used as a base class. -- nosy: +benjamin.peterson ___ Python tracker

[issue4327] Patch: simplify complex constant assignment statements

2008-11-14 Thread David Turner
New submission from David Turner [EMAIL PROTECTED]: This patch adds functionality to the optimizer to simplify complex constant assignments like: a, (b, c) = d, e = 1, (2, 3) The simplification is: a = 1 d = 1 b, c = e = 2, 3 Of course, the simplified version is semantically identical. But

[issue4327] Patch: simplify complex constant assignment statements

2008-11-14 Thread David Turner
David Turner [EMAIL PROTECTED] added the comment: Oh, and this also involved the creation of an additional statement type, unfortunately. The statement type, Seq, represents a sequence of statements. This is so that we can replace a single assign with multiple assigns. If that's no good, then

[issue4326] type of UserList instance returns class instead of instance

2008-11-14 Thread Raymond Hettinger
Raymond Hettinger [EMAIL PROTECTED] added the comment: It has been the practice to not switch old-style to new-style just for the hell of it. However, we do switch as part of large PEP driven efforts like the ABC backport. ___ Python tracker [EMAIL

[issue2706] datetime: define division timedelta/timedelta

2008-11-14 Thread STINNER Victor
STINNER Victor [EMAIL PROTECTED] added the comment: def formatTimedelta(delta): return {0}h {1}min {2}sec.format(*str(delta).split(':')) OMG, this is ugly! Conversion to string and reparse the formatted text :-/ Your code doesn't work with different units than hours, minutes or seconds:

[issue4326] type of UserList instance returns class instead of instance

2008-11-14 Thread Benjamin Peterson
Benjamin Peterson [EMAIL PROTECTED] added the comment: Fair enough. -- resolution: - wont fix status: open - closed ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4326 ___

[issue2706] datetime: define division timedelta/timedelta

2008-11-14 Thread Alexander Belopolsky
Alexander Belopolsky [EMAIL PROTECTED] added the comment: haypo How? I don't understand your suggestion. Sorry, another case of mail to tracker bug. Here is what I wrote: .. you can convert delta to time using an arbitrary anchor date and extract hms that way: x = datetime(1,1,1) +

[issue2706] datetime: define division timedelta/timedelta

2008-11-14 Thread STINNER Victor
STINNER Victor [EMAIL PROTECTED] added the comment: @webograph: time_gmtime() and time_localtime() already use function pointer. I prefer function pointer than code duplication! ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue2706

[issue4326] type of UserList instance returns class instead of instance

2008-11-14 Thread chafporte
chafporte [EMAIL PROTECTED] added the comment: but like that there is no way to detect if the object is a class or an instance. type() says it's a class in both case ! ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4326

[issue4326] type of UserList instance returns class instead of instance

2008-11-14 Thread Raymond Hettinger
Raymond Hettinger [EMAIL PROTECTED] added the comment: import inspect from UserList import UserList lu = UserList() inspect.isclass(UserList) True inspect.isclass(lu) False ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4326

[issue4326] type of UserList instance returns class instead of instance

2008-11-14 Thread chafporte
chafporte [EMAIL PROTECTED] added the comment: but for a user define class we have: class AAA: ... pass a = AAA() type(a) type 'instance' and you can compare this with types.InstanceType and it says True where for the UserList instance the comparison with types.InstanceType says False it is

[issue2736] datetime needs and epoch method

2008-11-14 Thread STINNER Victor
STINNER Victor [EMAIL PROTECTED] added the comment: I like the method, but I have some comments about the new method: - datetime_totimestamp() is not well indented - PyObject *time should be defined at the before the first instruction - why not using if (time == NULL) return NULL; directly

[issue2736] datetime needs and epoch method

2008-11-14 Thread STINNER Victor
STINNER Victor [EMAIL PROTECTED] added the comment: Here is a merged patch of the three patches. Except the C implementation of datetime_totimestamp() (written by me), all code is written by hodgestar. Added file: http://bugs.python.org/file12014/datetime_totimestamp-2.patch

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

2008-11-14 Thread STINNER Victor
STINNER Victor [EMAIL PROTECTED] added the comment: Can anyone review the last patch? -- keywords: +needs review stage: - patch review ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue1726687 ___

[issue2736] datetime needs and epoch method

2008-11-14 Thread Alexander Belopolsky
Alexander Belopolsky [EMAIL PROTECTED] added the comment: I would like to voice my opposition the totimestamp method. Representing time as a float is a really bad idea (originated at Microsoft as I have heard). In addition to the usual numeric problems when dealing with the floating point,

[issue2736] datetime needs and epoch method

2008-11-14 Thread STINNER Victor
STINNER Victor [EMAIL PROTECTED] added the comment: Le Saturday 15 November 2008 02:15:30 Alexander Belopolsky, vous avez écrit : I don't think changing fromtimestamp behavior is an option. It's too late to break the API (Python3 is in RC stage ;-)), but we can create new methods like:

[issue2736] datetime needs and epoch method

2008-11-14 Thread Alexander Belopolsky
Alexander Belopolsky [EMAIL PROTECTED] added the comment: On Fri, Nov 14, 2008 at 8:37 PM, STINNER Victor [EMAIL PROTECTED] wrote: .. but we can create new methods like: datetime.fromepoch(seconds, microseconds=0)# (int/long, int) While 1970 is the most popular epoch, I've seen 1900,

[issue3679] pressing HOME key in IDLE editor ends IDLE

2008-11-14 Thread Terry J. Reedy
Changes by Terry J. Reedy [EMAIL PROTECTED]: -- resolution: - fixed status: open - closed ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3679 ___ ___

[issue4313] IDLE segfault at exit

2008-11-14 Thread Hirokazu Yamamoto
Changes by Hirokazu Yamamoto [EMAIL PROTECTED]: -- nosy: +kbk ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4313 ___ ___ Python-bugs-list mailing list