[issue18535] termios.tcgetattr should return namedtuple

2013-07-23 Thread anatoly techtonik
anatoly techtonik added the comment: I've made my own monster, attached. -- Added file: http://bugs.python.org/file31026/DictRecord.py ___ Python tracker ___

[issue18533] Avoid error from repr() of recursive dictview

2013-07-23 Thread Ben North
Ben North added the comment: New patch, fixing nit noted in msg193624: non-error-recursive-dictview-3.3-1.patch Otherwise same as previous non-error-recursive-dictview-3.3.patch -- Added file: http://bugs.python.org/file31025/non-error-recursive-dictview-3.3-1.patch

[issue18534] File "name" attribute should always be a text string

2013-07-23 Thread Nick Coghlan
Nick Coghlan added the comment: Ouch, that complicates matters :( It also occurs to me that given the existence of the "opener" callback, name could be just about any type :P -- ___ Python tracker

[issue18538] `python -m dis ` relying on argparse

2013-07-23 Thread Michele Orrù
Changes by Michele Orrù : -- keywords: +patch Added file: http://bugs.python.org/file31024/issue18538.patch ___ Python tracker ___ ___

[issue18533] Avoid error from repr() of recursive dictview

2013-07-23 Thread STINNER Victor
STINNER Victor added the comment: non-error-recursive-dictview-3.3.patch: small nit, initialize result to NULL, instead of setting it to NULL only in case of error. It makes the code more readable and it is the common coding style to handle errors. -- _

[issue18538] `python -m dis ` relying on argparse

2013-07-23 Thread STINNER Victor
STINNER Victor added the comment: Please attach your patch separatly. -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mail

[issue18519] test_sqlite crashes on OS X tiger 3.x buildbot

2013-07-23 Thread R. David Murray
R. David Murray added the comment: OK, this makes much more sense to me now :) I take it the overflow error is the only one the C code could ever raise? If so, the patch looks good to me. -- ___ Python tracker _

[issue18538] `python -m dis ` relying on argparse

2013-07-23 Thread Michele Orrù
New submission from Michele Orrù: I feel a little bit embarassed for this patch; while reading the stdlib's Lib/dis.py file, I saw that the _test() function parses by itself sys.argv. I tried to clean it up using argparse; diff and "manual tests" attached. -- title: `python -m dis ` -

[issue18538] `python -m dis `

2013-07-23 Thread Michele Orrù
Changes by Michele Orrù : -- components: Library (Lib) nosy: maker priority: normal severity: normal status: open title: `python -m dis ` type: enhancement versions: Python 3.5 ___ Python tracker __

[issue18533] Avoid error from repr() of recursive dictview

2013-07-23 Thread Ben North
Ben North added the comment: New patch including tests attached, against 3.3. Terry Reedy's example above now gives >>> d = {} >>> d[1] = d.keys() >>> d[2] = d.values() >>> d {1: dict_keys([1, 2]), 2: dict_values([dict_keys([1, 2]), ...])} which I think is preferable. Summ

[issue14853] test_file.py depends on sys.stdin being unseekable

2013-07-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: Elena, your patch looks ok to me, thank you. Could you sign a contributor's agreement? http://www.python.org/psf/contrib/ (or have you already done so?) -- ___ Python tracker _

[issue18521] [cppcheck] Full report

2013-07-23 Thread Ronald Oussoren
Ronald Oussoren added the comment: It doesn't really live up to its description. >From the start of the 'filtered' list: * Messages about PyThread_acquire_lock appear to be false positives, that name is a function that's called by the macros expanded on those lines. * Syntax error in _ctyp

[issue791968] Arguments tooltip wrong if def contains tuple

2013-07-23 Thread Ned Deily
Ned Deily added the comment: Ariel, if you think there is a problem, please open a new issue with all the pertinent information. This issue was closed long ago. -- nosy: +ned.deily ___ Python tracker ___

[issue18534] File "name" attribute should always be a text string

2013-07-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Seconded Antoine. -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue17899] os.listdir() leaks FDs if invoked on FD pointing to a non-directory

2013-07-23 Thread Larry Hastings
Larry Hastings added the comment: I swear I've seen a compiler where you couldn't assign to errno. But now I'm pretty sure it was MSVC, and possibly a version back in the 90s. So I'm happy to live in a world where errno is an lvalue. -- ___ Python

[issue18537] bool.toggle()

2013-07-23 Thread Eric V. Smith
Eric V. Smith added the comment: If that's your concern, you can use operator.not_. >>> import operator >>> filter(operator.not_, [False, True, False, False, True]) [False, False, False] -- ___ Python tracker

