[issue20169] random module doc page has broken links

2016-02-18 Thread Roundup Robot
Roundup Robot added the comment: New changeset 2d8e8d0e7162 by Georg Brandl in branch '2.7': Closes #20169: fix inner links random doc. https://hg.python.org/cpython/rev/2d8e8d0e7162 New changeset 426ac89548b3 by Georg Brandl in branch '3.5': Closes #20169: fix inner links random doc.

[issue26385] the call of tempfile.NamedTemporaryFile fails and leaves a file on the disk

2016-02-18 Thread SilentGhost
SilentGhost added the comment: I wonder if Victor could clarify why bare except wasn't used in the python3 version. Anyway, here is the updated patch testing for TypeError as well. -- nosy: +haypo Added file: http://bugs.python.org/file41968/issue26385_2.diff

[issue26374] concurrent_futures Executor.map semantics better specified in docs

2016-02-18 Thread Mark Dickinson
Changes by Mark Dickinson : -- assignee: -> docs@python components: +Documentation -Library (Lib) nosy: +docs@python ___ Python tracker

Re: Ohnoes significant whitespace

2016-02-18 Thread Marko Rauhamaa
Ben Finney : > So I am sympathetic to Python newcomers recoiling in horror from > significant whitespace, *before* they try it. And because of that, we > are burdened with forever needing to deal with that reaction and > soothing it. I remember being *very* doubtful

Weird and sparese cgi:error

2016-02-18 Thread Φώντας Λαδοπρακόπουλος
Hello, I recentely changed VPS server and when i try to load my webiste iam receiving 500 error which i wasnt receiving in my old VPS server with the same exact cgi scripts. After looking at Apacher's error_log iam seeing the following output when i try to load scripts from cgi-bin directory.

[issue23430] socketserver.BaseServer.handle_error() should not catch exiting exceptions

2016-02-18 Thread Martin Panter
Martin Panter added the comment: Thanks for the reivew Berker. I have merged the patch with recent changes and updated according to your comments. -- Added file: http://bugs.python.org/file41967/socketserver-exit.v6.patch ___ Python tracker

[issue16823] Python quits on running tkinter code with threads

2016-02-18 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- versions: +Python 3.5 -Python 3.2, Python 3.3, Python 3.4 ___ Python tracker ___

[issue16823] Python quits on running tkinter code with threads

2016-02-18 Thread Terry J. Reedy
Terry J. Reedy added the comment: If I understand the test code, it creates the tk window in thread 0 (the main thread), generates data in thread 1, sends data via a queue to thread 2, which then inserts it into the Text widget. I ran a 3.x version up to 34000 iterations. When I comment out

Re: [STORY-TIME] THE BDFL AND HIS PYTHON PETTING ZOO

2016-02-18 Thread Ian Kelly
On Mon, Feb 15, 2016 at 7:02 PM, Rick Johnson wrote: > WxPython is not ported either, much to my chagrin. If wxPython "Classic" had just been ported to Python 3, I'm sure it would be all done by now. But it was decided to rebuild wxPython from the ground up instead.

[issue15608] Improve socketserver doc

2016-02-18 Thread Martin Panter
Changes by Martin Panter : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 2.7, Python 3.6 -Python 3.4 ___ Python tracker

[issue15608] Improve socketserver doc

2016-02-18 Thread Roundup Robot
Roundup Robot added the comment: New changeset 9211b7e60c92 by Martin Panter in branch '2.7': Issue #15608: Improve socketserver module documentation https://hg.python.org/cpython/rev/9211b7e60c92 -- ___ Python tracker

Re: Guido on python3 for beginners

2016-02-18 Thread Rustom Mody
On Friday, February 19, 2016 at 6:48:12 AM UTC+5:30, Steven D'Aprano wrote: > > > But apart from that, I think that "teaching" versus "doing" language is a > false dichotomy. Teaching languages should have a shallow learning curve > (easy to get started and learn the language, easy

Re: extending PATH on Windows?

2016-02-18 Thread pyotr filipivich
Dennis Lee Bieber on Thu, 18 Feb 2016 21:57:13 -0500 typed in comp.lang.python the following: >On Thu, 18 Feb 2016 16:24:00 + (UTC), Ulli Horlacher > declaimed the following: > >>Dennis Lee Bieber wrote: >> >>> >I

