[issue8595] Explain the default timeout in http-client-related libraries

2010-08-19 Thread Anders Sandvig
Changes by Anders Sandvig anders.sand...@gmail.com: -- nosy: +anders.sandvig ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8595 ___ ___ Python

[issue9641] httplib/ftplib: timeout parameter not applied correctly

2010-08-19 Thread Anders Sandvig
New submission from Anders Sandvig anders.sand...@gmail.com: From http://mail.python.org/pipermail/python-dev/2010-July/101266.html: Consider the following code for retreieving a web page using httplib: def get_url(hostname, port, url, timeout=5): con = httplib.HTTPConnection

[issue9641] httplib/ftplib: timeout parameter not applied correctly

2010-08-19 Thread Anders Sandvig
Anders Sandvig anders.sand...@gmail.com added the comment: The best (and simplest) solution seems to be option 2). Affected methods are found to be HTTPConnection.connect() and HTTPSConnection.connect() in Lib/httplib.py (Lib/http/client.py for 3.x) and FTP.connect() and FTP.ntransfercmd

[issue9641] httplib/ftplib: timeout parameter not applied correctly

2010-08-19 Thread Anders Sandvig
Anders Sandvig anders.sand...@gmail.com added the comment: socket.create_connection() does in fact set the timeout of the resulting socket object, so the issue is not an issue after all. The problems I experienced was a result of sending the timeout as the third parameter

[issue979407] urllib2 digest auth totally broken

