[issue1780] Decimal constructor accepts newline terminated strings

2008-01-10 Thread Facundo Batista

Facundo Batista added the comment:

I think that the Spec disallows additional whitespace to not allow, for
example, "2. 34" as "2.34", or "10 e-12".

I don't see any harm in having "  2.34" or "5.73\n" as good input
values, as long we remove those characters at both ends.

I propose to just make a .strip() at the input string, change the
documentation to reflect this, and that's all.

The doc says: "If value is a string, it should conform to the decimal
numeric string syntax:"

We can put: "If value is a string, it should conform to the decimal
numeric string syntax after being stripped on both ends:"

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1207589] Right Click Context Menu

2008-01-10 Thread Nashev

Nashev added the comment:

1) in file EditorWindow.py 2 editings:

a) remove selection-killer command on popup

def right_menu_event(self, event):
--  self.text.tag_remove("sel", "1.0", "end")

b) add ability to make separators in popup menu

def make_rmenu(self):
rmenu = Menu(self.text, tearoff=0)
for label, eventname in self.rmenu_specs:
++  if label != "-":
def command(text=self.text, eventname=eventname):
text.event_generate(eventname)
rmenu.add_command(label=label, command=command)
++  else:
++  rmenu.add_separator()
self.rmenu = rmenu

2) in PyShell.py extend rmenu_specs

rmenu_specs = [
++  ("Cut", "<>"), 
++  ("Copy", "<>"),
++  ("Paste", "<>"),
++  ("-", ""),
("Set Breakpoint", "<>"),
("Clear Breakpoint", "<>")
]

done...

And now I can't find easy way to next two desired features:
  1) disable cut/copy commands in case no selection (but it is not
exists in main menu too)
  2) display assigned hot keys in popup menu

--
nosy: +Nashev

_
Tracker <[EMAIL PROTECTED]>

_
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1782] PyModule_AddIntConstant and PyModule_AddStringConstant can leak

2008-01-10 Thread Hrvoje Nikšić

New submission from Hrvoje Nikšić:

PyModule_AddObject has somewhat strange reference-counting behavior in
that it *conditionally* steals a reference.  In case of error it doesn't
change the reference to the passed object, but in case of success it
steals it.  This means that, as written, PyModule_AddIntConstant and
PyModuleAddStringConstant can leak created objects if PyModule_AddObject
fails.

As far as I can tell, the correct way to write those functions would be
(using PyModule_AddIntConstant as the example):

int 
PyModule_AddIntConstant(PyObject *m, const char *name, long value)
{
PyObject *o = PyInt_FromLong(value);
if (PyModule_AddObject(m, name, o) == 0)
return 0;
Py_XDECREF(o);
return -1;
}

PyModule_AddObject was obviously intended to enable writing the "simple"
code (it even gracefully handles being passed NULL object to add) like
the one in PyModule_AddIntConstant, but I don't see a way to enable such
usage and avoid both leaks and an interface change.  Changing the
reference-counting behavior of PyModule_AddObject would be
backward-incompatible, but it might be a good idea to consider it for
Python 3.

If there is agreement that my analysis and the proposed fixes are
correct, I will produce a proper patch.

--
components: Interpreter Core
messages: 59662
nosy: hniksic
severity: normal
status: open
title: PyModule_AddIntConstant and PyModule_AddStringConstant can leak
type: resource usage
versions: Python 2.5

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1783] nonexistent data items declared as exports in sysmodule.h

2008-01-10 Thread Jukka Laurila

New submission from Jukka Laurila:

sysmodule.h contains the following declarations for data to be exported
from the Python DLL, but these variables don't seem to exist anywhere:

PyAPI_DATA(PyObject *) _PySys_TraceFunc, *_PySys_ProfileFunc;
PyAPI_DATA(int) _PySys_CheckInterval;

Either the declarations should be removed or the variables should be
defined somewhere. I'm proposing the former.

--
components: Interpreter Core
messages: 59663
nosy: jlaurila
severity: normal
status: open
title: nonexistent data items declared as exports in sysmodule.h
versions: Python 2.5, Python 2.6

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1782] PyModule_AddIntConstant and PyModule_AddStringConstant can leak

