Yuval Greenfield ubershme...@gmail.com added the comment:
This isn't a bug and should be closed. It's more of a stack overflow question.
If you'd like to change this fundamental behavior of a very common operation in
python you should make a proposal to the python ideas mailing list at
Martin v. Löwis mar...@v.loewis.de added the comment:
It's actually fairly easy to explain. Just think about it harder (and consider
Yuval's explanation).
--
nosy: +loewis
resolution: - invalid
status: open - closed
___
Python tracker
Larry Hastings la...@hastings.org added the comment:
bba131e48852 causes crashes on Windows.
The attached patch fixes the crash and makes test_os pass for me.
However, using PyErr_ExceptionMatches(PyExc_RuntimeError) to check
whether to try again using narrow strings is ugly. Maybe
New submission from Frank Millman fr...@chagford.com:
sqlite3/dbapi2.py contains the following -
def convert_timestamp(val):
datepart, timepart = val.split(b )
timepart_full = timepart.split(b.)
[...]
if len(timepart_full) == 2:
microseconds =
Ezio Melotti ezio.melo...@gmail.com added the comment:
http://docs.python.org/faq/programming.html#how-do-i-create-a-multidimensional-list
http://python.net/crew/mwh/hacks/objectthink.html
--
nosy: +ezio.melotti
stage: - committed/rejected
___
Serhiy Storchaka storch...@gmail.com added the comment:
title: More fast utf-8 decoding - Faster utf-8 decoding
Éric, there is already an issue (#4868) with this title.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14654
Martin v. Löwis mar...@v.loewis.de added the comment:
There is nothing wrong with two issues having the same title. Of course, it
would be best if the title reflected the *actual* defect or change, such as
specialize UTF-8 decoding by character width, or some such.
In any case, the title
Richard Oudkerk shibt...@gmail.com added the comment:
TBH I don't understand why it should crash, and therefore how your patch
helps. Trying again using narrow strings should always work; indeed, the
code did that before I touched it. Can you describe how it crashes?
The important part
Serhiy Storchaka storch...@gmail.com added the comment:
Thank you, Martin, this is what I had in mind. Lost in translation. ;)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14654
___
Richard Oudkerk shibt...@gmail.com added the comment:
Without the check for RuntimeError
os.utime(foo, times=(5,5), ns=(5,5))
raises
TypeError(TypeError: 'str' does not support the buffer interface)
because we have fallen through to the narrow path. The correct error is
Larry Hastings la...@hastings.org added the comment:
Let me recap, just to make sure I have it straight. There are two errors on
Windows:
* The ! on (what is currently) line 3770 is wrong:
if (!utime_read_time_arguments(ua)) {
* If you pass in a Unicode string but also pass in both times
Richard Oudkerk shibt...@gmail.com added the comment:
Let me recap, just to make sure I have it straight. There are two errors
on Windows:
That's right. The patch looks good and passes for me on Windows.
--
___
Python tracker
Roundup Robot devn...@psf.upfronthosting.co.za added the comment:
New changeset fc5d2f4291ac by Larry Hastings in branch 'default':
Issue #14127: Fix two bugs with the Windows implementation.
http://hg.python.org/cpython/rev/fc5d2f4291ac
--
___
New submission from Arve Knudsen arve.knud...@gmail.com:
httplib doesn't specify the HTTP header 'content-length' for POST requests
without data. Conceptually this makes sense, considering the empty content.
However, IIS (7.5) servers don't accept such requests and respond with a 411
status
Eric V. Smith e...@trueblade.com added the comment:
The patch looks good to me.
Are there any places in the current code base that would use P? p seems the
more useful case.
Are you planning on changing existing code to use P or p, or just use it going
forward?
--
nosy: +eric.smith
Marc-Andre Lemburg m...@egenix.com added the comment:
Mac OS X 10.4 is also affected and for the same reason. SQLite builds fine for
Python 2.5 and 2.6, but not for 2.7.
--
nosy: +lemburg
title: 2.7.3: sqlite module does not build on centos 5 - 2.7.3: sqlite module
does not build on
Mark Dickinson dicki...@gmail.com added the comment:
I also think that 'P' looks too strict to be really useful. I can't think of
too many cases where I'd really want to insist on a boolean argument (and
reject values of 0 or 1).
Maybe implement just 'p' for now and consider 'P' later?
Richard Oudkerk shibt...@gmail.com added the comment:
There is another problem causing a fatal error in test_posix on Unix.
The attached patch fixes it: *ua-path should be decrefed not ua-path.
--
Added file: http://bugs.python.org/file25452/utime_read_time_arguments.patch
Larry Hastings la...@hastings.org added the comment:
Looks good to me. You're a core contributor, yes? If not let me know and I'll
commit it.
Though I must admit I'm baffled how I haven't seen that crash. I've run the
unit tests a zillion times on this patch.
--
Richard Oudkerk shibt...@gmail.com added the comment:
Looks good to me. You're a core contributor, yes? If not let me know and
I'll commit it.
I will commit.
Though I must admit I'm baffled how I haven't seen that crash. I've run
the unit tests a zillion times on this patch.
Were you
Larry Hastings la...@hastings.org added the comment:
By the unit tests I meant I ran the whole suite: Lib/test/regrtest.py. I
know that runs test_os, and I assume it runs test_posix too.
I just ran test_posix by hand and it passed.
I'm developing on Linux (64-bit) in case that helps.
Larry Hastings la...@hastings.org added the comment:
I looked through the Python sources and couldn't find any instances of a
function or method with an argument that only allowed you to pass in either
True or False.
Serily already said he would use 'P' over 'p', although I too am
Richard Oudkerk shibt...@gmail.com added the comment:
I'm developing on Linux (64-bit) in case that helps.
I tested it on 32 bit Linux.
I have committed it, but I forgot to put the issue number in the commit message.
--
___
Python tracker
Martin v. Löwis mar...@v.loewis.de added the comment:
Revision 4deb7c1f49b9
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14127
___
___
Martin v. Löwis mar...@v.loewis.de added the comment:
I think there should be a test case also where PyObject_IsTrue gives an
exception (which I think can happen if __bool__ raises an exception).
--
nosy: +loewis
___
Python tracker
Larry Hastings la...@hastings.org added the comment:
I think there should be a test case also where PyObject_IsTrue gives an
exception (which I think can happen if __bool__ raises an exception).
I'd be happy to add such a test, but I don't know of any types like that. Can
anyone suggest
Martin v. Löwis mar...@v.loewis.de added the comment:
I think there should be a test case also where PyObject_IsTrue gives an
exception (which I think can happen if __bool__ raises an exception).
I'd be happy to add such a test, but I don't know of any types like
that. Can anyone suggest
Larry Hastings la...@hastings.org added the comment:
Added test forcing a failure for 'p' (and 'P'). This made me have to handle
errors a little differently, so it was definitely good to test it. Thanks for
the suggestion, Martin!
Also changed wording in documentation ever-so-slightly.
Eric V. Smith e...@trueblade.com added the comment:
Now that I think about this some more, I think I'd structure the 'p' tests as:
for expr in [False, None, True, 1, 0]: # add the rest
self.assertEqual(bool(expr), getargs_p(expr))
Since the salient point is that 'p' returns the same value
Serhiy Storchaka storch...@gmail.com added the comment:
Serily: why would you unhesitatingly prefer 'P' to 'p'?
My name is Serhiy. :)
'P' has the advantage that you can safely backward-compatibly remove the
restriction by replacing 'P' on 'p'. :)
I also found some funny in-between cases.
Changes by Antoine Pitrou pit...@free.fr:
--
nosy: +ghaering
versions: +Python 2.7, Python 3.3
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14720
___
Serhiy Storchaka storch...@gmail.com added the comment:
Since the salient point is that 'p' returns the same value as bool(), right?
Yes, and bool_new() is a candidate number one for using new feature.
--
___
Python tracker rep...@bugs.python.org
Eric V. Smith e...@trueblade.com added the comment:
If bool_new() is going to use 'p', then my suggestion shouldn't be the only
test of 'p'.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14705
Mark Dickinson dicki...@gmail.com added the comment:
In this line in the patch (Python/getargs.c):
+if (val == -1 || PyErr_Occurred()) {
Isn't that call to PyErr_Occurred() redundant?
--
___
Python tracker rep...@bugs.python.org
Jesús Cea Avión j...@jcea.es added the comment:
Could you provide a patch?
Does this affect 3.x too?
--
nosy: +jcea
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14721
___
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
nosy: +ezio.melotti
stage: - test needed
type: - behavior
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14721
___
Arve Knudsen arve.knud...@gmail.com added the comment:
I can look into patch and 3.x tonight I think. Should I provide a test with an
eventual patch?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14721
New submission from Serhiy Storchaka storch...@gmail.com:
In function convertsimple() in Python/getargs.c possible converting out of
float range value from double to float.
Fortunately, 'f' format character is not used in CPython source code. But it
can be used in the extensions.
Tests will
Jesús Cea Avión j...@jcea.es added the comment:
Patch with test, please :-).
I know it is a pain in the ass, but the result is having a higher quality
python.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14721
Mark Dickinson dicki...@gmail.com added the comment:
I don't think this change should be made for 2.7 or 3.2, since it has potential
to break existing code.
Though technically, conversion of an out-of-range double to a float gives
undefined behaviour (C99 6.3.1.5p2), I'm willing to bet that
Changes by Mark Dickinson dicki...@gmail.com:
--
nosy: +skrah
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14722
___
___
Python-bugs-list mailing
Mark Dickinson dicki...@gmail.com added the comment:
I was just remembering that I was *sure* I'd seen the double-float avoiding
undefined behaviour issue mentioned on a C mailing list not so long ago. Turns
out that there was a good reason for me remembering that...
Changes by Mark Dickinson dicki...@gmail.com:
--
assignee: - mark.dickinson
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14722
___
___
Changes by Antoine Pitrou pit...@free.fr:
--
nosy: +orsenthil
stage: test needed - needs patch
versions: +Python 3.2, Python 3.3
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14721
___
Antoine Pitrou pit...@free.fr added the comment:
Can be reproduced with:
con = sqlite3.connect(:memory:, detect_types=sqlite3.PARSE_DECLTYPES)
cur = con.cursor()
cur.execute(CREATE TABLE t (x TIMESTAMP))
sqlite3.Cursor object at 0x7f90a4f69ea0
cur.execute(INSERT INTO t (x) VALUES
Piotr Dobrogost p...@bugs.python.dobrogost.net added the comment:
Fiddler reports that it receives the following headers for the POST request
Python 3.2.3 on Windows Vista 64bit gives the same output for
import http.client
conn = http.client.HTTPConnection('localhost',)
conn.request(POST,
Changes by Éric Araujo mer...@netwok.org:
--
nosy: +eric.araujo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14721
___
___
Python-bugs-list
Changes by Éric Araujo mer...@netwok.org:
--
nosy: +eric.araujo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14710
___
___
Python-bugs-list
Vinay Sajip vinay_sa...@yahoo.co.uk added the comment:
I'd like to commit this soon. Any chance of a review? It's a very small patch,
so it shouldn't need much time.
--
keywords: +needs review -patch
___
Python tracker rep...@bugs.python.org
Antoine Pitrou pit...@free.fr added the comment:
64-bit Linux, Intel Core i5-2500K CPU @ 3.30GHz:
vanilla 3.3 patch 2 patch 3
utf-8 'A'*1 6931 (+3%)7115 (+0%) 7117
utf-8 'A'*+'\x80'
Changes by Éric Araujo mer...@netwok.org:
--
nosy: +eric.araujo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14703
___
___
Python-bugs-list
Changes by Éric Araujo mer...@netwok.org:
--
nosy: +eric.araujo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14693
___
___
Python-bugs-list
Martin v. Löwis mar...@v.loewis.de added the comment:
Please go ahead and apply it.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14093
___
___
Arve Knudsen arve.knud...@gmail.com added the comment:
Which HTTP methods should we auto-define content-length for? POST and PUT? I
noticed that my first attempt at a patch would define content-length also for
GET requests, which broke a unit test (test_ipv6host_header).
--
Antoine Pitrou pit...@free.fr added the comment:
Looks ok to me, but I don't have a system with os.chflags to test on.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14662
___
Brett Cannon br...@python.org added the comment:
I should mention I have a version from importers that is probably out-of-date:
http://code.google.com/p/importers/source/browse/importers/zip.py
--
___
Python tracker rep...@bugs.python.org
Antoine Pitrou pit...@free.fr added the comment:
I agree that Martin that it's not a good idea to add dead code.
Furthermore, you patch has:
+#ifndef _PY_EMULATED_WIN_CV
+#define _PY_EMULATED_WIN_CV 0 /* use emulated condition variables */
+#endif
+
+#if !defined NTDDI_VISTA || NTDDI_VERSION
Antoine Pitrou pit...@free.fr added the comment:
+1 for deprecating.
--
nosy: +pitrou
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14711
___
___
Changes by Brett Cannon br...@python.org:
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2377
___
___
Antoine Pitrou pit...@free.fr added the comment:
Quinn, are you planning to work on an updated patch?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11943
___
Serhiy Storchaka storch...@gmail.com added the comment:
I also thought about ±∞. But PyLong_AsDouble() raises OverflowError for
out-of-range value. And it checks strictly out of ±DBL_MAX.
Because float(10**1000) returns no float('inf'), but raises an
exception, I think that returning ±∞ will be
Changes by Terry J. Reedy tjre...@udel.edu:
--
title: json.joads parse_constant callback not working anymore - json.loads
parse_constant callback not working anymore
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14692
Mark Dickinson dicki...@gmail.com added the comment:
And it checks strictly out of ±DBL_MAX.
Nope. Values just larger than DBL_MAX won't raise OverflowError here.
Because float(10**1000) returns no float('inf'), but raises an
exception, I think that returning ±∞ will be wrong.
Possibly.
Arve Knudsen arve.knud...@gmail.com added the comment:
Actually, when inspecting the HTTP requests sent by Chrome for the different
methods (a great little Chrome app called Postman let me fire requests
manually), I found that content-length would be set for most methods. I could
confirm that
Terry J. Reedy tjre...@udel.edu added the comment:
Just curious, should The parser module provides an interface to Python’s
internal parser and byte-code compiler. say CPython's?
--
nosy: +terry.reedy
___
Python tracker rep...@bugs.python.org
New submission from Mark Theisen mark.thei...@digitecinc.com:
When I run this code: '{0:i}'.format(None)
I get this error:
ValueError: Unknown format code 'i' for object of type 'str'
This seems misleading because None is of Type 'NoneType'. I was expecting the
error to say something to the
Mark Dickinson dicki...@gmail.com added the comment:
Hmm. Possibly, yes. At least, it should be clear somehow from the docs that
the parser, symbol, token and ast modules are CPython specific. (And possibly
tokenize, too.)
--
___
Python tracker
Eric V. Smith e...@trueblade.com added the comment:
This is a duplicate of issue 13790. See the comments there for why it works
this way.
--
nosy: +eric.smith
resolution: - duplicate
status: open - closed
superseder: - In str.format an incorrect error message for list, tuple, dict,
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
nosy: +ezio.melotti
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13790
___
___
Jesús Cea Avión j...@jcea.es added the comment:
HEAD?. It doesn't make sense in HEAD if it doesn't make sense in GET.
Looking around, I found this, to mud the water a little bit more:
http://fixunix.com/tcp-ip/66198-http-rfc-related-question-content-length-0-get-request.html.
Not being
Roundup Robot devn...@psf.upfronthosting.co.za added the comment:
New changeset 257cbd2fac38 by Brett Cannon in branch 'default':
Issue #13959: Re-implement imp.get_suffixes() in Lib/imp.py.
http://hg.python.org/cpython/rev/257cbd2fac38
--
nosy: +python-dev
Roundup Robot devn...@psf.upfronthosting.co.za added the comment:
New changeset 257cbd2fac38 by Brett Cannon in branch 'default':
Issue #13959: Re-implement imp.get_suffixes() in Lib/imp.py.
http://hg.python.org/cpython/rev/257cbd2fac38
--
___
Python
Brett Cannon br...@python.org added the comment:
OK, I'm waiting on issue #14657 (avoiding the _frozen_importlib/importlib
dichotomy) is resolved before I document the new imp.extension_suffixes() as it
would be good to know where I should pull in the source and bytecode suffixes.
I think
Serhiy Storchaka storch...@gmail.com added the comment:
Here is a patch with tests.
Nope. Values just larger than DBL_MAX won't raise OverflowError here.
Isn't that a little bit. But values that rounded to DBL_MAX can raise
OverflowError. In any case it's too difficult to achieve strict
Changes by Serhiy Storchaka storch...@gmail.com:
--
type: - enhancement
versions: -Python 2.7, Python 3.2
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14722
___
Arve Knudsen arve.knud...@gmail.com added the comment:
Here's my initial proposal for a patch against httplib, based on the 2.7 branch
of cpython repository. I've included a couple of tests, which check that when
content is empty, content-length is set to 0 for certain methods (POST/PUT etc)
Arve Knudsen arve.knud...@gmail.com added the comment:
Yes, I agree it doesn't make much sense for HEAD AFAICT, but Chrome does it.
Maybe there's a reason?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14721
Mark Dickinson dicki...@gmail.com added the comment:
But values that rounded to DBL_MAX can raise
OverflowError. In any case it's too difficult to achieve strict behavior
in this corner case.
Well, PyLong_AsDouble *does* achieve strict behaviour in this corner case :-).
Integers less than
Roundup Robot devn...@psf.upfronthosting.co.za added the comment:
New changeset 4459d82ff127 by Vinay Sajip in branch 'default':
Closes #14093: Added Mercurial version information to Windows builds.
http://hg.python.org/cpython/rev/4459d82ff127
--
nosy: +python-dev
resolution: - fixed
Brett Cannon br...@python.org added the comment:
FYI, I just deleted PC/import_nt.c as it stopped compiling after my removal of
_imp.get_suffixes(). Obviously hg has the history of the file so if someone
needs to resurrect it there shouldn't be much issue.
--
Roundup Robot devn...@psf.upfronthosting.co.za added the comment:
New changeset 22b0689346f9 by Brett Cannon in branch 'default':
Issue #13959: Move module type constants to Lib/imp.py.
http://hg.python.org/cpython/rev/22b0689346f9
--
___
Python
Ned Deily n...@acm.org added the comment:
I will test and check it in next week if still open.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14662
___
Brett Cannon br...@python.org added the comment:
+1
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14724
___
___
Python-bugs-list mailing list
New submission from Antoine Pitrou pit...@free.fr:
imp.load_dynamic's third optional argument doesn't seem used in the wild, and I
don't think it's correctly implemented by the current code.
It would seem reasonable to kill it.
--
components: Interpreter Core, Library (Lib)
messages:
New submission from Antoine Pitrou pit...@free.fr:
There was this failure on one of the XP buildbots:
Process Process-269:
Traceback (most recent call last):
File
D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\multiprocessing\process.py,
line 258, in _bootstrap
self.run()
New submission from Gregory P. Smith g...@krypto.org:
Lib/email/*.py are fond of using
EMPTYSTRING = ''
and within the code:
EMPTYSTRING.join(...)
instead of just writing:
''.join(...)
They should just do the latter. It'll avoid a name lookup and look less silly
to people reading
R. David Murray rdmur...@bitdance.com added the comment:
I've always wondered why the code did that. If Barry doesn't have a good
reason for it, I'll refactor it at some point.
--
assignee: - r.david.murray
nosy: +barry, r.david.murray
type: - performance
R. David Murray rdmur...@bitdance.com added the comment:
There is a test_tools file now. test_unparse could be called from it.
--
nosy: +r.david.murray
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14695
R. David Murray rdmur...@bitdance.com added the comment:
Hynek: it doesn't seem like that would work, since legitimate EPERM errors are
much more likely.
--
nosy: +r.david.murray
___
Python tracker rep...@bugs.python.org
Barry A. Warsaw ba...@python.org added the comment:
On May 05, 2012, at 01:25 AM, R. David Murray wrote:
I've always wondered why the code did that. If Barry doesn't have a good
reason for it, I'll refactor it at some point.
A long time ago, Tim (IIRC) expressed an opinion that using the
90 matches
Mail list logo