[issue1367711] Remove usage of UserDict from os.py

2008-01-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: I don't think the point of this patch is worth doing. The existing code is not buggy and runs fine. Subclassing from dict increases the likelihood that an error will be introduced either now or in the future as the dict object evolves. Recommend this be

[issue1746] ZIP files with archive comments longer than 4k not recognized as valid by zipfile module

2008-01-12 Thread Alan McIntyre
Alan McIntyre added the comment: A fix for this is included in the patch for issue 1622. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1746 __ ___ Python-bugs-list mailing list

[issue1570672] qtsupport.py mistake leads to bad _Qt module

2008-01-12 Thread Georg Brandl
Georg Brandl added the comment: But qtsupport.py is in the Python distribution. -- nosy: +georg.brandl resolution: invalid - status: closed - open _ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1570672 _

[issue1720595] Allow T_BOOL in PyMemberDef definitions

2008-01-12 Thread Georg Brandl
Georg Brandl added the comment: The question is also what C type to assume for boolean fields -- char or int? _ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1720595 _ ___

[issue1678668] fix a bug mixing up 0.0 and-0.0

2008-01-12 Thread Georg Brandl
Georg Brandl added the comment: ITYM #1729014. :) -- nosy: +georg.brandl _ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1678668 _ ___ Python-bugs-list mailing

[issue1622] zipfile hangs on certain zip files

2008-01-12 Thread Alan McIntyre
Alan McIntyre added the comment: Here's an updated patch (zipfile-unsigned-fixes2.diff) that contains Eric's fixes. I also changed the structure for the Zip64 extension data to be unsigned. I think this should cover all the deficiencies caused by the improper use of unsigned values. Note: if

[issue1622] zipfile hangs on certain zip files

2008-01-12 Thread Alan McIntyre
Alan McIntyre added the comment: I just noticed that my changes for issue 1526 are included in this patch. Eric, if you have time could you have a look at that issue and see if you think I addressed it properly? If not I can back them out into a separate patch for that issue.

[issue1526] DeprecationWarning in zipfile.py while zipping 113000 files

2008-01-12 Thread Alan McIntyre
Alan McIntyre added the comment: I just noticed that my changes for this issue are included in the patch for issue 1622; if that gets committed then this issue should be closed. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1526

[issue1809] docs for os.symlink(src, dst) doesn't mention exceptions

2008-01-12 Thread Georg Brandl
Georg Brandl added the comment: Most of the os functions don't specify that they raise OSError in the case of invalid or inaccessible paths. I've now added a general note to that effect in r59930. -- resolution: - fixed status: open - closed __ Tracker

[issue1810] Partial AST compile() patch

2008-01-12 Thread Georg Brandl
Georg Brandl added the comment: This is great work! The problem is that ast2obj_object translates NULL values to Py_None, but obj2ast_object doesn't translate that back. This definition fixes your testcase: static int obj2ast_object(PyObject* obj, PyObject** out, PyArena* arena) { if (obj

[issue1367711] Remove usage of UserDict from os.py

2008-01-12 Thread Andrew Dalke
Andrew Dalke added the comment: I was optimization tuning and wondered why UserDict was imported by os. Replacing UserDict with dict passes all existing regression tests. I see the concerns that doing that replacement is not future proof. Strange then that Cookie.py is acceptable. There

[issue1367711] Remove usage of UserDict from os.py

2008-01-12 Thread Andrew Dalke
Andrew Dalke added the comment: I should have added my preference. I would like to see UserDict replaced with dict. I didn't like seeing the extra import when I was doing my performance testing, through truthfully it's not a bit overhead. As for future-proofing, of course when there's a

[issue1685986] Method cache

2008-01-12 Thread Georg Brandl
Georg Brandl added the comment: Superseded by #1700288, which is updated for 2.6. -- resolution: - duplicate status: open - closed superseder: - Armin's method cache optimization updated for Python 2.6 _ Tracker [EMAIL PROTECTED]

[issue1339] smtplib starttls() should ehlo() if it needs to

2008-01-12 Thread James Henstridge
James Henstridge added the comment: From RFC 2487 section 5.2: The client MUST discard any knowledge obtained from the server, such as the list of SMTP service extensions, which was not obtained from the TLS negotiation itself. The client SHOULD send an EHLO command as the first command after a

