Re: Tabs for indentation Spaces for alignment in Python 3?

2014-12-06 Thread Marko Rauhamaa
Michael Torrie torr...@gmail.com: In fact a decent editor that is auto-indenting code would, at least in C or C++ mode, do that automatically. A decent editor frees you from this dilemma entirely: (custom-set-variables '(indent-tabs-mode nil)) HT belongs together with VT, SOH and

Re: Parsing XML Using XPATH for Python

2014-12-06 Thread Uzoma Ojemeni
On Tuesday, December 2, 2014 11:52:37 PM UTC+1, John Gordon wrote: In a1a70942-6740-4de5-b41e-57a71fb36...@googlegroups.com Uzoma Ojemeni uojem...@gmail.com writes: I am new to Python - a few days old - and I would appreciate some help. I want write a python code to parse the below XML

Re: Tabs for indentation Spaces for alignment in Python 3?

2014-12-06 Thread Michael Torrie
On 12/06/2014 01:40 AM, Marko Rauhamaa wrote: Michael Torrie torr...@gmail.com: In fact a decent editor that is auto-indenting code would, at least in C or C++ mode, do that automatically. A decent editor frees you from this dilemma entirely: (custom-set-variables

Re: Tabs for indentation Spaces for alignment in Python 3?

2014-12-06 Thread Chris Angelico
On Sun, Dec 7, 2014 at 3:41 AM, Michael Torrie torr...@gmail.com wrote: What dilemma? Do you mean you can avoid the drama of tabs by going all spaces? Of course in Python this is the recommended course. Actually it's only one of several recommended courses, but otherwise yes. :) ChrisA --

Re: Tabs for indentation Spaces for alignment in Python 3?

2014-12-06 Thread Marko Rauhamaa
Michael Torrie torr...@gmail.com: What dilemma? Do you mean you can avoid the drama of tabs by going all spaces? Of course in Python this is the recommended course. But that's typically not what I, or most people, use in C or C++. Most people? Hm. I don't know most people. Anyway. Who

Re: Tabs for indentation Spaces for alignment in Python 3?

2014-12-06 Thread Michael Torrie
On 12/06/2014 09:57 AM, Marko Rauhamaa wrote: And one of the OP's points is that by using tabs for indent, and spaces for alignment, you can have the best of both worlds. I certainly doesn't sound that way. Why is that? Programmers can set their tab size to anything they want, and it

Re: Tabs for indentation Spaces for alignment in Python 3?

2014-12-06 Thread Simon Ward
On 6 December 2014 03:04:48 GMT+00:00, Michael Torrie torr...@gmail.com wrote: On 12/05/2014 07:31 PM, Ned Batchelder wrote: This is a perfect example! The code (with tabs as --- and leading spaces as .) is: ---if (!list_empty(pending)) --ret =

Re: Tabs for indentation Spaces for alignment in Python 3?

2014-12-06 Thread Michael Torrie
On 12/06/2014 10:12 AM, Simon Ward wrote: Not every programmer is as conscientious in the first of place, and that's far easier to get wrong than just agreeing to stick to one thing. This is why (often more rigid) style guides (or rather policies) exist. Sure, but in the world of braces

Re: Tabs for indentation Spaces for alignment in Python 3?

2014-12-06 Thread Marko Rauhamaa
Michael Torrie torr...@gmail.com: So obviously your zigzaggy diffs are showing that the person who wrote the code is *not* using tabs for indent and spaces for alignment. Source code lives easily for ten years or longer. It is touched by numerous people in different groups or even companies

Re: jitpy - Library to embed PyPy into CPython

2014-12-06 Thread Albert-Jan Roskam
On Fri, Dec 5, 2014 8:54 PM CET Mark Lawrence wrote: For those who haven't heard thought this might be of interest https://github.com/fijal/jitpy Interesting, but it is not clear to me when you would use jitpy instead of pypy. Too bad pypy alone was not included

Re: jitpy - Library to embed PyPy into CPython

2014-12-06 Thread Sturla Molden
Albert-Jan Roskam fo...@yahoo.com.dmarc.invalid wrote: Interesting, but it is not clear to me when you would use jitpy instead of pypy. Too bad pypy alone was not included in the benchmarks (cython would have also been nice). And Numba can JIT compile this far better than PyPy and jitpy.

[issue22935] Disabling SSLv3 support

2014-12-06 Thread STINNER Victor
STINNER Victor added the comment: The documentation should be modified to explain that SSLv2 and SSLv3 are not always available. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22935 ___

[issue22919] Update PCBuild for VS 2015

2014-12-06 Thread Zachary Ware
Zachary Ware added the comment: Sorry Steve, I haven't been on Windows since my last review to give it another try. And, of course, somewhere in the 5 seconds between shutting down from Gentoo and turning back on for Windows last night, my laptop decided that POSTing was just too much effort,

[issue23000] More support for Visual Studio users on Windows?

2014-12-06 Thread StoreIntegrator
New submission from StoreIntegrator: Hi, When using Python on Windows I always encounter plenty of errors which are simply frustrating. Typically issues compilation, linking, libraries which have nothing to do with functional coding in Python are numerous. Do have a look at PTVS tools how an

[issue22985] Segfault on time.sleep

2014-12-06 Thread Omer Katz
Omer Katz added the comment: So why exactly the program terminates on a system call? 2014-12-05 23:44 GMT+02:00 STINNER Victor rep...@bugs.python.org: STINNER Victor added the comment: Program received signal SIGTERM, Terminated. SIGTERM is not a segmentation fault. SIGSEGV is for

[issue23000] More support for Visual Studio users on Windows?

2014-12-06 Thread SilentGhost
SilentGhost added the comment: This seem like an issue with numpy, not python. Perhaps installing using binary would be a better option for you? In any case, this need further elaborating at what the actual problem and the solution could be. -- nosy: +SilentGhost resolution: - not a

[issue20220] TarFile.list() outputs wrong time

2014-12-06 Thread David Edelsohn
David Edelsohn added the comment: There now are two zLinux buildbots: zlinux (running SUSE) and zwheezy (running Debian). zlinux (running on SUSE) has the libc problem causing the timezone error. A second buildbot was added, not converting or upgrading the existing buildbot. I still would

[issue23001] Accept mutable bytes-like objects

2014-12-06 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Some builtins accept only read-only bytes-like objects (PyArg_Parse format codes s#, z#, y, and y#). Proposed patch makes them accepting also mutable bytes-like objects such as bytearray. I'm not sure that all these changes are useful, but in some cases

[issue23000] More support for Visual Studio users on Windows?

2014-12-06 Thread R. David Murray
R. David Murray added the comment: Note also that there are going to be significant improvements in the Python Windows build system for 3.5. Any further (specific, non-distutils) requests for improvement should be targeted against that version once issue 22919 has been integrated. Please do

[issue23001] Accept mutable bytes-like objects

2014-12-06 Thread Josh Rosenberg
Josh Rosenberg added the comment: In the event of calls back into Python code in multithreaded execution (or GIL release), this would mean you no longer have guarantees as to the contents (or even the validity) of the pointer you get back. I'd think the only safe way to accept mutable buffers

[issue22153] Documentation of TestCase.runTest is incorrect and confusing

2014-12-06 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- nosy: +berker.peksag stage: patch review - commit review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22153 ___

[issue22985] Segfault on time.sleep

2014-12-06 Thread Omer Katz
Omer Katz added the comment: Capturing the signal provides the following traceback: File mt_example.py, line 10, in module p1 = ThreadPool() File /home/omer/.virtualenvs/billiard/lib/python2.7/site-packages/billiard/pool.py, line 1016, in __init__ self._result_handler.start() File

[issue22919] Update PCBuild for VS 2015

2014-12-06 Thread Steve Dower
Steve Dower added the comment: Rebased everything onto default and pushed it to my sandbox. -- hgrepos: +283 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22919 ___

[issue22919] Update PCBuild for VS 2015

2014-12-06 Thread Steve Dower
Changes by Steve Dower steve.do...@microsoft.com: -- hgrepos: -283 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22919 ___ ___ Python-bugs-list

[issue22919] Update PCBuild for VS 2015

2014-12-06 Thread Steve Dower
Steve Dower added the comment: Having trouble getting the patch uploaded... next attempt. -- Added file: http://bugs.python.org/file37374/round5complete.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22919

[issue9351] argparse set_defaults on subcommands should override top level set_defaults

2014-12-06 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- resolution: fixed - stage: commit review - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9351 ___

[issue23001] Accept mutable bytes-like objects

2014-12-06 Thread Ethan Furman
Changes by Ethan Furman et...@stoneleaf.us: -- nosy: +ethan.furman ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23001 ___ ___ Python-bugs-list

[issue22939] integer overflow in iterator object

2014-12-06 Thread Clement Rouault
Clement Rouault added the comment: Here is a first try for a patch. There are two points I am not sure about: 1) The message for the OverflowError: is that explicit enough ? 2) The behaviour of the iterator after the raise of OverflowError. With this patch every call to `next(it)` where `it`

[issue22980] C extension naming doesn't take bitness into account

2014-12-06 Thread Steve Dower
Steve Dower added the comment: What can I do to help move this along? It sounds like for Windows builds we could change _imp.extension_suffixes() from ['.pyd'] to ['.{}.pyd'.format(distutils.util.get_platform()), '.pyd'] and update distutils to produce the more specific name (I've got some

[issue23001] Accept mutable bytes-like objects

2014-12-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: That is was the patch does. Convert from s# to s* etc. See also issue22896 about potential bugs with the use of pointers to unlocked buffers. -- ___ Python tracker rep...@bugs.python.org

[issue23002] Trackpad scrolling in tkinter doesn't work on some laptops

2014-12-06 Thread Aivar Annamaa
New submission from Aivar Annamaa: Here's a simple tkinter program, where text can be scrolled by mouse wheel, and by trackpads of some laptops (Macbook Pro, Dell Latitude E5430), but not by trackpads of some other laptops (Lenovo T420). from tkinter import Tk from tkinter import

[issue23002] Trackpad scrolling in tkinter doesn't work on some laptops

2014-12-06 Thread Aivar Annamaa
Aivar Annamaa added the comment: Clarification: In general trackpad scrolling does work on my Lenovo (eg. in Windows Notepad), it just doesn't work in tkinter programs (including IDLE) -- ___ Python tracker rep...@bugs.python.org

[issue23001] Accept mutable bytes-like objects

2014-12-06 Thread Josh Rosenberg
Josh Rosenberg added the comment: Ah, sorry. Should have examined patch. I thought you were making a change to the behavior of s#, z#, y and y#, not converting actual uses of them. Again, sorry. -- ___ Python tracker rep...@bugs.python.org

[issue22980] C extension naming doesn't take bitness into account

2014-12-06 Thread Antoine Pitrou
Antoine Pitrou added the comment: Le 06/12/2014 21:11, Steve Dower a écrit : I suspect any changes here would be completely separate from other platforms, but ISTM that we're looking at a similar change to handle the bitness/debug issue on Linux. I'm not volunteering to do that part :) I

[issue23002] Trackpad scrolling in tkinter doesn't work on some laptops

2014-12-06 Thread Zachary Ware
Zachary Ware added the comment: Sorry, but there's nothing we can do about it; that will be a Tk issue. I'd suggest discussing it with the Tcl/Tk developers, see http://wiki.tcl.tk/1020 -- nosy: +zach.ware resolution: - third party stage: - resolved status: open - closed

[issue22926] asyncio: raise an exception when called from the wrong thread

2014-12-06 Thread Guido van Rossum
Guido van Rossum added the comment: I'm okay with this approach now. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22926 ___ ___

[issue23003] traceback.{print_exc, print_exception, format_exc, format_exception}: Potential AttributeError

2014-12-06 Thread Arfrever Frehtes Taifersar Arahesis
New submission from Arfrever Frehtes Taifersar Arahesis: Usage of some functions from traceback module can result in AttributeError exception in Python 3, while simply printing/returning something with None in Python 2. This regression was introduced in Python 3.0. $ python2.7 -c 'import

[issue23003] traceback.{print_exc, print_exception, format_exc, format_exception}: Potential AttributeError

2014-12-06 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- assignee: - georg.brandl nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23003 ___

[issue22896] Don't use PyObject_As*Buffer() functions

2014-12-06 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22896 ___

[issue23001] Accept mutable bytes-like objects

2014-12-06 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23001 ___

[issue22153] Documentation of TestCase.runTest is incorrect and confusing

2014-12-06 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: Added file: http://bugs.python.org/file37377/runTest2-3.4.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22153 ___

[issue22153] Documentation of TestCase.runTest is incorrect and confusing

2014-12-06 Thread Martin Panter
Martin Panter added the comment: Updated patch, which applies to current tip of the default branch, and includes the formatting fix. Also including a version that applies to the 3.4 branch. Alternatively, if you patch the 3.4 branch it looks like merging to default automatically gives the

[issue22696] Add a function to know about interpreter shutdown

2014-12-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7f3695701724 by Antoine Pitrou in branch 'default': Issue #22696: Add function :func:`sys.is_finalizing` to know about interpreter shutdown. https://hg.python.org/cpython/rev/7f3695701724 -- nosy: +python-dev

[issue22696] Add a function to know about interpreter shutdown

2014-12-06 Thread Antoine Pitrou
Antoine Pitrou added the comment: Using the function in the stdlib can be done separately. I fixed the typo in the docstring. Thanks! -- resolution: - fixed stage: needs patch - resolved status: open - closed ___ Python tracker

[issue22982] BOM incorrectly inserted before writing, after seeking in text file

2014-12-06 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is a patch. -- keywords: +patch stage: - patch review versions: +Python 3.5 Added file: http://bugs.python.org/file37378/bom_seek_append.patch ___ Python tracker rep...@bugs.python.org

[issue23001] Accept mutable bytes-like objects

2014-12-06 Thread Antoine Pitrou
Antoine Pitrou added the comment: +1 on the principle. I haven't looked at the patch. -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23001 ___

[issue22992] Adding a git developer's guide to Mercurial to devguide

2014-12-06 Thread Antoine Pitrou
Antoine Pitrou added the comment: I was going to say I'm skeptical that we need this but the proposed text is well researched and well written (I'll probably learn something about bookmarks myself, actually). Kudos! -- nosy: +pitrou ___ Python

[issue20603] sys.path disappears at shutdown

2014-12-06 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20603 ___

[issue22696] Add a function to know about interpreter shutdown

2014-12-06 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22696 ___

[issue22980] C extension naming doesn't take bitness into account

2014-12-06 Thread Steve Dower
Steve Dower added the comment: The attached patch adds platform tags for .pyd files for win32, win-arm, win-amd64 and win-ia64, which are the known compilers in pyconfig.h and the potential return values from distutils.util.get_platform(). It also fixes a bug where the suffix would be