Re: Passing data across callbacks in ThreadPoolExecutor

2016-02-18 Thread Ian Kelly
On Thu, Feb 18, 2016 at 12:06 PM, Joseph L. Casale wrote: > On Thur, Feb 17, 2016 at 9:24 AM, Ian Kelly wrote: >>> What is the pattern for chaining execution of tasks with ThreadPoolExecutor? >>> Callbacks is not an adequate facility as each task

Re: Guido on python3 for beginners

2016-02-18 Thread Rustom Mody
On Thursday, February 18, 2016 at 9:22:10 PM UTC+5:30, Random832 wrote: > On Thu, Feb 18, 2016, at 07:25, Rustom Mody wrote: > > My beef is somewhat different: viz that post 70s (Pascal) and 80s > > (scheme) > > programming pedagogy has deteriorated with general purpose languages > > replacing >

[issue15608] Improve socketserver doc

2016-02-18 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8b71cd67f548 by Martin Panter in branch '3.5': Issue #15608: Improve socketserver module documentation https://hg.python.org/cpython/rev/8b71cd67f548 New changeset fbb8b634fe59 by Martin Panter in branch 'default': Issue #15608: Merge socketserver

[issue5824] SocketServer.DatagramRequestHandler Broken under Linux

2016-02-18 Thread Martin Panter
Changes by Martin Panter : Added file: http://bugs.python.org/file41965/bind-unix.patch ___ Python tracker ___

[issue5824] SocketServer.DatagramRequestHandler Broken under Linux

2016-02-18 Thread Martin Panter
Changes by Martin Panter : Removed file: http://bugs.python.org/file41964/bind-unix.patch ___ Python tracker ___

[issue5824] SocketServer.DatagramRequestHandler Broken under Linux

2016-02-18 Thread Martin Panter
Martin Panter added the comment: Here is a patch to enable the Unix domain DatagramRequestHandler tests, and bind the client to a socket name. Tests pass for me on Linux :) The Python 2 version will need to have lowercase socketserver changed case to camel-case SocketServer. --

[issue26309] socketserver.BaseServer._handle_request_noblock() doesn't shutdown request if verify_request is False

2016-02-18 Thread Roundup Robot
Roundup Robot added the comment: New changeset cba717fa8e10 by Martin Panter in branch '2.7': Issue #26309: Rewrite test in main thread and avoid race condition https://hg.python.org/cpython/rev/cba717fa8e10 New changeset 537608bafa5a by Martin Panter in branch '3.5': Issue #26309: Rewrite test

[issue26280] ceval: Optimize list

2016-02-18 Thread Zach Byrne
Zach Byrne added the comment: Is it worth handling the exception, or just let it take the slow path and get caught by PyObject_GetItem()? We're still making sure the index is in bounds. Also, where would be an appropriate place to put a macro for adjusting negative indices? --

Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-18 Thread BartC
On 19/02/2016 00:30, Steven D'Aprano wrote: On Thu, 18 Feb 2016 10:32 pm, Chris Angelico wrote: The biggest disadvantage of Python is that, in a number of ways, it surprises people. Significant whitespace bugs a lot of experienced programmers This is why we cannot have nice things. "But

[issue26309] socketserver.BaseServer._handle_request_noblock() doesn't shutdown request if verify_request is False

2016-02-18 Thread Martin Panter
Martin Panter added the comment: Some of the buildbots failed (e.g. ). I think the server is run in a separate thread, and the problem is a race between shutdown_request() being called and

Weird python 2.7 import thing

2016-02-18 Thread Dan Stromberg
OK, I'd rather be on 3.x, but that's not going to happen today. So 2.7. I have added directories to my sys.path hundreds of times before importing from them, and know what to expect from that. I confess, I don't have a lot of package or egg experience. However, I have a somewhat special

[issue26381] Add 'geo' URI scheme (RFC 5870) to urllib.parse.uses_params

2016-02-18 Thread Martin Panter
Martin Panter added the comment: Sounds reasonable to me, and thanks for the reference. But it would be nice to find a way for this to work sensibly with arbitrary schemes, in the same spirit as Issue 18828. Would it break anything if we removed the uses_params list altogether? I notice it