[issue1700288] Armin's method cache optimization updated for Python 2.6

2008-01-12 Thread Georg Brandl
Georg Brandl added the comment: Committed to trunk as r59931. Leaving open if you want to make more adjustments, Raymond. -- nosy: +georg.brandl _ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1700288 _

[issue1568] PATCH: Armin's attribute lookup caching for 3.0

2008-01-12 Thread Georg Brandl
Georg Brandl added the comment: #1700288's patch has been committed. Leaving this open as a guide to whoever has to merge it to Py3k. -- nosy: +georg.brandl __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1568 __

[issue1472] Small bat files to build docs on Windows

2008-01-12 Thread Georg Brandl
Georg Brandl added the comment: Ideally, yes. The case of the doc build is a bit more complicated because it relies on external libraries which may or may not work with the tree version. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1472

[issue1492] BaseHTTPServer hard-codes Content-Type for error messages

2008-01-12 Thread Georg Brandl
Changes by Georg Brandl: -- keywords: +easy __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1492 __ ___ Python-bugs-list mailing list Unsubscribe:

[issue1813] Codec lookup failing under turkish locale

2008-01-12 Thread Árni Már Jónsson
New submission from Árni Már Jónsson: When switching to a turkish locale, the codecs registry fails on a codec lookup which worked before the locale change. This happens when the codec name contains an uppercase 'I'. What happens, is just before doing a cache lookup, the string is normalized,

[issue1367711] Remove usage of UserDict from os.py

2008-01-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: it's better to derived from dict for things like this than to derive from UserDict or UserDictMixin That's true for UserDict but not DictMixin. IIRC, the latter will continue to exist in Py3.0 and it has a purpose that is much different than UserDict or

[issue1570672] qtsupport.py mistake leads to bad _Qt module

2008-01-12 Thread Christian Heimes
Christian Heimes added the comment: Oh, it's a Mac module :) I'm sorry _ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1570672 _ ___ Python-bugs-list mailing list

[issue1811] True division of integers could be more accurate

2008-01-12 Thread Christian Heimes
Christian Heimes added the comment: How fast is your algorithm compared to the current algorithm and where starts the break even zone? Most users use only small integers so it might be a good idea to use a simpler algorithm for longs with Py_SIZE() == 1. This is important for py3k. --

[issue1812] doctest _load_testfile function -- newline handling seems incorrect

2008-01-12 Thread Christian Heimes
Changes by Christian Heimes: -- priority: - normal __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1812 __ ___ Python-bugs-list mailing list Unsubscribe:

[issue1812] doctest _load_testfile function -- newline handling seems incorrect

2008-01-12 Thread Christian Heimes
Changes by Christian Heimes: -- keywords: +easy __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1812 __ ___ Python-bugs-list mailing list Unsubscribe:

[issue936813] fast modular exponentiation

2008-01-12 Thread Christian Heimes
Christian Heimes added the comment: Mark, as the second math guru in our team, you are probably interested in these patches. Trevor has written an interesting patch to optimize longs for cryptographic problems. In fact it might be two patches now, one for the Montgomery Reduction and one

[issue1472] Small bat files to build docs on Windows

2008-01-12 Thread Martin v. Löwis
Martin v. Löwis added the comment: Would all things in the tree ideally work with the version that was built from checkout? It's more important that it works with many old versions, than with its own version. python should be on the path, and ideally, whatever you get there should work. The

[issue923643] long - byte-string conversion

2008-01-12 Thread Christian Heimes
Christian Heimes added the comment: Here is another integer related optimization patch from Trev. I've no opinion on the matter but you might be interested in it as well. -- assignee: - marketdickinson nosy: +marketdickinson, tiran versions: +Python 2.6 -Python 2.4

[issue1814] Victor Stinner's GMP patch for longs

2008-01-12 Thread Christian Heimes
New submission from Christian Heimes: A while ago Victor Stinner has spend several weeks in porting PyLongs to GMP: http://mail.python.org/pipermail/python-3000/2007-September/010718.html http://mail.python.org/pipermail/python-3000/2007-October/010755.html Although his patch didn't give the

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

