Changes by Anders Sandvig anders.sand...@gmail.com:
--
nosy: +anders.sandvig
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8595
___
___
Python
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
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
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
Changes by Anders Sandvig anders.sand...@gmail.com:
--
nosy: +anders.sandvig
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue979407
___
___
Python
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Changes by Anders J. Munch [EMAIL PROTECTED]:
--
nosy: +andersjm
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1759845
___
___
Python-bugs-list mailing
Changes by Anders J. Munch [EMAIL PROTECTED]:
--
nosy: +andersjm
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1220212
___
___
Python-bugs-list mailing
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
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
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
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
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
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
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
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
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
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
101 - 131 of 131 matches
Mail list logo