[issue9510] sqlite3.Warning isnt a subclass of exceptions.Warning

2010-08-04 Thread Nick Craig-Wood
New submission from Nick Craig-Wood n...@craig-wood.com: sqlite3.Warning isnt a subclass of exceptions.Warning This causes this problem when trying to filter warnings import sqlite3 as DB from warnings import filterwarnings filterwarnings(always, category=DB.Warning) Traceback (most recent

[issue9510] sqlite3.Warning isnt a subclass of exceptions.Warning

2010-08-04 Thread Nick Craig-Wood
Nick Craig-Wood n...@craig-wood.com added the comment: I've attached a patch to fix the issue along with a revised test. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9510

[issue9510] sqlite3.Warning isnt a subclass of exceptions.Warning

2010-08-04 Thread Nick Craig-Wood
Nick Craig-Wood n...@craig-wood.com added the comment: I re-worked the patch for python 3.x (py3k branch) - the other was for 2.x (trunk) Basically the same patch and fixes the issue according to my testing -- Added file: http://bugs.python.org/file18386/sqlite3-warning-fix-py3k.patch

[issue9510] sqlite3.Warning isnt a subclass of exceptions.Warning

2010-08-05 Thread Nick Craig-Wood
Nick Craig-Wood n...@craig-wood.com added the comment: I think the fact that sqlite may not be using the warnings properly is independent of this problem. Warnings should be filterable, but if sqlite isn't notifying them properly - that would be a different bug. BTW I came across

[issue9510] sqlite3.Warning isnt a subclass of exceptions.Warning

2010-08-05 Thread Nick Craig-Wood
Nick Craig-Wood n...@craig-wood.com added the comment: Reading PEP 0249 I can see Gerhard is correct, this patch would violate the PEP. I think that the PEP is slightly flawed in that users are encouraged to raise exceptions called Warning. IMHO a Warning is never an exceptional condition

[issue5131] pprint doesn't know how to print a defaultdict

2010-09-29 Thread Nick Craig-Wood
Nick Craig-Wood n...@craig-wood.com added the comment: Raymond Hettinger (rhettinger) wrote: Ben, I don't think there is any value is opening more issues like pprint-doesn't-handle-object-x (named tuples, defautdicts, deques, generators, etc). As it is currently designed, pprint doesn't

[issue5131] pprint doesn't know how to print a defaultdict

2010-10-01 Thread Nick Craig-Wood
Nick Craig-Wood n...@craig-wood.com added the comment: Terry J. Reedy (terry.reedy) wrote: IMHO pprint should be able to make a decent job of all the built in types Agreed, already true as far as I know, and irrelevant. This issue is not about built-in types in the builtins module

[issue5131] pprint doesn't know how to print a set or a defaultdict

2009-02-02 Thread Nick Craig-Wood
New submission from Nick Craig-Wood n...@craig-wood.com: I noticed this the other day when debugging a program that neither set() nor defaultdict() pprint() properly Same under 3.1 and 2.5 (Not tried 2.6/2.7 but I assume it is the same) pprint(set(range(100))) set([0, 1, 2, 3, 4, 5, 6, 7, 8

[issue8264] hasattr doensn't show private (double underscore) attributes exist

2010-03-30 Thread Nick Craig-Wood
New submission from Nick Craig-Wood n...@craig-wood.com: I just spend a while tracking down a bug in my code which turned out to be an unexpected behaviour of hasattr. Running this class Test(object): def __init__(self): self.__private = Hello def test(self): print

[issue5131] pprint doesn't know how to print a set or a defaultdict

2009-03-30 Thread Nick Craig-Wood
Nick Craig-Wood n...@craig-wood.com added the comment: I couldn't actually get this patch to apply to the py3k branch :-( $ patch -p0 --dry-run issue_5131.patch patching file Misc/NEWS Hunk #1 FAILED at 2598. 1 out of 1 hunk FAILED -- saving rejects to file Misc/NEWS.rej patching file Misc

[issue5131] pprint doesn't know how to print a set or a defaultdict

2009-03-31 Thread Nick Craig-Wood
Nick Craig-Wood n...@craig-wood.com added the comment: Oops, my bad, I assumed the patch would by for py3k! I applied it to trunk and tested it. It works very well - thank you for fixing that :-) -- ___ Python tracker rep...@bugs.python.org http

[issue24049] Remove unused code in symtable.c and fix docs for import * checking

2015-04-24 Thread Nick Craig-Wood
New submission from Nick Craig-Wood: Here is a patch to remove some unused code in `symtable.c` In Python3 `from x import *` was banned from use in functions completely. This is detected by `symtable_visit_alias` if (st-st_cur-ste_type != ModuleBlock) { int lineno = st