2008-01-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: Just tried on 2.5.1 and on trunk, I can't reproduce it. On both I get: import locale locale.setlocale(locale.LC_NUMERIC, fr_FR.UTF-8) 'fr_FR.UTF-8' locale.format(%9.2f, 12345.67, True) ' 12345,67' locale.format(%.2f, 12345.67, True) '12345,67'

[issue1811] True division of integers could be more accurate

2008-01-12 Thread Mark Dickinson
Mark Dickinson added the comment: It would be easy and safe to just use a/b = float(a)/float(b) if both a and b are less than 2**53 (assuming IEEE doubles). Then there wouldn't be any loss of speed for small integers. For large integers the algorithm I posted should run in time linear in

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

2008-01-12 Thread Mark Dickinson
Mark Dickinson added the comment: For Python 3.0, this is a trivial fix: two lines need to be removed from PyLong_FromString in longobject.c, and then the tests in test_builtin need to be fixed up. (For Python 2.6, the fix would be a bit more involved: PyOS_strtol would also need fixing.)

[issue1616] compiler warnings (gcc 2.96)

2008-01-12 Thread Guido van Rossum
Guido van Rossum added the comment: With a newer compiler (GCC 4.0.1 on OSX 10.5.1) I still get some warnings: /Users/guido/p25/Modules/_ctypes/libffi/src/x86/ffi_darwin.c:220: warning: function declaration isn’t a prototype /Users/guido/p25/Modules/readline.c: In function ‘flex_complete’:

[issue1616] compiler warnings (gcc 2.96)

2008-01-12 Thread Guido van Rossum
Changes by Guido van Rossum: -- status: pending - open __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1616 __ ___ Python-bugs-list mailing list Unsubscribe:

[issue1814] Victor Stinner's GMP patch for longs

2008-01-12 Thread Guido van Rossum
Guido van Rossum added the comment: Since this keeps coming up, I think it would make sense to turn this into an optional extension module. PS. The licensing concerns are another reason not to use this for the core long (or int in Py3k) type. -- keywords: +patch nosy: +gvanrossum

[issue1812] doctest _load_testfile function -- newline handling seems incorrect

2008-01-12 Thread Peter Donis
Peter Donis added the comment: I've uploaded a revised diff with two small improvements: (1) Removed a redundant os.isfile check in PackageLoaderTestImporter.get_data() in doctest_testfile.py. (The open() builtin already raises IOError if the file can't be opened.) (2) Added doctest.master =

[issue1798] Add ctypes calling convention that allows safe access of errno