[issue26390] hashlib's pbkdf2_hmac documentation "rounds" does not match source

2016-02-18 Thread Martin Panter
Martin Panter added the comment: Thanks for the patch. The documentation still mentions *rounds* in one place, which I presume was meant to be a direct reference to the parameter. -- nosy: +martin.panter stage: -> patch review versions: -Python 3.4

Re: Guido on python3 for beginners

2016-02-18 Thread Steven D'Aprano
On Fri, 19 Feb 2016 02:51 am, Random832 wrote: > On Thu, Feb 18, 2016, at 07:25, Rustom Mody wrote: >> My beef is somewhat different: viz that post 70s (Pascal) and 80s >> (scheme) >> programming pedagogy has deteriorated with general purpose languages >> replacing >> 'teaching-purpose language'

Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-18 Thread Steven D'Aprano
On Fri, 19 Feb 2016 02:35 am, wrong.addres...@gmail.com wrote: > I am almost eager to do this but want to be sure that I know the pitfalls > in using Python for my purposes. Thanks for your encouraging response. Honestly "wrong.address.1", the ONLY pitfall you need to be aware of is to beware of

[issue26385] the call of tempfile.NamedTemporaryFile fails and leaves a file on the disk

2016-02-18 Thread Martin Panter
Martin Panter added the comment: This looks like an extension of Issue 21058. Does the unlink() work on Windows? It seems to me that the file is configured to remove itself on close(), therefore I expect unlink() will raise an exception of its own. Also made some suggestions in the code

Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-18 Thread Mark Lawrence
On 18/02/2016 11:32, Chris Angelico wrote: On Thu, Feb 18, 2016 at 10:11 PM, wrote: Almost everything points positively for Python. Thanks to all of you who have responded. But please also tell me the disadvantages of Python. If I start using Python, I should be

Ohnoes significant whitespace (was: Considering migrating to Python from Visual Basic 6 for engineering applications)

2016-02-18 Thread Ben Finney
Chris Angelico writes: > I'm talking about how people, those bags of flesh and thoughts, are > bugged out by the notion that *whitespace* should matter (other than > the mere presence/absence of it). It's the price you pay for being > different - people will have trouble

Re: Python keyword args can be any string

2016-02-18 Thread Ben Finney
Steven D'Aprano writes: > A work colleague wanted to pass an argument starting with "-" to a > function. > > Apparently he didn't have a specific argument in mind. He just wanted > to test the function to breaking point by passing invalid argument > names. That seems a

Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-18 Thread Chris Angelico
On Fri, Feb 19, 2016 at 11:30 AM, Steven D'Aprano wrote: > On Thu, 18 Feb 2016 10:32 pm, Chris Angelico wrote: > >> The biggest disadvantage of Python is that, in a number of ways, it >> surprises people. Significant whitespace bugs a lot of experienced >> programmers > >

Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-18 Thread Steven D'Aprano
On Thu, 18 Feb 2016 10:32 pm, Chris Angelico wrote: > The biggest disadvantage of Python is that, in a number of ways, it > surprises people. Significant whitespace bugs a lot of experienced > programmers This is why we cannot have nice things. "But what if we pass the source code through a

[issue26388] Disabling changing sys.argv[0] with runpy.run_module(...alter_sys=True)

2016-02-18 Thread Eric Snow
Eric Snow added the comment: python-dev thread: https://mail.python.org/pipermail/python-dev/2016-February/143374.html Notably: https://github.com/pantsbuild/pex/pull/211 -- nosy: +eric.snow ___ Python tracker

[issue26367] importlib.__import__ does not fail for invalid relative import