2008-01-10 Thread Christian Heimes

Christian Heimes added the comment:

Thanks for your analysis! I *think* you are right but I've to study the
code more carefully before I can make a decision. We can't target the
change for 2.5 though. Guido would accuse my of being insane again. *g*
The problem should be discussed at the upcoming bug day.

--
nosy: +tiran
priority:  -> normal
versions: +Python 2.6, Python 3.0 -Python 2.5

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1682] Move Demo/classes/Rat.py to Lib/rational.py and fix it up.

2008-01-10 Thread Guido van Rossum

Guido van Rossum added the comment:

> Would it be reasonable then to not have any of the numeric tower stuff
> put in the decimal module -- basically leave it alone (no __ceil__,
> etc)?

If that's the preference of the decimal developers, sure.

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1781] ConfigParser: add_section('DEFAULT') causes duplicate sections.

2008-01-10 Thread Christian Heimes

Christian Heimes added the comment:

It's an easy task for the bug day unless you can provide a patch and an
unit test earlier.

--
nosy: +tiran
priority:  -> normal

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1783] nonexistent data items declared as exports in sysmodule.h

2008-01-10 Thread Christian Heimes

Christian Heimes added the comment:

Sounds good to me. The vars were probably forgotten. The header files
may contain more missing vars, too.

--
nosy: +tiran
priority:  -> normal
versions: +Python 3.0 -Python 2.5

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1025395] email.Utils.parseaddr fails to parse valid addresses

2008-01-10 Thread Stuart D Gathman

Changes by Stuart D Gathman:


--
type:  -> behavior

_
Tracker <[EMAIL PROTECTED]>

_
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1025395] email.Utils.parseaddr fails to parse valid addresses

2008-01-10 Thread Stuart D Gathman

Stuart D Gathman added the comment:

# A quick and very dirty fix for common broken cases, with test cases.

import rfc822

def parseaddr(t):
  """Split email into Fullname and address.

  >>> parseaddr('[EMAIL PROTECTED]')
  ('', '[EMAIL PROTECTED]')
  >>> parseaddr('"Full Name" <[EMAIL PROTECTED]>')
  ('Full Name', '[EMAIL PROTECTED]')
  >>> parseaddr('[EMAIL PROTECTED] <[EMAIL PROTECTED]>')
  ('[EMAIL PROTECTED]', '[EMAIL PROTECTED]')
  >>> parseaddr('"God" <@hop1.org,@hop2.net:[EMAIL PROTECTED]>')
  ('God', '[EMAIL PROTECTED]')
  """
  #return email.Utils.parseaddr(t)
  res = rfc822.parseaddr(t)
  # dirty fix for some broken cases
  if not res[0]:
pos = t.find('<')
if pos > 0 and t[-1] == '>':
  addrspec = t[pos+1:-1]
  pos1 = addrspec.rfind(':')
  if pos1 > 0:
addrspec = addrspec[pos1+1:]
  return rfc822.parseaddr('"%s" <%s>' % (t[:pos].strip(),addrspec))
  if not res[1]:
pos = t.find('<')
if pos > 0 and t[-1] == '>':
  addrspec = t[pos+1:-1]
  pos1 = addrspec.rfind(':')
  if pos1 > 0:
addrspec = addrspec[pos1+1:]
  return rfc822.parseaddr('%s<%s>' % (t[:pos].strip(),addrspec))
  return res

_
Tracker <[EMAIL PROTECTED]>

_
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1025395] email.Utils.parseaddr fails to parse valid addresses

2008-01-10 Thread Stuart D Gathman

Stuart D Gathman added the comment:

Ok, I see the '@' is technically not allowed in an atom.  But it either
needs to throw an invalid syntax exception, or heuristically return
something reasonable.

_
Tracker <[EMAIL PROTECTED]>

_
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1025395] email.Utils.parseaddr fails to parse valid addresses

2008-01-10 Thread Stuart D Gathman

Stuart D Gathman added the comment:

Repeating because previous real life test case was rejected as 'spam':

It also fails to parse:
>>> from email.Utils import parseaddr
>>> parseaddr('[EMAIL PROTECTED] <[EMAIL PROTECTED]>')
('', '[EMAIL PROTECTED]')

Getting the wrong part as the actual email to boot!  Checked 2.4 and 2.5.

_
Tracker <[EMAIL PROTECTED]>

_
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1784] Error with OptionParser.parse_args()

2008-01-10 Thread Raghuram Devarakonda

New submission from Raghuram Devarakonda:

Sorry for the generic title but I couldn't think of a better one. My
attempt to do "svn up && make" failed with the following exception from
setup.py:

--
File "./setup.py", line 314, in detect_modules
if options.dirs:
AttributeError: Values instance has no attribute 'dirs'
--

I isolated the problem to a small script.

--
import optparse

parser = optparse.OptionParser()
parser.add_option("-I", dest="dirs", action="append")
options = parser.parse_args(['-I.', '-IInclude', '-I./Include'])[0]
if options.dirs:
print "opt = ", options.dirs
--

When run with 2.5.1, the script prints "opt =  ['.', 'Include',
'./Include']" but python from trunk gives the error:

Traceback (most recent call last):
  File "../opttest.py", line 6, in 
if options.dirs:
AttributeError: Values instance has no attribute 'dirs'

--
components: Library (Lib)
messages: 59672
nosy: draghuram
severity: normal
status: open
title: Error with OptionParser.parse_args()
type: behavior
versions: Python 2.6

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1782] PyModule_AddIntConstant and PyModule_AddStringConstant can leak

2008-01-10 Thread Guido van Rossum

Guido van Rossum added the comment:

These are meant purely for the convenience of module initialization, and
there correct handling of reference counts in the light of failures is
of marginal importance.  So while these may technically have leaks, you
shouldn't care.

--
nosy: +gvanrossum

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1784] Error with OptionParser.parse_args()

2008-01-10 Thread Raghuram Devarakonda

Raghuram Devarakonda added the comment:

It is my mistake. I modified optparse.py for an earlier issue and that
change is the cause of the problem reported here. Please close it as
invalid.

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1785] "inspect" gets broken by some descriptors

2008-01-10 Thread Dieter Maurer

New submission from Dieter Maurer:

The inspect functions "getmembers(cls)" and "classify_class_attrs(cls)"
require that for a class *cls* each name in "dir(cls)" can be retrieved
by "getattr(cls, name)". While this holds for usual class attributes, it
may well fail for descriptors (descriptors set by 'zope.interface' are a
real world example for this). Attached it as small script that
demonstrates the problem.

The bug affects 'pydoc' and the built in 'help' (which is in fact
'pydoc.help'). While 'pydoc' and 'help' do not break completely, they
can not present meaningful information for classes with some descriptors

--
components: Library (Lib)
files: inspectBug.py
messages: 59675
nosy: dmaurer
severity: normal
status: open
title: "inspect" gets broken by some descriptors
type: behavior
versions: Python 2.5
Added file: http://bugs.python.org/file9117/inspectBug.py

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1784] Error with OptionParser.parse_args()

2008-01-10 Thread Guido van Rossum

Changes by Guido van Rossum:


--
resolution:  -> invalid
status: open -> closed

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1785] "inspect" gets broken by some descriptors

2008-01-10 Thread Guido van Rossum

Guido van Rossum added the comment:

Please submit a patch.

--
nosy: +gvanrossum

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1785] "inspect" gets broken by some descriptors

2008-01-10 Thread Dieter Maurer

Dieter Maurer added the comment:

In "dm.zdoc" (a "pydoc" wrapper for Zope) I simply filter out all names
returned by "dir" which cannot be "getattr"ed.
But, I am not sure, that this is good enough to be accepted as a patch
(although it already improves upon the current state)

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1622] zipfile hangs on certain zip files

2008-01-10 Thread Eric Huss

Eric Huss added the comment:

Alan, your changes look good to me, but it is missing my patch in this bug
that fixes the sign issue in _decodeExtra.  While you're there, you might
as well change the other 3 unpack lines to use a capital Q.

