New submission from Cal Leeming:
Originally posted here:
http://stackoverflow.com/q/33873243/1267398
The problem is caused by this line:
# For -m switch, just display the exception
info = str(exc)
Caused by the following commit in 2008;
https://mail.python.org/pipermail/python
New submission from Cal Leeming:
There was a discussion/patch in #9754 [1].
This allows for multiple warning types as a tuple, e.g.;
self.assertWarnsRegex((DeprecationWarning, RuntimeWarning), "^E1000:")
However, it does not allow testing for multiple warning messages, e.g.;
New submission from Cal Leeming:
There are several flags which can be provided to Sqlite3 during connection [1].
Alternative libraries such as apsw provide the ability to use these flags [2],
however it would be nice if `sqlite3` supported this out of the box.
Is there any reason why the
New submission from Cal Leeming:
The documentation states that pkgutil.walk_packages() path must be None or a
list of paths [1]. After passing in a string, the result was a blank list
rather than a type error or automatic conversion to a list.
If this method is documented that it must only
Cal Leeming added the comment:
Any update on this? Still seems to be a problem as of 3.4.0.
--
nosy: +sleepycal
___
Python tracker
<http://bugs.python.org/issue16
Changes by Cal Leeming :
--
status: open -> pending
___
Python tracker
<http://bugs.python.org/issue16609>
___
___
Python-bugs-list mailing list
Unsubscri
Cal Leeming added the comment:
Actually, you do have a good point, this should have been using
random.getrandbits really.
--
status: pending -> open
___
Python tracker
<http://bugs.python.org/issu
Cal Leeming added the comment:
Many thanks for your lengthy response David.
Sorry, my initial bug report stated it was Python 2.7. The tests I performed
were actually on Python 2.6.6.
I will take a look at how to contribute documentation updates, and once I've
familiarized myself wi
Cal Leeming added the comment:
Normally I would concur, but casting random.random() to a string is commonly
used, and people aren't going to read the entire floating point arithmetic page
to figure this out. And even if they do, that page still doesn't make it
entirely obvious at
Cal Leeming added the comment:
As stated before, I have already read this document.
This ticket is specifically about making users aware of this behaviour in the
form of a documentation update on the random.random() docs.
The link you provided does not exactly make this very clear
New submission from Cal Leeming:
Hello,
Today I came up against a strange problem where collisions were being
encountered after less than 1mil iterations when attempting to use
random.random().
After much digging, the problem was because I was casting my float to a string,
and this was
Cal Leeming added the comment:
@david Gotcha - I had a feeling that would be the case. Thank you for the quick
replies anyway guys! Hopefully this will help others in the future :)
--
___
Python tracker
<http://bugs.python.org/issue15
Cal Leeming added the comment:
Okay, just found the reason for this.. It's because I was putting a .read() on
the file descriptor..
I really think that the CSVReader should raise an assertion in the event that
it is passed an object which has no iterator, or if it is given a string, as
Cal Leeming added the comment:
This bug also seems to be showing in 2.7.3
--
___
Python tracker
<http://bugs.python.org/issue15407>
___
___
Python-bugs-list m
Cal Leeming added the comment:
Sorry, accidently pasted the wrong code snippet previously. The correct code
snippet is:
datx = open("data.txt", "rb").read()
rows = csv.reader( datx )
for row in rows:
print x
--
___
P
New submission from Cal Leeming :
Getting some extremely strange behavior when attempting to parse a fairly
standard CSV in Python 2.6.6.
I've tried a whole different mixture of dialects, quoting options, line
terminators etc, and none seem to get a happy ending.
Spent about 2 hours ba
Cal Leeming added the comment:
Oh - and while we are at it - how about having merge_list() and unique_list()
as part of the core too??
def unique_list(seq): # Dave Kirby
# Order preserving
seen = set()
return [x for x in seq if x not in seen and not seen.add(x)]
def
New submission from Cal Leeming :
After a while of digging around, I noticed that the core libs don't provide an
easy way of splitting a list/tuple into chunks - as per the following
discussion:
http://www.aspwinhost.com/In-what-way-do-you-split-an-list-into-evenly-sized-chunks-on-P
Cal Leeming added the comment:
Thats full understandable that the default won't change. I'll put this in my
todo list to write a patch in a week or two.
On 1 Jul 2011 08:45, "R. David Murray" wrote:
>
> R. David Murray added the comment:
>
> Quoting http://too
Cal Leeming added the comment:
Damn 3.3 huh? Ah well, at least it's in the pipeline ^_^
Thanks for your help on this @r.david.murray!
--
___
Python tracker
<http://bugs.python.org/is
Cal Leeming added the comment:
So @r.david.murray, it would appear you were right :D Really, I should have
looped through each method on str(), and wrapped them all to see which were
being called, but lesson learned I guess.
Sooo, I guess now the question is, can we possibly get a vote on
Cal Leeming added the comment:
(short answer, I found the cause, and a suitable monkey patch) - below are
details of how I did it and steps I took.
-
Okay so I forked AbstractHTTPHandler() then patched do_request_(), at which
point "request.headers" and request.header_items(
Cal Leeming added the comment:
Sorry, I should clarify.. The str() patch worked, but it failed to work within
the realm of urllib2:
s = _str("Content-MD5")
print "Builtin:"
print "plain: %s" % ( s )
print "capitalized: %s" % ( s.capitalize()
New submission from Cal Leeming :
I came up against a problem today whilst trying to submit a request to a remote
API. The header needed to contain:
'Content-MD5' : "md5here"
But the urllib2 Request() forces capitalize() on all header names, and
transformed it into &qu
Cal Leeming added the comment:
Oh jeez, you're going to think I'm such an idiot. I just ran a completely fresh
test in the cli (away from the original source), and the issue disappeared (it
was caused by caching - apparently).
I'm really sorry to have bothered you guys, I shou
Cal Leeming added the comment:
Take particular notice to the following:
\.co\.uk
or
literal 99
literal 111
literal 46
literal 117
literal 107
>>> map(lambda x: chr(x), [99,111,46,117,107])
['c', 'o', '.', 'u'
Changes by Cal Leeming :
--
type: -> behavior
___
Python tracker
<http://bugs.python.org/issue12325>
___
___
Python-bugs-list mailing list
Unsubscri
New submission from Cal Leeming :
I believe I might have found a bug in the Python re libraries. Here is a
complete debug of what is happening (my apologies for the nature of the actual
text). I have ran this regex through RegexBuddy (and a few other tools), and
all of them do the correct
Cal Leeming added the comment:
Ah okay, shell=True is a good work around then :)
Thanks!
Cal
--
___
Python tracker
<http://bugs.python.org/issue12235>
___
___
Cal Leeming added the comment:
Yeah, I resolved the issue already. This bug report is focused primarily on the
(somewhat misleading) exception message given back.
I think it should at least include "bad interpreter", otherwise it is a tad
mislea
Cal Leeming added the comment:
Oh also, here is the version:
simplicitymedialtd@sws01.internal [~/webapps/cdn06.prod/src/webapp/cmd] >
python
Python 2.7 Stackless 3.1b3 060516 (release27-maint, Aug 29 2010, 15:44:48)
[GCC 4.3.2] on linux2
Type "help", "copyright", &qu
New submission from Cal Leeming :
If you attempt to call subprocess.check_output() on a file which is not
executable, it gives a "file not found" exception, rather than "file not
executable". Took me about 3 hours to figure out why it kept saying the file
didn't e
New submission from Cal Leeming :
So, when you create a class like this:
class Obj:
children = []
The 'children' object essentially becomes shared across all instances of Obj.
To get around this, you have to use:
class Obj:
children = None
def __init__(self):
33 matches
Mail list logo