2016-02-18 Thread Brett Cannon
Brett Cannon added the comment: If a contribution is insignificant enough then technically a CLA isn't necessary, but I just make it a habit to ask for one regardless. And your profile will probably get updated fairly quickly, so I wouldn't worry about it holding anything up (I'm hoping to

Re: Python keyword args can be any string

2016-02-18 Thread Steven D'Aprano
On Thu, 18 Feb 2016 06:55 pm, Mark Lawrence wrote: > On 18/02/2016 05:42, Steven D'Aprano wrote: >> Today I learned that **kwargs style keyword arguments can be any string: >> >> py> def test(**kw): >> ... print(kw) >> ... >> py> kwargs = {'abc-def': 42, '': 23, '---': 999, '123': 17} >> py>

[issue26390] hashlib's pbkdf2_hmac documentation "rounds" does not match source

2016-02-18 Thread Daan Bakker
New submission from Daan Bakker: The documentation for pbkdf2_hmac at https://docs.python.org/3/library/hashlib.html uses the "rounds" keyword: hashlib.pbkdf2_hmac(name, password, salt, rounds, dklen=None) However, the actual source code uses "iterations". No-one has probably noticed it

[issue26380] Add an http method enum

2016-02-18 Thread Demian Brecht
Demian Brecht added the comment: > BTW I think it is actually OPTIONS; see review comment. Well, don't I feel silly. Fixed. -- Added file: http://bugs.python.org/file41962/issue26380_2.patch ___ Python tracker

[issue26380] Add an http method enum

2016-02-18 Thread Demian Brecht
Demian Brecht added the comment: > I can see the advantage of using an enum over a plain string. But you only > get an error at run time, not compile time, if you misspell it. Sure, but at least you're giving static analysis utilities the chance to catch it up front. > And there is also the

[issue26323] Add assert_called() and assert_called_once() methods for mock objects

2016-02-18 Thread Amit Saha
Amit Saha added the comment: Updated patch with docs and addressed review comments. -- Added file: http://bugs.python.org/file41961/issue26323.patch ___ Python tracker

[issue26367] importlib.__import__ does not fail for invalid relative import

2016-02-18 Thread Manuel Jacob
Manuel Jacob added the comment: Done. I'm a bit surprised this wasn't necessary for my previous two patches, but they were even more trival than this one. ;) Do we have to wait until my tracker profile is updated? -- ___ Python tracker

[issue26389] Expand traceback module API to accept just an exception as an argument

2016-02-18 Thread Brett Cannon
New submission from Brett Cannon: When reading https://docs.python.org/3/library/traceback.html#traceback.print_exception I noticed that everything takes a traceback or a set of exception type, instance, and traceback. But since Python 3.0 all of that information is contained in a single

[issue26367] importlib.__import__ does not fail for invalid relative import

2016-02-18 Thread Brett Cannon
Brett Cannon added the comment: The corresponding code in C that actually does the check: https://hg.python.org/cpython/file/default/Python/import.c#l1498 Manuel, can you sign the CLA at https://www.python.org/psf/contrib/contrib-form/ ? Once you sign it I can officially review your patch,

[issue26388] Disabling changing sys.argv[0] with runpy.run_module(...alter_sys=True)

2016-02-18 Thread Brett Cannon
Changes by Brett Cannon : -- nosy: +ncoghlan ___ Python tracker ___ ___ Python-bugs-list

Re: testfixtures 4.8.0 Released!

2016-02-18 Thread Mark Lawrence
On 18/02/2016 22:27, Chris Withers wrote: Hi All, I'm pleased to announce the release of testfixtures 4.9.0 featuring the following: 4.8.0 or 4.9.0, that is the question, or should it be just how good is your version control? :) -- My fellow Pythonistas, ask not what our language can do

[issue26388] Disabling changing sys.argv[0] with runpy.run_module(...alter_sys=True)