[issue18521] [cppcheck] Full report

2013-07-23 Thread Julien Nabet
Julien Nabet added the comment: quotation from http://en.wikipedia.org/wiki/Cppcheck : " Cppcheck is a static code analysis tool for the C and C++ programming languages " or from http://cppcheck.sourceforge.net/ " Cppcheck is a static analysis tool for C/C++ code. Unlike C/C++ compilers and many

[issue18537] bool.toggle()

2013-07-23 Thread James Lu
James Lu added the comment: well, filter() could take the function not lambda x:not x james On Tue, Jul 23, 2013 at 12:23 PM, Eric V. Smith wrote: > > Eric V. Smith added the comment: > > Since it would be the same as "not value", I can't imagine this would be > added to the language. > >

[issue18537] bool.toggle()

2013-07-23 Thread Eric V. Smith
Eric V. Smith added the comment: Since it would be the same as "not value", I can't imagine this would be added to the language. -- ___ Python tracker ___ __

[issue18537] bool.toggle()

2013-07-23 Thread James Lu
James Lu added the comment: I mean, return a value, some people like this style. james On Tue, Jul 23, 2013 at 12:10 PM, Eric V. Smith wrote: > > Eric V. Smith added the comment: > > bool instances are immutable, so all "value.toggle()" could do is the same > as "not value". That is, return a

[issue18537] bool.toggle()

2013-07-23 Thread Eric V. Smith
Eric V. Smith added the comment: bool instances are immutable, so all "value.toggle()" could do is the same as "not value". That is, return a new bool with the "toggled" value. -- nosy: +eric.smith resolution: -> invalid status: open -> closed ___ P

[issue18537] bool.toggle()

2013-07-23 Thread James Lu
New submission from James Lu: the bool type should have a toggle() function -- messages: 193608 nosy: James.Lu priority: normal severity: normal status: open title: bool.toggle() type: enhancement versions: Python 3.5 ___ Python tracker

[issue18211] -Werror=statement-after-declaration problem

2013-07-23 Thread Ronald Oussoren
Ronald Oussoren added the comment: I also don't understand why the optimization level shouldn't be used when building 3th-party extensions. Removing the -O flag for build_ext would be a regression compared to the current behavior because 3th-party extensions would suddenly be compiled with

[issue18460] .chm documentation files advertised in download.html but not there.

2013-07-23 Thread Martin v . Löwis
Changes by Martin v. Löwis : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue18460] .chm documentation files advertised in download.html but not there.

2013-07-23 Thread Martin v . Löwis
Martin v. Löwis added the comment: The CHM files for 2.7.x and 3.3.x are now there. -- ___ Python tracker ___ ___ Python-bugs-list mai

[issue18521] [cppcheck] Full report

2013-07-23 Thread Ronald Oussoren
Ronald Oussoren added the comment: What is cppcheck? The report contains some very dodgy false positives, like: [Modules/_cursesmodule.c:1095]: (style) Variable 'rtn' is assigned a value that is never used. [Modules/_cursesmodule.c:1097]: (style) Unused variable: break 1) The "rtn" is used fu

[issue18512] sys.stdout.write does not allow bytes in Python 3.x

2013-07-23 Thread Martin v . Löwis
Martin v. Löwis added the comment: Rephrasing R.David's question: ntrrgc: Did you consult any documentation (browsing or searching), and if so, where did you look? -- nosy: +loewis ___ Python tracker ___

[issue18520] Fixes bugs found by pyfailmalloc during Python initialization

2013-07-23 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue18458] libedit history offset workaround

2013-07-23 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue18293] ssl.wrap_socket (cert_reqs=...), getpeercert, and unvalidated certificates

2013-07-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: getpeercert() has a crappy API to begin with, but we can't change its behaviour for fear of breaking existing code (and, even, breaking it security-wise). Adding a parameter would make the API even more awful. Which is why I support Christian's idea of exposin

[issue18534] File "name" attribute should always be a text string

2013-07-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: You can never assume that "name" will be a string: >>> f = open(0, "r") >>> f.name 0 This may be a bit of a bad idea API-wise, but changing it now will start breaking code, so I think we should leave it as-is. -- nosy: +aronacher, pitrou

[issue18536] 李浩在 Google+ 上分享了一条信息

2013-07-23 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- resolution: -> invalid status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue18535] termios.tcgetattr should return namedtuple

2013-07-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: Returning a list was probably silly to begin with (a dict would have been more natural). However, I don't think I want to see such a thing as a namedlist in the stdlib. :-( -- nosy: +pitrou ___ Python tracker