-Eric

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1781] ConfigParser: add_section('DEFAULT') causes duplicate sections.

2008-01-10 Thread Raghuram Devarakonda

Raghuram Devarakonda added the comment:

Please see cfgparser.diff for the fix. It has tests and doc change.

--
nosy: +draghuram
Added file: http://bugs.python.org/file9118/cfgparser.diff

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1781] ConfigParser: add_section('DEFAULT') causes duplicate sections.

2008-01-10 Thread Raghuram Devarakonda

Raghuram Devarakonda added the comment:

I should add that the patch disallows not only 'DEFAULT' but all other
variants such as "Default" and "default". I am not entirely sure if my
description of this behaviour as "DEFAULT or any of it's
case-insensitive variants".

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1761] Bug in re.sub()

2008-01-10 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

This may be a surprising behaviour, but consistent with Perl and the
pcre library.
Added a sentence in documentation, and specific tests.

Committed as r59896.

--
resolution:  -> wont fix
status: open -> closed

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1472] Small bat files to build docs on Windows

2008-01-10 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

This batch file is a good idea. I have two remarks:
- it assumes that the python program is spelled "python25".
This could be configurable. Something along:
IF "%PYTHON%"=="" SET PYTHON=python25
Or is there a better way?

- Also, I suggest to insert a
SETLOCAL
command on the second line of the script, so that the variables set in
the script are restored at the end.

--
nosy: +amaury.forgeotdarc

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1622] zipfile hangs on certain zip files

2008-01-10 Thread Alan McIntyre

Alan McIntyre added the comment:

Thanks for the reminder, Eric; I'll include that and post the updated patch.

As a side note, on OS X, running regrtest with -uall or -ulargefile
still skips test_zipfile4 for some reason.  I'll have a look at that
before submitting the next version of the patch as well.

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1785] "inspect" gets broken by some descriptors

2008-01-10 Thread Antoine Pitrou

Antoine Pitrou added the comment:

This is my attempt at a patch for this. It fixes inspect.getmembers and
inspect.classify_class_attrs to work with Dieter's example. I hope it
doesn't mess anything else.

As for pydoc, things look a bit more complicated... The annoying thing
is that the logic to browse object contents is duplicated inside the
different renderers (pydoc.Repr subclasses). Also, I couldn't find any
unit tests for pydoc. Are there any?

--
nosy: +pitrou
Added file: http://bugs.python.org/file9119/inspect-bug.patch

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1785] "inspect" gets broken by some descriptors

2008-01-10 Thread Antoine Pitrou

Changes by Antoine Pitrou:


--
versions: +Python 2.6 -Python 2.5

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1688] Incorrectly displayed non ascii characters in prompt using "input()" - Python 3.0a2

2008-01-10 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

Isn't it enough to encode the prompt with the console encoding, instead
of letting the default utf-8 conversion? This patch corrects the issue
on Windows:

Index: ../Python/bltinmodule.c
===
--- ../Python/bltinmodule.c (revision 59843)
+++ ../Python/bltinmodule.c (working copy)
@@ -1358,12 +1358,19 @@
else
Py_DECREF(tmp);
if (promptarg != NULL) {
-   po = PyObject_Str(promptarg);
+   PyObject *stringpo = PyObject_Str(promptarg);
+   if (stringpo == NULL) {
+   Py_DECREF(stdin_encoding);
+   return NULL;
+   }
+   po = PyUnicode_AsEncodedString(stringpo,
+   PyUnicode_AsString(stdin_encoding), NULL);
+   Py_DECREF(stringpo);
if (po == NULL) {
Py_DECREF(stdin_encoding);
return NULL;
}
-   prompt = PyUnicode_AsString(po);
+   prompt = PyString_AsString(po);
if (prompt == NULL) {
Py_DECREF(stdin_encoding);
Py_DECREF(po);

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1786] pdb should set stdin+stdout around exec call

2008-01-10 Thread Guido van Rossum

New submission from Guido van Rossum:

When you type a command in pdb that happens to print something, the
output goes to sys.stdout, even if self.stdout references another file.
 This makes it hard to debug code running inside a web server where
sys.stdout/stdout are connected to a socket (or a WSGI wrapper file);
the output "disappears" and ends up messing up the response.

Attached is a fix that temporarily changes sys.stdin/stdout to the
debugger's input and output.  What do people think of this?

--
components: Library (Lib)
files: pdb.diff
messages: 59686
nosy: gvanrossum
priority: low
severity: normal
status: open
title: pdb should set stdin+stdout around exec call
type: behavior
versions: Python 2.5, Python 2.6, Python 3.0
Added file: http://bugs.python.org/file9120/pdb.diff

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1786] pdb should set stdin+stdout around exec call