2016-02-18 Thread Mike Kaplinskiy
New submission from Mike Kaplinskiy: For the purposes of pex (https://github.com/pantsbuild/pex), it would be useful to allow calling run_module without sys.argv[0] changing. In general, this behavior is useful if the script intends to re-exec itself (so it needs to know the original

testfixtures 4.8.0 Released!

2016-02-18 Thread Chris Withers
Hi All, I'm pleased to announce the release of testfixtures 4.9.0 featuring the following: - Suffixes and well as prefixes for compare() assertion errors. - Appropriate metadata to indicate official support for Python 3.5. Thanks for Felix Yan for the metadata patch. Thanks to Wim Glenn

Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-18 Thread Dietmar Schwertberger
On 18.02.2016 18:49, wrong.addres...@gmail.com wrote: What do I lose by using an external library? With using matplotlib for your plots, you can easily create many kinds of plots. On the other hand, if integration with MS Office is a concern, other options may be more suitable for you as

Re: [STORY-TIME] THE BDFL AND HIS PYTHON PETTING ZOO

2016-02-18 Thread Chris Angelico
On Fri, Feb 19, 2016 at 8:14 AM, Christian Gollwitzer wrote: > Am 16.02.16 um 03:02 schrieb Rick Johnson: >> >> On Friday, February 12, 2016 at 1:51:35 AM UTC-6, John Ladasky wrote: >>> >>> I like lazy evaluation. >> >> >> Well, it is a "Pythonic feature" no doubt. > > > > ?? I'm

Re: Guido on python3 for beginners

2016-02-18 Thread Sven R. Kunze
On 18.02.2016 07:59, Paul Rubin wrote: Steven D'Aprano writes: I suppose that it is objectively correct that it is harder to learn than Python 2. But I don't think the learning curve is any steeper. If anything, the learning curve is ever-so-slightly less

[issue26380] Add an http method enum

2016-02-18 Thread Martin Panter
Martin Panter added the comment: I can see the advantage of using an enum over a plain string. But you only get an error at run time, not compile time, if you misspell it. And there is also the disadvantage of the extra boilerplate of importing HTTPMessage. So I don’t have a strong opinion

Re: PythonTidy

2016-02-18 Thread cjcollier
Hello Sir! First, thank you for creating this tool. next, I would recommend perltidy as a program to emulate. I'll paste the output of perltidy --help below. http://perltidy.sourceforge.net/ I could probably write a wrapper script to do this if you'd like. Cheers, C.J. $ perltidy --help

Re: [STORY-TIME] THE BDFL AND HIS PYTHON PETTING ZOO

2016-02-18 Thread Christian Gollwitzer
Am 16.02.16 um 03:02 schrieb Rick Johnson: On Friday, February 12, 2016 at 1:51:35 AM UTC-6, John Ladasky wrote: I like lazy evaluation. Well, it is a "Pythonic feature" no doubt. ?? I'm confused. Does Python have lazy evaluation? I thought that Python does eager evaluation. At least this

Re: Guido on python3 for beginners

2016-02-18 Thread John Ladasky
On Wednesday, February 17, 2016 at 11:28:17 PM UTC-8, Chris Angelico wrote: > 5) print statement/function. Py3 forces you to put parentheses on it, > which is no different from C's printf() or Pike's write() or any > number of other languages where console I/O needs no language support. > Maybe a

[issue26379] zlib decompress as_bytearray flag

2016-02-18 Thread Joe Jevnik
Joe Jevnik added the comment: The recipe you showed looks like it is very complicated for the expected use case of decompressing all of the data into a mutable buffer. One difference I see with this and struct.pack_into or socket.recv_into is that in both of those cases we know how large our

Re: Question on keyword arguments