[issue18536] 李浩在 Google+ 上分享了一条信息

2013-07-23 Thread 浩 李
New submission from 浩 李: Forwarded conversation Subject: 李浩在 Google+ 上分享了一条信息 From: *李浩 (Google+)* Date: 2013/7/23 To: hk45...@gmail.com 李浩分享了一条信息

[issue15805] Add stdout redirection tool to contextlib

2013-07-23 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On Jul 23, 2013, at 04:24 AM, Alexander Belopolsky wrote: >@contextlib.contextmanager >def redirect_stdout(stream): >old_stdout = sys.stdout >sys.stdout = stream >yield >sys.stdout = old_stdout Make that: @contextlib.contextmanager def redirec

[issue18535] termios.tcgetattr should return namedtuple

2013-07-23 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: namedtuple has a _replace method, but I agree that it would be an incompatible change. "namedlist" someone? class tcattributes(object): __slots__ = ['iflag', 'oflag', 'cflag', 'lflag', 'ispeed', 'ospeed', 'cc'] def __new__(cls, values): s

[issue791968] Arguments tooltip wrong if def contains tuple

2013-07-23 Thread ariel brunner
ariel brunner added the comment: It seems like the solution has caused a different issue: now, when defining a function with factional default arguments, the text replaces the correct values in the tooltip. Here's an example - >>> def f(a=0.5): pass >>> f( tooltip shows - "(a=0)", i

[issue18535] termios.tcgetattr should return namedtuple

2013-07-23 Thread anatoly techtonik
anatoly techtonik added the comment: Actually namedtuple doesn't suit the use case well. The use case is to read termios config, (re)set flags set it back. The attributes should be mutable. -- ___ Python tracker _

[issue18535] termios.tcgetattr should return namedtuple

2013-07-23 Thread anatoly techtonik
New submission from anatoly techtonik: Names of field for tuple returned by tcgetattr are already in documentation at http://docs.python.org/2/library/termios.html It would be nice to get them into code. -- components: Library (Lib) messages: 193595 nosy: techtonik priority: normal sev

[issue17899] os.listdir() leaks FDs if invoked on FD pointing to a non-directory

2013-07-23 Thread Christian Heimes
Christian Heimes added the comment: That's a preliminary report I made a couple of days ago. I posted it on G+ for some friends, it got re-posted by the official Python account and gone viral on Twitter. The interview is tonight. Coverity is probably going to create their own report after the

[issue18526] Add resource management/guarding to unittest

2013-07-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: Does registerResource() mutate some kind of global per-process state? This doesn't sound like a good idea. (and even less so the "default resources", IMO: these are stdlib test suite-specific) -- ___ Python tracker

[issue17496] OS X test for Tk availability in runtktests.py doesn't work

2013-07-23 Thread Ronald Oussoren
Ronald Oussoren added the comment: To respond to my own message: running a small Tcl script is not good enough, the process environment of python itself is also important. In particular, GUI frameworks only work from inside an application bundle (or by using some undocumented private APIs) and

[issue17899] os.listdir() leaks FDs if invoked on FD pointing to a non-directory

2013-07-23 Thread Larry Hastings
Larry Hastings added the comment: Looks like it's too late for Christian, he's already generated the report with Coverity: https://docs.google.com/file/d/0B5wQCOK_TiRiMWVqQ0xPaDEzbkU/edit But I'm still interested in putting this to bed. -- ___ Pyth

[issue8716] test_tk/test_tkk_guionly fails on OS X if run from buildbot slave daemon -- crashes Python

2013-07-23 Thread Ronald Oussoren
Ronald Oussoren added the comment: I just noticed that the Tk tests still get skipped on my machine, and rediscovered this issue. The reason that MacOS.WMAvailable() returns False on the buildbot is because it runs "./python.exe", which is not part of an application bundle and therefore has no

[issue18526] Add resource management/guarding to unittest

2013-07-23 Thread Michael Foord
Michael Foord added the comment: My question is, is this generally useful enough for test suites beyond the Python standard library. Essentially it provides a command line interface to specialized test skipping. I *still* feel that a generalized mechanism for adding command line options to t

[issue18526] Add resource management/guarding to unittest

2013-07-23 Thread Robert Collins
Robert Collins added the comment: I'll do a full review shortly, but at the conceptual level, I don't see any benefit in making a new SkipTest base class, other than instantly breaking other runners when an unknown exception is raised. SkipTest is part of the API. Making a new exception part o

[issue18526] Add resource management/guarding to unittest

2013-07-23 Thread Robert Collins
Changes by Robert Collins : -- nosy: +rbcollins ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyt