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
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
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
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]
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:
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),
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?
--
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:
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:
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
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
Changes by dreamlusion [EMAIL PROTECTED]:
--
type: - crash
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4325
___
___
Python-bugs-list mailing list
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
___
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]
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
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
Changes by dreamlusion [EMAIL PROTECTED]:
--
nosy: +dreamlusion
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4289
___
___
Python-bugs-list mailing
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
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
___
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
Hirokazu Yamamoto [EMAIL PROTECTED] added the comment:
Can I revert r57540 and reopen issue1028?
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4313
___
___
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
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
___
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
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
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
___
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'
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,
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]
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,
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,
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
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
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
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
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]
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
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
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
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
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
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:
Benjamin Peterson [EMAIL PROTECTED] added the comment:
Fair enough.
--
resolution: - wont fix
status: open - closed
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4326
___
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) +
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
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
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
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
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
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
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
___
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,
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:
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,
Changes by Terry J. Reedy [EMAIL PROTECTED]:
--
resolution: - fixed
status: open - closed
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3679
___
___
Changes by Hirokazu Yamamoto [EMAIL PROTECTED]:
--
nosy: +kbk
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4313
___
___
Python-bugs-list mailing list
56 matches
Mail list logo