2008-01-10 Thread Guido van Rossum

Changes by Guido van Rossum:


--
keywords: +patch

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1780] Decimal constructor accepts newline terminated strings

2008-01-10 Thread Mark Dickinson

Mark Dickinson added the comment:

Allowing leading and trailing whitespace causes failures in Cowlishaw's 
test suite.  I guess Raymond's right:  this bug report should be 
dismissed.  It still bothers me a little that there isn't a strictly 
conforming implementation of to-number in decimal, but I can live with it.

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1780] Decimal constructor accepts newline terminated strings

2008-01-10 Thread Guido van Rossum

Guido van Rossum added the comment:

> Allowing leading and trailing whitespace causes failures in Cowlishaw's
> test suite.  I guess Raymond's right:  this bug report should be
> dismissed.  It still bothers me a little that there isn't a strictly
> conforming implementation of to-number in decimal, but I can live with it.

Not sure what you mean. Can't you fix the code to reject the trailing
\n?  Or are we talking about something else now?

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1780] Decimal constructor accepts newline terminated strings

2008-01-10 Thread Mark Dickinson

Mark Dickinson added the comment:

I can certainly fix the Decimal constructor to reject trailing newlines, if 
that's what people want, but that doesn't fit with the proposal to accept 
and strip leading and trailing whitespace.

The other option that maintains full compliance with the specification is 
to do what we like with Decimal.__new__ (e.g. allowing leading and trailing 
whitespace), but make sure that there's a fully conforming to-number 
elsewhere in the Decimal module.

I'm happy to make either of the above fixes, or to do nothing (which leaves 
us with a slightly buggy implementation of the specification---but probably 
not so that anyone would notice).  I'll leave the decision of which of 
these three options is most desirable to the more seasoned developers.

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1780] Decimal constructor accepts newline terminated strings

2008-01-10 Thread Guido van Rossum

Guido van Rossum added the comment:

I'd say that accepting a trailing \n is a bug that should be fixed.

I think that ideally we'd be allowed to specify whitespace around the
value. I am always annoyed at programs that require me to type e.g. an
integer and don't let me put spaces before and/or after (which often
happen due to copy/paste).

See also bug #1779 BTW.

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1779] int("- 1") is valud, but float("- 1") isn't. Which is right?

2008-01-10 Thread Guido van Rossum

Guido van Rossum added the comment:

Moreover I think float is right and int is wrong.

Something to fix in 3.0, probably not in 2.6 (don't want to break too
much stuff that worked in 2.5).

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1621] Do not assume signed integer overflow behavior

2008-01-10 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

Hm. I don't get any warning, related to the overflow issue, neither with
-Wstrict-overflow=3, nor -Wstrict-overflow=5. Are the cPickle warnings
already fixed?

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1621] Do not assume signed integer overflow behavior

2008-01-10 Thread Ismail Donmez

Ismail Donmez added the comment:

Make sure you use gcc 4.3 trunk and at least -O2 is enabled. I tested
revision 59895 from release25-maint branch.

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1621] Do not assume signed integer overflow behavior

2008-01-10 Thread Ismail Donmez

Ismail Donmez added the comment:

FWIW gcc hacker Ian Lance Taylor has a nice article about signed
overflow optimizations in gcc, see http://www.airs.com/blog/archives/120
. Reading that it might be better to use -fno-strict-overflow instead of
-fwrapv.

Regards,
ismail

__
Tracker <[EMAIL PROTECTED]>

__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com