2010-08-19 Thread Anders Sandvig
Changes by Anders Sandvig anders.sand...@gmail.com: -- nosy: +anders.sandvig ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue979407 ___ ___ Python

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2010-07-26 Thread Anders Kaseorg
Anders Kaseorg ande...@mit.edu added the comment: I still disagree. You're giving the parser ambiguous input. If a parser sees --foo --bar, and --foo is a valid option, but --bar is not, this is a legitimately ambiguous situation. There is no ambiguity. According to the way that every

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2010-07-26 Thread Anders Kaseorg
Anders Kaseorg ande...@mit.edu added the comment: arguments = *(positional-argument / option) [-- *(positional-argument)] positional-argument = string option = foo-option / bar-option foo-option = --foo string bar-option = --bar Er, obviously positional arguments before the first

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2010-07-23 Thread Anders Kaseorg
Anders Kaseorg ande...@mit.edu added the comment: Note that the negative number heuristic you're complaining about doesn't actually affect your code below. Yes it does: import argparse parser = argparse.ArgumentParser(prog='a2x') parser.add_argument('--asciidoc-opts', ... action

[issue8376] Tutorial offers dangerous advice about iterator s: “__iter__() can just return self”

2010-07-22 Thread Anders Kaseorg
Anders Kaseorg ande...@mit.edu added the comment: I don’t think that small change is good enough, if it is still the case that the only provided example is the dangerous one. It would be easy to clarify the differences between the classes: rl = test.ReverseList('spam') [c for c in rl] ['m

[issue8376] Tutorial offers dangerous advice about iterator s: “__iter__() can just return self”

2010-07-22 Thread Anders Kaseorg
Anders Kaseorg ande...@mit.edu added the comment: Antoine: That’s true. Amaury: See my original bug description (“This is reasonable advice for writing an iterator class, but terrible advice for writing a container class…”), and my other comments. There is nothing wrong with explaining how

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2010-07-22 Thread Anders Kaseorg
New submission from Anders Kaseorg ande...@mit.edu: Porting the a2x program to argparse from the now-deprecated optparse subtly breaks it when certain options are passed: $ a2x --asciidoc-opts --safe gitcli.txt $ ./a2x.argparse --asciidoc-opts --safe gitcli.txt usage: a2x [-h] [--version

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2010-07-22 Thread Anders Kaseorg
Anders Kaseorg ande...@mit.edu added the comment: Though in general I find argparse's default behavior more useful. I’m not sure I understand. Why is it useful for an option parsing library to heuristically decide, by default, that I didn’t actually want to pass in the valid option that I

[issue8376] Tutorial offers dangerous advice about iterator s: “__iter__() can just return self”

2010-04-12 Thread Anders Kaseorg
New submission from Anders Kaseorg ande...@mit.edu: The Python tutorial offers some dangerous advice about adding iterator behavior to a class: http://docs.python.org/tutorial/classes.html#iterators “By now you have probably noticed that most container objects can be looped over using

[issue8376] Tutorial offers dangerous advice about iterator s: “__iter__() can just return self”

2010-04-12 Thread Anders Kaseorg
Anders Kaseorg ande...@mit.edu added the comment: As an experienced Python programmer I am obviously aware that the tutorial is trying to teach how to make an iterator class, not how to make a container class. But the tutorial doesn’t make that *clear*. It should be much more explicit about

[issue8158] documentation of 'optparse' module incomplete

2010-03-16 Thread Simon Anders
New submission from Simon Anders and...@embl.de: The class optparse.OptionParser supports a number of useful keyword arguments to the initializer, which are not documented in the Python Standard Library documentation, here: http://docs.python.org/library/optparse.html This is a bit

[issue1759169] clean up Solaris port and allow C99 extension modules

2010-01-02 Thread anders musikka
anders musikka anders.musi...@gmail.com added the comment: Just wanted to chip in my $.02: Defining _XOPEN_SOURCE in the python headers causes problems for Solaris. It also causes problems for Ubuntu Linux. Because _XOPEN_SOURCE is defined, Python.h must included first in any program under

[issue6682] Default traceback does not handle PEP302 loaded modules

2009-08-11 Thread Anders Blomdell
New submission from Anders Blomdell anders.blomd...@control.lth.se: While trying to get a PEP302 import hook to function properly, I found that the default traceback picks up the wrong sourcecode for PEP302 loaded modules. The testcase pep302_traceback.py tries to emulate the behavior

[issue5704] Command line option '-3' should imply '-t'

2009-04-05 Thread Simon Anders
New submission from Simon Anders sand...@fs.tum.de: The '-3' command line option in Python 2.6 is supposed to warn whenever encountering something that would throw an error in Python 3. Mixing of tabs and spaces has become illegal in Python 3. However, Python 2.6, called with '-3', passes

[issue2736] datetime needs and epoch method

2008-11-18 Thread Anders J. Munch
Anders J. Munch [EMAIL PROTECTED] added the comment: Any thoughts to time zone/DST handling for naive datetime objects? E.g. suppose the datetime object was created by .utcnow or .utcfromtimestamp. For aware datetime objects, I think the time.mktime(dt.timetuple()) approach doesn't work; the tz

[issue1759845] subprocess.call fails with unicode strings in command line

2008-08-26 Thread Anders J. Munch
Changes by Anders J. Munch [EMAIL PROTECTED]: -- nosy: +andersjm ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue1759845 ___ ___ Python-bugs-list mailing

[issue1220212] os.kill on windows

2008-08-25 Thread Anders J. Munch
Changes by Anders J. Munch [EMAIL PROTECTED]: -- nosy: +andersjm ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue1220212 ___ ___ Python-bugs-list mailing

[issue3545] Python turning off assertions (Windows)

2008-08-14 Thread Anders Bensryd
Anders Bensryd [EMAIL PROTECTED] added the comment: We started using Python 2.5.2 recently and a few developers have complained that they do not get any assertions anymore so yes, we do use _ASSERT() and _ASSERTE(), but after a brief look it seems as if we mainly use assert(). The developer

[issue3545] Python turning off assertions (Windows)

2008-08-13 Thread Anders Bensryd
Anders Bensryd [EMAIL PROTECTED] added the comment: Yes, we could do that. However, my concerns are: 1) We cannot be the only Python user that experience this issue? I would prefer one of these solutions (in this order): a) A parameter to Py_Initialize (structure) that controls its behaviour

[issue3545] Python turning off assertions (Windows)

2008-08-12 Thread Anders Bensryd
New submission from Anders Bensryd [EMAIL PROTECTED]: We are using Windows XP SP2, Visual Studio 2005 Python 2.5.2. In Objects/exceptions.c the following code turns off all assertions. #if defined _MSC_VER _MSC_VER = 1400 defined(__STDC_SECURE_LIB__) /* Set CRT argument error handler

[issue2138] Factorial

2008-02-23 Thread Anders Valind
Anders Valind added the comment: Yeah, I like the idea of a third party module and letting the popularity and quality decide when/if it will be included. This would also make it easier to see what kind of functionality people would want. __ Tracker [EMAIL

[issue2138] Factorial

2008-02-22 Thread Anders Valind
Anders Valind added the comment: IMHO, The best place to put functions such as xgcd, factorial, etc, would be a new imath module, an integer equivalent of cmath. Not only would it keep the standard math module clean, it would also make clear that these functions are for integers only

[issue1084] ''.find() gives wrong result in Python built with ICC

2007-12-04 Thread Simon Anders
Simon Anders added the comment: Update to the story: After I submitted the bug report to Intel, they investigated and quickly confirmed it to be a compiler bug, whcih they then managed to fix. I have just got an e-mail from Intel that the newest available version of ICC, namely version

[issue1084] ''.find() gives wrong result in Python built with ICC

2007-09-02 Thread Simon Anders
Simon Anders added the comment: Martin, you are right: is is related to compiler optimization. I have boiled it down to a call of stringlib_find (defined in Python-2.5.1/Objects/stringlib/find.h) and this runs fine with 'icc -O2' but incorrectly for 'icc -O3'. (The test code is attached.) So

[issue1084] ''.find() gives wrong result in Python built with ICC

2007-09-02 Thread Simon Anders
Simon Anders added the comment: Martin: I've boiled down the test case a bit more and removed all Python-specific types and macros, so that it can now be compiled stand-alone. (Updated test case 'findtest.c' attached.) I didn't feel like diving into the code much deeper, and so I have sent

[issue1084] ''.find() gives wrong result in Python built with ICC

2007-09-01 Thread Simon Anders
Changes by Simon Anders: -- components: Build, Interpreter Core severity: normal status: open title: ''.find() gives wrong result in Python built with ICC versions: Python 2.5 __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1084

[issue1084] ''.find() gives wrong result in Python built with ICC

2007-09-01 Thread Simon Anders
New submission from Simon Anders: I have just encountered a strange bug affecting Python 2.5.1 on an x86_64 Linux, but only when compiled with the Intel C Compiler (ICC) 10.0, not a GCC-compiled Python. On my Intel-compiled one, which otherwise seems to work fine, ''.find() works incorrectly. I

<    1   2