2008-01-12 Thread Thomas Heller
Thomas Heller added the comment: But this thread-local attribute on the function seems bizarre to me. I would prefer another way to get the errno. I can see two alternatives: - the function returns a tuple (normalresult, errno) on each call. - when errno is not zero, EnvironmentError (or

[issue1815] Distutils add ability to skip build [Feature Request]

2008-01-12 Thread Daniel Eloff
New submission from Daniel Eloff: There seems to be no way to skip the build step when running setup.py install The behavior in such a case should be to skip build and use the existing binaries as created in a separate build step or else print an error. That way you can do setup.py build

[issue1811] True division of integers could be more accurate

2008-01-12 Thread Christian Heimes
Christian Heimes added the comment: Mark Dickinson wrote: To get proper timings I'd have to code this up properly. I'll do this, unless there's a consensus that it would be a waste of time :) Why don't you ask Tim? He is the right person for the discussion. I'm only an interested amateur

[issue1815] Distutils add ability to skip build [Feature Request]

2008-01-12 Thread Christian Heimes
Christian Heimes added the comment: Python 2.5's distutils has a --skip-build option for the install command. In which way doesn't it solve your use case? For Windows I recommend MinGW32 as compiler. It's sufficient for most users. -- nosy: +tiran priority: - low type: - rfe

[issue1811] True division of integers could be more accurate

2008-01-12 Thread Mark Dickinson
Mark Dickinson added the comment: Tim: is this worth fixing? -- nosy: +tim_one __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1811 __ ___ Python-bugs-list mailing list

[issue1816] sys.cmd_flags patch

2008-01-12 Thread Christian Heimes
New submission from Christian Heimes: The output should be self explaining: ./python -tt -E -OO -Qnew -c import sys; print sys.cmd_flags ('Qnew', 'O', 'OO', 'E', 't', 'tt') I'll provide doc updates and a mini test if the patch wanted. -- components: Interpreter Core files:

[issue1710703] zipfile.ZipFile behavior inconsistent.

2008-01-12 Thread Alan McIntyre
Alan McIntyre added the comment: Here's a quick patch that covers the issues mentioned in my post from 2007-05-09. Added file: http://bugs.python.org/file9144/empty-zipfile.diff _ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1710703

[issue1215] Python hang when catching a segfault

2008-01-12 Thread Ralf Schmitt
Ralf Schmitt added the comment: If you replace your call segfault.segfault() with os.kill(os.getpid(), signal.SIGSEGV) everything works as expected. The problem is that the signal is just caught in the c handler (and a flag is set) and then the program continues with the offending *c = 'a';

[issue919238] Recursive variable definition causes sysconfig infinite loop

2008-01-12 Thread Ralf Schmitt
Ralf Schmitt added the comment: This is still applies for trunk. I've added the following lines to Makefile (in the top level directory). SELF=$(SELFA) SELFA=$(SELF) Running make then hangs. I'm attaching a patch, which fixes this issue (against trunk). Running make now prints:

[issue919238] Recursive variable definition causes sysconfig infinite loop

2008-01-12 Thread Ralf Schmitt
Changes by Ralf Schmitt: Added file: http://bugs.python.org/file9145/issue919238_sysconfig_recursive_definition.txt Tracker [EMAIL PROTECTED] http://bugs.python.org/issue919238

[issue1215] Python hang when catching a segfault

2008-01-12 Thread Adam Olsen
Adam Olsen added the comment: The warning in the documentation should be strengthened. Python simply does not and cannot support synchronously-generated signals. It is possible to send a normally synchronous signal asynchronously, such as the os.kill() Ralf mentioned, so it's theoretically

[issue1811] True division of integers could be more accurate

2008-01-12 Thread Raymond Hettinger
Changes by Raymond Hettinger: -- assignee: - tim_one __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1811 __ ___ Python-bugs-list mailing list Unsubscribe:

[issue1816] sys.cmd_flags patch

2008-01-12 Thread Guido van Rossum
Guido van Rossum added the comment: I like the idea of exposing Python's command line flags, but I think this API is a bit odd. I'd rather see it be a struct with members named after the various arguments and values that are ints or bools -- or simply a bunch of new flags directly in the sys

[issue919238] Recursive variable definition causes sysconfig infinite loop

2008-01-12 Thread Ralf Schmitt
Changes by Ralf Schmitt: Added file: http://bugs.python.org/file9146/issue919238_sysconfig_recursive_definition.txt Tracker [EMAIL PROTECTED] http://bugs.python.org/issue919238

[issue1623] Implement PEP-3141 for Decimal

2008-01-12 Thread Jeffrey Yasskin
Jeffrey Yasskin added the comment: The discussion on issue 1682 concluded that Decimal should not implement Real at all. -- resolution: - rejected status: open - closed __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1623

[issue1810] AST compile() patch

2008-01-12 Thread Thomas Lee
Thomas Lee added the comment: I knew it would be a simple one for somebody who knew what to look for :) Thanks Georg! r02 is the updated patch. Changing the title of the tracker issue to reflect that this *should* be a complete patch now. Any further recommendations? -- title: Partial

[issue1817] module-cgi: handling GET and POST together

2008-01-12 Thread Alexandre Fiori
New submission from Alexandre Fiori: It looks like module-cgi cannot handle GET and POST together when using FieldStorage. For instance, a form action=script.py?key=value action=post is available through cgi.FormContent but not cgi.FieldStorage when there are other input in the html form. Very

[issue1817] module-cgi: handling GET and POST together

2008-01-12 Thread Guido van Rossum
Guido van Rossum added the comment: Well, what are you waiting for? Submit a patch! -- keywords: +easy nosy: +gvanrossum __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1817 __

[issue1817] module-cgi: handling GET and POST together

2008-01-12 Thread Alexandre Fiori
Alexandre Fiori added the comment: Here it is, babe. I've made appropriate changes to make it read QUERY_STRING when it's available within POST method. It's currently being parsed by parse_qsl() in read_urlencoded() as it should be in regular GET or POST. I didn't touch CONTENT_LENGTH since it