2016-02-18 Thread Tim Chase
On 2016-02-18 10:57, grsm...@atlanticbb.net wrote: > Tim, the 'crazy-other-result format' is the > result returned by the database, nothing > I can do about that :) then, much like converting byte-strings to unicode strings as early as possible and converting them back to byte-strings as late as

Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-18 Thread Tim Chase
On 2016-02-18 07:33, wrong.addres...@gmail.com wrote: > Another question I have is regarding reading numerical data from > text files. Is it necessary to read one character at a time, or can > one read like in Fortran and Basic (something like Input #5, X1, > X2, X3)? A lot of my work is

Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-18 Thread Tim Chase
On 2016-02-18 09:58, wrong.addres...@gmail.com wrote: > How long can I depend on VB? Are you talking the VB6-and-before, or VB.Net? Given that MS dropped support for the VB6 line a decade ago (2005-2008 depending on whether you had extended support) with little to no help in transitioning to

[issue26380] Add an http method enum

2016-02-18 Thread Demian Brecht
Demian Brecht added the comment: > I don't have a firm opinion at this point -- can you give a few examples of > how this will help in code? It'll help solely with consistency across projects. Generally, using constants are generally favored over using hardcoded values. Mainly, it helps

Re: Passing data across callbacks in ThreadPoolExecutor

2016-02-18 Thread Joseph L. Casale
On Thur, Feb 17, 2016 at 9:24 AM, Ian Kelly wrote: >> What is the pattern for chaining execution of tasks with ThreadPoolExecutor? >> Callbacks is not an adequate facility as each task I have will generate new >> output. > > Can you specify in more detail what your use

[issue26374] concurrent_futures Executor.map semantics better specified in docs

2016-02-18 Thread Mark Dickinson
Mark Dickinson added the comment: Note also this code snippet from PEP 3148: for number, prime in zip(PRIMES, executor.map(is_prime, PRIMES)): The use of zip here suggests strongly that the intention is that the order of the `map`

[issue26374] concurrent_futures Executor.map semantics better specified in docs

2016-02-18 Thread Mark Dickinson
Mark Dickinson added the comment: The documentation says: "Equivalent to map(func, *iterables)". I believe that that equivalency implies that the ordering *is* defined, so it would be incorrect to add "order of results is undefined" to the documentation. -- nosy: +mark.dickinson

[issue26370] shelve filename inconsistent between platforms

2016-02-18 Thread SilentGhost
SilentGhost added the comment: Would you like to try to submit a patch for a solution you think most appropriate? -- nosy: +SilentGhost, georg.brandl type: behavior -> enhancement versions: +Python 3.6 -Python 3.5 ___ Python tracker

[issue26374] concurrent_futures Executor.map semantics better specified in docs

2016-02-18 Thread SilentGhost
Changes by SilentGhost : -- components: +Library (Lib) nosy: +bquinlan ___ Python tracker ___

[issue26381] Add 'geo' URI scheme (RFC 5870) to urllib.parse.uses_params

2016-02-18 Thread SilentGhost
New submission from SilentGhost: Here is the spec: https://tools.ietf.org/html/rfc5870#section-3.3 -- nosy: +SilentGhost, orsenthil ___ Python tracker

[issue26385] the call of tempfile.NamedTemporaryFile fails and leaves a file on the disk

2016-02-18 Thread SilentGhost
SilentGhost added the comment: Here is a naïve fix including a test. -- keywords: +patch nosy: +SilentGhost, georg.brandl stage: -> patch review versions: +Python 3.5, Python 3.6 Added file: http://bugs.python.org/file41959/issue26385.diff ___

[issue26386] tkinter - Treeview - .selection_add and selection_toggle

2016-02-18 Thread Anish Shah
Changes by Anish Shah : -- nosy: +anish.shah ___ Python tracker ___ ___

[issue26149] Suggest PyCharm Community as an editor for Unix platforms

2016-02-18 Thread Anish Shah
Changes by Anish Shah : -- nosy: +anish.shah ___ Python tracker ___ ___

[issue18454] distutils crashes when uploading to PyPI having only the username (no pw) defined

2016-02-18 Thread Jason R. Coombs
Jason R. Coombs added the comment: I've recently taken a different tack to this issue with setuptools 20.1, which will resolve the password from a keyring if available. -- ___ Python tracker

Re: Will file be closed automatically in a "for ... in open..." statement?

2016-02-18 Thread Jeremy Leonard
On Tuesday, February 16, 2016 at 3:39:34 AM UTC-5, jf...@ms4.hinet.net wrote: > I know > > with open('foo.txt') as f: > ...do something... > > will close the file automatically when the "with" block ends. > > I also saw codes in a book: > > for line in open('foo.txt'): >

[issue26387] Race condition in sqlite module

2016-02-18 Thread SilentGhost
Changes by SilentGhost : -- components: +Extension Modules nosy: +ghaering versions: -Python 3.2, Python 3.3 ___ Python tracker ___

Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-18 Thread wrong . address . 1
On Thursday, 18 February 2016 18:24:55 UTC+2, Dan Strohl wrote: > I totally agree with Chris here, try it out, do some simpler things to get > your feet wet before committing to redoing hundreds of thousands of lines of > code in it. Find a few of the "deal breakers" and try to solve them in

[issue26387] Race condition in sqlite module

2016-02-18 Thread Filipp Andjelo
New submission from Filipp Andjelo: Race condition in sqlite close/dealloc crashes the application with double free(). The pointer is set to NULL outside of mutexed zone, so if close and dealloc follow each other very shortly application crashes. Please see the attached patch. --

Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-18 Thread wrong . address . 1
On Thursday, 18 February 2016 18:06:29 UTC+2, Chris Angelico wrote: > On Fri, Feb 19, 2016 at 2:49 AM, wrote: > > Thanks. You have guided me quite well, and I am almost ready to declare > > that I will use Python for the next few decades. > > > > Don't declare like

Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-18 Thread wrong . address . 1
On Thursday, 18 February 2016 18:01:17 UTC+2, Dan Strohl wrote: > Disadvantages of python... (compared to VB) > > That's a hard one, but here are my thoughts: (keep in mind that these kinds > of discussions are subjective and much is based on the background and > experience of the coder,

Re: How to properly override the default factory of defaultdict?

2016-02-18 Thread Herman
d = dictutil.DefaultDictWithEnhancedFactory(lambda k: k) self.assertEqual("apple", d['apple']) From: Ben Finney > > you are using the inheritance hierarchy but thwarting it by not using > ‘super’. Instead:: > > super().__init__(self, default_factory, *a,

Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-18 Thread wrong . address . 1
On Thursday, 18 February 2016 17:59:59 UTC+2, William Ray Wing wrote: > > On Feb 18, 2016, at 10:33 AM, wrong.addres...@gmail.com wrote: > > > > torstai 18. helmikuuta 2016 17.21.32 UTC+2 Oscar Benjamin kirjoitti: > >> On 18 February 2016 at 11:32, Chris Angelico wrote: > >>

[issue26360] Deadlock in thread.join on Python 2.7/Mac OS X 10.9

2016-02-18 Thread Mark Dickinson
Mark Dickinson added the comment: A minor update: I did manage to verify that the GIL is indeed not held by any threads at the moment of the hang, so it does look very much as though a `pthread_cond_signal` signal has gone astray somehow. -- ___

Re: extending PATH on Windows?

2016-02-18 Thread Ulli Horlacher
Ulli Horlacher wrote: > > but simpler still and more reliable to just call QueryValueEx. > > I find it more complicated. I have now (after long studying docs and examples):: def get_winreg(key,subkey): try: rkey =

Re: extending PATH on Windows?

2016-02-18 Thread Ulli Horlacher
eryk sun wrote: > https://hg.python.org/cpython/file/v2.7.11/Tools/scripts/win_add2path.py > > But there are a few issues with this script. (... lot of flaws ...) > Here's a new version for Python 2. I generalized the shell-variable > replacement to a list of well-known

[issue19251] bitwise ops for bytes of equal length

2016-02-18 Thread Марк Коренберг
Марк Коренберг added the comment: in order to increase perofrmance even more, use block operation on bytes. I.e. Xor by 8 bytes first (on 64-bit system) while size remainig is bigger or equal to 8, then by 4 bytes using same loop, and then xor remaining bytes by one byte. This will increase

Re: Guido on python3 for beginners

2016-02-18 Thread Matt Wheeler
On Thu, 18 Feb 2016 11:07 Chris Angelico wrote: > By the way... For bash users, adding this to .bashrc may make venvs a > bit easier to keep straight: > > checkdir() { > [ -n "$VIRTUAL_ENV" ] && ! [[ `pwd` =~ `dirname $VIRTUAL_ENV`* ]] > && echo Deactivating venv

[issue26386] tkinter - Treeview - .selection_add and selection_toggle

2016-02-18 Thread George
New submission from George: Id's with spaces in them causes a crash when using the .selection* methods Treeview. Version of ttk.py "0.3.1" dated 12/6/2015. Traceback line numbers are 1415 then 1395 Either of these lines of code, where the item id is "2009 Report.pdf" crash allParents =

[issue26366] Use “.. versionadded” over “.. versionchanged” where appropriate

2016-02-18 Thread Tony R.
Tony R. added the comment: > My weak opinion is that a new parameter is a new API item, not just a change > in behaviour, so should probably have “versionadded”. This was my reasoning as well. Also, when I noticed so many instances of ``.. versionchanged`` that all say “Added the *x*

Re: extending PATH on Windows?

2016-02-18 Thread Ulli Horlacher
Dennis Lee Bieber wrote: > >I have > >"Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 20:32:19) [MSC > >v.1500 32 bit (Intel)] on win32" > >and there is no "win_add2path.py" > > > C:\Python_x64\Python27\Tools\scripts\win_add2path.py Ok, It is here in

RE: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-18 Thread Dan Strohl
I totally agree with Chris here, try it out, do some simpler things to get your feet wet before committing to redoing hundreds of thousands of lines of code in it. Find a few of the "deal breakers" and try to solve them in Python (create a hello world app in python, then package it in an exe

[issue26382] List object memory allocator

2016-02-18 Thread STINNER Victor
STINNER Victor added the comment: Instead of modifying individual files, I proposed to modify PyMem_Malloc to use PyObject_Malloc allocator: issue #26249. But the patch for Python 2 still makes sense. -- nosy: +haypo ___ Python tracker

[issue26385] the call of tempfile.NamedTemporaryFile fails and leaves a file on the disk

2016-02-18 Thread Eugene Viktorov
New submission from Eugene Viktorov: When calling the tempfile.NamedTemporaryFile with mode='wr' or with any other wrong value for "mode", it raises the ValueError and silently leaves an unknown, just created file on the file system. -- components: Library (Lib) files: temp_file.py

[issue26380] Add an http method enum

2016-02-18 Thread Ethan Furman
Ethan Furman added the comment: I don't have a firm opinion at this point -- can you give a few examples of how this will help in code? -- nosy: +ethan.furman ___ Python tracker

Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-18 Thread Chris Angelico
On Fri, Feb 19, 2016 at 2:49 AM, wrote: > Thanks. You have guided me quite well, and I am almost ready to declare that > I will use Python for the next few decades. > Don't declare like that - just start using it, and see what you think :) But I would be very much

RE: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-18 Thread Dan Strohl
Disadvantages of python... (compared to VB) That's a hard one, but here are my thoughts: (keep in mind that these kinds of discussions are subjective and much is based on the background and experience of the coder, these are also assuming that 100% of your audience is on windows, as soon as

Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-18 Thread William Ray Wing
> On Feb 18, 2016, at 10:33 AM, wrong.addres...@gmail.com wrote: > > torstai 18. helmikuuta 2016 17.21.32 UTC+2 Oscar Benjamin kirjoitti: >> On 18 February 2016 at 11:32, Chris Angelico wrote: >> [byte] >> It sounds to me as if all of your needs can be solved in pure Python

Re: Question on keyword arguments

2016-02-18 Thread grsmith
Thanks to all who responded, it is a big help. Tim, the 'crazy-other-result format' is the result returned by the database, nothing I can do about that :) Thanks again George -Original Message- From: Chris Angelico Sent: Thursday, February 18, 2016 10:45 AM Cc:

[issue25532] infinite loop when running inspect.unwrap over unittest.mock.call

2016-02-18 Thread Berker Peksag
Changes by Berker Peksag : -- stage: -> needs patch type: -> behavior ___ Python tracker ___

Re: Guido on python3 for beginners

2016-02-18 Thread Random832
On Thu, Feb 18, 2016, at 07:25, Rustom Mody wrote: > My beef is somewhat different: viz that post 70s (Pascal) and 80s > (scheme) > programming pedagogy has deteriorated with general purpose languages > replacing > 'teaching-purpose language' for teaching. The flaw in this idea is right there in

Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-18 Thread wrong . address . 1
On Thursday, 18 February 2016 13:32:58 UTC+2, Chris Angelico wrote: > On Thu, Feb 18, 2016 at 10:11 PM, wrote: > > Almost everything points positively for Python. Thanks to all of you who > > have responded. But please also tell me the disadvantages of Python. If I

[issue26384] UnboundLocalError in socket._sendfile_use_sendfile

2016-02-18 Thread Berker Peksag
New submission from Berker Peksag: I noticed this while working on issue 16915: Traceback (most recent call last): ... File "/home/berker/projects/cpython/default/Lib/socket.py", line 262, in _sendfile_use_sendfile raise _GiveupOnSendfile(err) # not a regular file UnboundLocalError:

Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-18 Thread Oscar Benjamin
On 18 February 2016 at 15:33, wrote: >> It sounds to me as if all of your needs can be solved in pure Python >> code possibly using some of the popular extension modules from PyPI. >> In this case it's actually very easy to package/install. You can >> package your code

Re: Question on keyword arguments

2016-02-18 Thread Chris Angelico
On Fri, Feb 19, 2016 at 2:39 AM, Dan Strohl wrote: > So, define a return object like: > > from collections import UserList > class TestResponse(UserList): > def __str__(self): > return '\0xfe%s' % '\0xfe'.join(self.data) > > ...and return that object. Out of

  1   2   >