[issue25596] regular files handled as directories in the glob module

2015-11-10 Thread Xavier de Gaye
Xavier de Gaye added the comment: This second patch rewrites the conditionals that decide whether to call _iglob() recursively, in a more natural way and without changing the behavior from the first patch. Note that when 'dirname == pathname', then basename is empty and glob2() or glob1() are

[issue25263] test_tkinter fails randomly on the buildbots "AMD64 Windows10" (3.4, 3.5, 3.x)

2015-11-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Tk bug looks fixed in next releases of Tk 8.5 and 8.6. Here is a patch that adds a workaround for the test. -- keywords: +patch stage: -> patch review type: -> behavior Added file: http://bugs.python.org/file41000/tkinter_test_use_workaround.patch

RE: python PEP suggestion

2015-11-10 Thread Dan Strohl
You mentioned that it is a bit contrary to how Python currently works, I am not sure I understand that, can you elaborate a bit? "Conditional execution, indexing (__index__), numeric conversions (__float__ also), and displaying are special cases related to syntax operations. You have left

[issue25596] regular files handled as directories in the glob module

2015-11-10 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> serhiy.storchaka nosy: +serhiy.storchaka priority: normal -> low stage: -> patch review ___ Python tracker

[issue25594] enum docs outdated re attribute access

2015-11-10 Thread Ethan Furman
Ethan Furman added the comment: Nope, that would be a bug. -- assignee: docs@python -> ethan.furman stage: -> test needed type: -> behavior ___ Python tracker

Re: corrupt download with urllib2

2015-11-10 Thread Peter Otten
Ulli Horlacher wrote: > Ulli Horlacher wrote: >> Peter Otten <__pete...@web.de> wrote: > >> > - consider shutil.copyfileobj to limit memory usage when dealing with >> > data >> > of arbitrary size. >> > >> > Putting it together: >> > >> > with open(sz,

[issue25598] Fix memory_hex (#9951) for non-contiguous buffers

2015-11-10 Thread Stefan Krah
New submission from Stefan Krah: memory_hex from #9951 fails for non-contiguous buffers. -- assignee: skrah files: memhex.diff keywords: patch messages: 254454 nosy: skrah priority: normal severity: normal status: open title: Fix memory_hex (#9951) for non-contiguous buffers type: crash

[issue25597] unittest.mock does not wrap dict objects correctly

2015-11-10 Thread Darragh Bailey
New submission from Darragh Bailey: Both unittest.mock and the backported release for earlier pythons don't appear to support mocking of dictionary objects. Specifically I'm expecting that any of the methods used to test for membership, or get items from a mock object wrapping a dictionary

Re: corrupt download with urllib2

2015-11-10 Thread Ulli Horlacher
Ulli Horlacher wrote: > Peter Otten <__pete...@web.de> wrote: > > - consider shutil.copyfileobj to limit memory usage when dealing with data > > of arbitrary size. > > > > Putting it together: > > > > with open(sz, "wb") as szo: > >

[issue25589] test_ascii_formatd fails on Mac when built with Intel compiler

2015-11-10 Thread R. David Murray
R. David Murray added the comment: Someone can correct me if I'm wrong, but my expectation would be that since we use ICC for the main compile on the ICC buildbots, we also compile the bundled ctypes using it. It is hard to see how any of the other modules would affect this. --

[issue25589] test_ascii_formatd fails on Mac when built with Intel compiler

2015-11-10 Thread Chris Hogan
Chris Hogan added the comment: I guess since no one can reproduce the error, it must be a problem with how I'm building it. We build our own dependencies (zlib, bzip, sqlite3, openssl, etc.) with the Intel compiler, so it could be any number of things causing the issue. Closing as not a bug.

Re: IDLE quits unexpectedly when about to open or creat a new file

2015-11-10 Thread Terry Reedy
On 11/10/2015 6:01 AM, Chris Angelico wrote: On Tue, Nov 10, 2015 at 9:46 PM, wrote: I need help to find out what's going on. I did some research, but I couldn't find anything to solve this problem: - I open the IDLE program; From the Start menu icon, let us

[issue25599] asyncio.iscoroutinefunction returns unexpected results when presented with unittest.mock.Mock

2015-11-10 Thread Guido van Rossum
Guido van Rossum added the comment: Hm... I don't know what answer you would expect. Who says your mock shouldn't behave like a coroutine? In general, passing mocks to functions is likely to return a mock -- even boolean functions. Can you provide more context? --

[issue6598] calling email.utils.make_msgid frequently has a non-trivial probability of generating colliding ids

2015-11-10 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3c0a817ab616 by Serhiy Storchaka in branch '3.4': Issue #6598: Avoid clock wrapping around in test_make_msgid_collisions. https://hg.python.org/cpython/rev/3c0a817ab616 New changeset e259c0ab7a69 by Serhiy Storchaka in branch '3.5': Issue #6598:

[issue25594] enum docs outdated re attribute access

2015-11-10 Thread SilentGhost
SilentGhost added the comment: Here is the test, it seems to have been 2545bfe0d273 that caused it (issue23486): test passes prior to it and fails on it (and I assume uniformly after). -- keywords: +patch Added file: http://bugs.python.org/file41003/test_issue25594.diff

[issue25598] Fix memory_hex (#9951) for non-contiguous buffers

2015-11-10 Thread Roundup Robot
Roundup Robot added the comment: New changeset f3d8bb3ffa98 by Stefan Krah in branch '3.5': Iaaue #25598: Fix memory_hex from #9951 for non-contiguous buffers. https://hg.python.org/cpython/rev/f3d8bb3ffa98 -- nosy: +python-dev ___ Python tracker

[issue9951] introduce bytes.hex method (also for bytearray and memoryview)

2015-11-10 Thread Roundup Robot
Roundup Robot added the comment: New changeset f3d8bb3ffa98 by Stefan Krah in branch '3.5': Iaaue #25598: Fix memory_hex from #9951 for non-contiguous buffers. https://hg.python.org/cpython/rev/f3d8bb3ffa98 -- ___ Python tracker

[issue25599] asyncio.iscoroutinefunction returns unexpected results when presented with unittest.mock.Mock

2015-11-10 Thread Theron Luhn
New submission from Theron Luhn: >>> asyncio.iscoroutinefunction(unittest.mock.Mock()) This is an unexpected response, both in type (Mock rather than boolean) and value (truthy). inspect.iscoroutinefunction behaves as expected. Workaround: >>> m = unittest.mock.Mock() >>> m._is_coroutine =

Re: corrupt download with urllib2

2015-11-10 Thread Ulli Horlacher
Peter Otten <__pete...@web.de> wrote: > > I have a problem with it: There is no feedback for the user about the > > progress of the transfer, which can last several hours. > > > > For small files shutil.copyfileobj() is a good idea, but not for huge > > ones. > > Indeed. Have a look at the

[issue6598] calling email.utils.make_msgid frequently has a non-trivial probability of generating colliding ids

2015-11-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: http://buildbot.python.org/all/builders/x86%20Tiger%202.7/builds/3246/steps/test/logs/stdio == FAIL: test_make_msgid_collisions (email.test.test_email.TestMiscellaneous)

[issue25593] _sock_connect_cb can be called twice resulting in InvalidStateError

2015-11-10 Thread Guido van Rossum
Guido van Rossum added the comment: Please show us how to repro -- there's no way we can figure out how this "impossible" event could happen in your code without understanding your code. Is it possible that multiprocessing forked your event loop or something similarly esoteric? --

[issue25599] asyncio.iscoroutinefunction returns unexpected results when presented with unittest.mock.Mock

2015-11-10 Thread STINNER Victor
STINNER Victor added the comment: >>> asyncio.iscoroutinefunction(unittest.mock.Mock()) Yeah, I already had this issue when I wrote unit tests using mock :-/ I didn't find an obvious fix for this issue, and it's quite easy to workaround it. It looks like the "m._is_coroutine = False" is not

[issue24848] Warts in UTF-7 error handling

2015-11-10 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> serhiy.storchaka resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

Re: using binary in python

2015-11-10 Thread kent nyberg
On Mon, Nov 09, 2015 at 10:20:25PM -0800, Larry Hudson via Python-list wrote: > Your questions are somewhat difficult to answer because you misunderstand > binary. The key is that EVERYTHING in a computer is binary. There are NO > EXCEPTIONS, it's all binary ALL the time. The difference comes

Re: using binary in python

2015-11-10 Thread mm0fmf via Python-list
On 10/11/2015 20:14, Dennis Lee Bieber wrote: The Ada language defines the end of Text file to consist of It is 15 years this month since I last worked in place that used Ada. I think that calls for a wee dram to celebrate ;-) -- https://mail.python.org/mailman/listinfo/python-list

[issue25339] sys.stdout.errors is set to "surrogateescape"

2015-11-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The default encoding of sys.stdio and sys.stdout is determined by (in order of increasing precedence): 1. locale 2. PYTHONIOENCODING 3. Py_SetStandardStreamEncoding() The default error handler before 3.5 was determined by: 1. 'strict' 2. PYTHONIOENCODING

[issue25594] enum instance attribute access possible

2015-11-10 Thread SilentGhost
Changes by SilentGhost : -- components: -Documentation stage: test needed -> needs patch title: enum docs outdated re attribute access -> enum instance attribute access possible ___ Python tracker

Re: using binary in python

2015-11-10 Thread Mark Lawrence
On 10/11/2015 20:36, mm0fmf via Python-list wrote: On 10/11/2015 20:14, Dennis Lee Bieber wrote: The Ada language defines the end of Text file to consist of It is 15 years this month since I last worked in place that used Ada. I think that calls for a wee dram to celebrate ;-) Followed by a

Re: using binary in python

2015-11-10 Thread Random832
Dennis Lee Bieber writes: > To be strict -- a text file has system defined means of marking > line endings. UNIX/Linux uses just a character; Windows uses the pair > . TRS-DOS used just for end of line. Some operating systems > may have used count-delimited formats

bitwise operator, bits dont go into bitbucket..?

2015-11-10 Thread kent nyberg
Im reading about bitwise operators and is it true to say they dont work 100% as in C? bitwise operators in C seem to result in bits going to the so called bitbucket. For example, 0b0001. Shifting it >> 1 in C it seems to add on zero to the left and the 1 to the right gets throwned away.

Re: Using subprocess to capture a progress line

2015-11-10 Thread Chris Angelico
On Wed, Nov 11, 2015 at 9:47 AM, Tim Johnson wrote: > I've written a command-line "wrapper" for youtube-dl, executing > youtube-dl as a subprocess. > > -- > youtube-dl reports download progress on one line. I.E.

Re: Using subprocess to capture a progress line

2015-11-10 Thread Tim Johnson
* Chris Angelico [151110 14:35]: > On Wed, Nov 11, 2015 at 9:47 AM, Tim Johnson wrote: > > I've written a command-line "wrapper" for youtube-dl, executing > > youtube-dl as a subprocess. > > > >

[issue25595] test_deleted_cwd in test_importlib is failed on AIX

2015-11-10 Thread Martin Panter
Martin Panter added the comment: Wow this is tricky to get right. Victor, you are right to not trust TemporaryDirectory, because when cleanup() fails you don’t get a second chance, and it will leave the directory behind. According to the Microsoft _mkdir() web page

[issue25437] Issue with ftplib.FTP_TLS and server forcing SSL connection reuse

2015-11-10 Thread Stephen Ash
Changes by Stephen Ash : -- nosy: +Stephen Ash ___ Python tracker ___ ___

Re: Keeping context-manager object alive through function calls

2015-11-10 Thread Ben Finney
Pablo Lucena writes: > In order to keep the SSH session open and not have to re-establish it > across function calls, I would like to do add an argument to > "do_stuff" which can optionally return the SSH session along with the > data returned from the SSH session, as

Re: using binary in python

2015-11-10 Thread Random832
Dennis Lee Bieber writes: > Given that a dram is 1/8 of a "fluid ounce" that leads to the > conclusion that a "wee dram" is based on US standard fluid once, 29.6 ml > vs British standard fluid ounce... 28.4 ml It's our _pints_ that are smaller than yours, not our

OT: Re: using binary in python

2015-11-10 Thread mm0fmf via Python-list
On 10/11/2015 21:02, Dennis Lee Bieber wrote: On Tue, 10 Nov 2015 20:36:52 +, mm0fmf via Python-list declaimed the following: On 10/11/2015 20:14, Dennis Lee Bieber wrote: The Ada language defines the end of Text file to consist of It is 15 years this month

[issue25558] Use static asserts in C code

2015-11-10 Thread STINNER Victor
STINNER Victor added the comment: This issue can now be closed, no? (I don't think that it's worth to add a new macro and make the existing macro more strict.) -- ___ Python tracker

Re: bitwise operator, bits dont go into bitbucket..?

2015-11-10 Thread Chris Angelico
On Wed, Nov 11, 2015 at 9:27 AM, kent nyberg wrote: > Im reading about bitwise operators and is it true to say they dont work 100% > as in C? > bitwise operators in C seem to result in bits going to the so called > bitbucket. > For example, 0b0001. Shifting it >> 1 in C

Re: bitwise operator, bits dont go into bitbucket..?

2015-11-10 Thread kent nyberg
On Wed, Nov 11, 2015 at 09:33:38AM +1100, Chris Angelico wrote: > On Wed, Nov 11, 2015 at 9:27 AM, kent nyberg wrote: > > If you want to check specific bits (in C or Python, either way), it's > much more common to use bitwise AND than bit shifts: > > >>> 0b100011011101010110

Using subprocess to capture a progress line

2015-11-10 Thread Tim Johnson
Using python 2.7.6 on ubuntu 14.04 The application in question is run with bash and gnome-terminal : I've written a command-line "wrapper" for youtube-dl, executing youtube-dl as a subprocess. -- youtube-dl reports download

[issue25597] unittest.mock does not wrap dict objects correctly

2015-11-10 Thread R. David Murray
R. David Murray added the comment: Looking at the source, it's not clear that wraps is supported for __ methods, despite what the documentation implies. That is, MagicProxy doesn't seem to look at the wraps information. I suspect it is doable, but it may be an enhancement request rather

Re: Using subprocess to capture a progress line

2015-11-10 Thread Tim Johnson
* Tim Johnson [151110 14:55]: > * Chris Angelico [151110 14:35]: > > On Wed, Nov 11, 2015 at 9:47 AM, Tim Johnson wrote: > > > I've written a command-line "wrapper" for youtube-dl, executing > > > youtube-dl as a subprocess. > > > > > >

Keeping context-manager object alive through function calls

2015-11-10 Thread Pablo Lucena
I am running into a bit of an issue with keeping a context manager open through function calls. Here is what I mean: There is a context-manager defined in a module which I use to open SSH connections to network devices. The "setup" code handles opening the SSH sessions and handling any issues,

Re: using binary in python

2015-11-10 Thread Random832
Dennis Lee Bieber writes: > > Given that a dram is 1/8 of a "fluid ounce" that leads to the > conclusion that a "wee dram" is based on US standard fluid once, 29.6 ml > vs British standard fluid ounce... 28.4 ml It's our _pints_ that are smaller than yours, not

Re: using binary in python

2015-11-10 Thread Michael Torrie
On 11/10/2015 02:29 PM, kent nyberg wrote: > On Mon, Nov 09, 2015 at 10:20:25PM -0800, Larry Hudson via Python-list wrote: >> Your questions are somewhat difficult to answer because you misunderstand >> binary. The key is that EVERYTHING in a computer is binary. There are NO >> EXCEPTIONS, it's

[issue25594] enum docs outdated re attribute access

2015-11-10 Thread SilentGhost
New submission from SilentGhost: In enum docs[0], there is a suggestion that the attribute access on members should raise an AttributeError: >>> Color.red.blue Traceback (most recent call last): ... AttributeError: 'Color' object has no attribute 'blue' which is demonstrably wrong in either

Re: Calulation in lim (1 + 1 /n) ^n when n -> infinite

2015-11-10 Thread Salvatore DI DIO
Thank you very much Peter -- https://mail.python.org/mailman/listinfo/python-list

Re: Getting response by email reply message

2015-11-10 Thread Laura Creighton
In a message of Mon, 09 Nov 2015 23:09:50 -0800, zljubi...@gmail.com writes: >> If what you really need is a voting application, you can look at >> https://github.com/mdipierro/evote which the PSF uses for its elections. > >It is not a voting application (I will have more than yes/no answers). >I

Re: Extracting and summing student scores from a JSON file using Python 2.7.10

2015-11-10 Thread Pete Dowdell
On 10/11/15 08:12, Bernie Lazlo wrote: > > import json > >import urllib > >url ="http://www.wickson.net/geography_assignment.json; > >response = urllib.urlopen(url) > >data = json.loads(response.read()) All good up to data. Now: # make a list of scores scores = [d['score'] for d in

Re: Getting response by email reply message

2015-11-10 Thread Laura Creighton
In a message of Tue, 10 Nov 2015 11:23:21 +0100, Laura Creighton writes: >Their is no demand for 'yes/no answers' -- you can typically vote for s/Their/There/ ... >the whole thing way, way, way to heavy-weight for most purposes. s/to/too/ also s/heavy-weight/heavyweight/ depending on where in

[issue25586] socket.sendall broken when a socket has a timeout

2015-11-10 Thread Jakub Stasiak
Jakub Stasiak added the comment: That's fair and thanks for the links. Please find a quick patch attached, feel free to use that or any modification of it. While I believe the documentation is technically correct right now it won't hurt to clarify this I think. -- keywords: +patch

Re: Question about math.pi is mutable

2015-11-10 Thread Antoon Pardon
Op 10-11-15 om 00:29 schreef Ben Finney: > > Who is doing what to whom? The user of the library isn't doing anything > to the library author, so what is it the library author would consent > to? Instead, you seem to be trying to assert a *power* of the library > author to restrict the library

Re: Question about math.pi is mutable

2015-11-10 Thread Laura Creighton
In a message of Tue, 10 Nov 2015 17:10:09 +1100, Ben Finney writes: >Steven D'Aprano writes: > >> Ben, I fear that you are not paying attention to me :-) > >Possibly, though I also think there's miscommunication in this thread. > >You speak of “compile time” and “run time”.

Re: help in pexpect multiprocessing

2015-11-10 Thread harirammanohar159
On Monday, 9 November 2015 18:07:36 UTC+5:30, hariramm...@gmail.com wrote: > Hi, > > I am using multiprocessing with pexpect, issue is whenever i call a function > which is having expect(), its throwing error which is genuine as multiple > threads are processing it same time (i/o prompt same

Re: Question about math.pi is mutable

2015-11-10 Thread Terry Reedy
On 11/9/2015 9:37 PM, Steven D'Aprano wrote: The compiler doesn't need to decide *in advance* whether the attribute might have changed. It knows whether it has changed or not *at runtime*. You are using 'compiler' when you should, to avoid confusion, use 'interpreter'. It's one thing to

Re: Question about math.pi is mutable

2015-11-10 Thread Ben Finney
Laura Creighton writes: > In a message of Tue, 10 Nov 2015 17:10:09 +1100, Ben Finney writes: > >I am a Bear of Little Brain, but: Isn't anything that the *compiler* > >does, by definition done at *compile* time? > > No. > > We used to have a pretty strict defintion about what a

Re: Extracting and summing student scores from a JSON file using Python 2.7.10

2015-11-10 Thread Bernie Lazlo
On Monday, 9 November 2015 22:54:05 UTC-5, wayne@gmail.com wrote: > On Monday, 9 November 2015 22:27:40 UTC-5, Denis McMahon wrote: > > On Mon, 09 Nov 2015 15:52:45 -0800, Bernie Lazlo wrote: > > > > > This should be a simple problem but I have wasted hours on it. Any help > > > would be

Re: Extracting and summing student scores from a JSON file using Python 2.7.10

2015-11-10 Thread Bernie Lazlo
On Monday, 9 November 2015 18:53:06 UTC-5, Bernie Lazlo wrote: > This should be a simple problem but I have wasted hours on it. Any help would > be appreciated. [I have taken my code back to almost the very beginning.] > > The student scores need to be summed. >

Re: help in pexpect multiprocessing

2015-11-10 Thread harirammanohar159
On Monday, 9 November 2015 18:07:36 UTC+5:30, hariramm...@gmail.com wrote: > Hi, > > I am using multiprocessing with pexpect, issue is whenever i call a function > which is having expect(), its throwing error which is genuine as multiple > threads are processing it same time (i/o prompt same

Re: help in pexpect multiprocessing

2015-11-10 Thread Pablo Lucena
I think the problem is that you cannot pass around an open socket via pickle. Whats the error message you are getting? Try adding the session establishment code to the stop function, so that each new process opens a session to the server and executes the command. def stop(ds): s =

[issue25595] test_deleted_cwd in test_importlib is failed on AIX

2015-11-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Victor for your review. Here is fixed patch that implements your suggestions. -- Added file: http://bugs.python.org/file40997/test_deleted_cwd_aix_2.patch ___ Python tracker

[issue25595] test_deleted_cwd in test_importlib is failed on AIX

2015-11-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: And here is simple alternative patch based on Martin's original suggestion in msg236122. -- Added file: http://bugs.python.org/file40998/test_deleted_cwd_aix_alt.patch ___ Python tracker

Re: Using subprocess to capture a progress line

2015-11-10 Thread Tim Johnson
* Tim Johnson [151110 14:55]: > * Chris Angelico [151110 14:35]: > > On Wed, Nov 11, 2015 at 9:47 AM, Tim Johnson wrote: > > > I've written a command-line "wrapper" for youtube-dl, executing > > is implemented in Python, you might find

Swig + Numpy.i with a const int16_t pointer

2015-11-10 Thread shriphanip
I am trying to wrap the following function with SWIG so I can call it from Python. The signature is: ``` int WebRtcVad_Process(VadInst* handle, int fs, const int16_t* audio_frame, size_t frame_length); ``` I have the following SWIG file: https://gist.github.com/shriphani/92c587ea4c32bafc9d97

Re: Question about math.pi is mutable

2015-11-10 Thread Steven D'Aprano
On Tue, 10 Nov 2015 11:14 pm, Ben Finney wrote: >> Python -- yes, even CPython -- has a runtime compiler. When you import >> a module, it is compiled (if needed) just before the import. Likewise, >> when you call the `compile`, `eval` or `exec` built-ins, the compiler >> operates. >> >> I'm not

[issue25590] tab-completition on instances repeatedly accesses attribute/descriptors values

2015-11-10 Thread Martin Panter
Martin Panter added the comment: getattr-once.patch handles my first two points. It backports the set() change, and avoids the hasattr() check. I guess we apply this to 3.4+; expect merge conflicts with 3.6. As for the last point, I will make another patch to include special attributes that

[issue25586] socket.sendall broken when a socket has a timeout

2015-11-10 Thread Martin Panter
Martin Panter added the comment: That was kind of what I had in mind. The only change I would make is to restore the comma to “On error (including socket timeout), an exception . . .”. I’ll try to commit this in a few days if nobody has anything else to say. -- stage: -> patch review

IDLE quits unexpectedly when about to open or creat a new file

2015-11-10 Thread trindadegoncalves
Hello, I need help to find out what's going on. I did some research, but I couldn't find anything to solve this problem: - I open the IDLE program; - I go to the 'File' menu; - I select the 'New File' option - IDLE quits. I run the IDLE version 3.3.3 on Windows 8.1 Pro. Should I install the

[issue25595] test_deleted_cwd in test_importlib is failed on AIX

2015-11-10 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: test_deleted_cwd in test_importlib is failed on AIX. http://buildbot.python.org/all/builders/PPC64%20AIX%203.x/builds/4318/steps/test/logs/stdio == ERROR: test_deleted_cwd

Re: IDLE quits unexpectedly when about to open or creat a new file

2015-11-10 Thread Chris Angelico
On Tue, Nov 10, 2015 at 9:46 PM, wrote: > I need help to find out what's going on. I did some research, but I couldn't > find anything to solve this problem: > > - I open the IDLE program; > - I go to the 'File' menu; > - I select the 'New File' option > - IDLE

[issue25596] regular files handled as directories in the glob module

2015-11-10 Thread Xavier de Gaye
New submission from Xavier de Gaye: The glob module happily joins names of regular files together with os.path.join() or attempts to list the files contained into a regular file (sic). The same 'except os.error' statement is used to handle both these cases and the case of a non readable

[issue25584] a recursive glob pattern fails to list files in the current directory

2015-11-10 Thread Xavier de Gaye
Xavier de Gaye added the comment: New issue 25596 entered: regular files handled as directories in the glob module. Thanks for fixing this Serhiy. -- ___ Python tracker

[issue25595] test_deleted_cwd in test_importlib is failed on AIX

2015-11-10 Thread STINNER Victor
STINNER Victor added the comment: -1, review on Rietveld. -- nosy: +haypo ___ Python tracker ___ ___

Re: Question about math.pi is mutable

2015-11-10 Thread Steven D'Aprano
On Tue, 10 Nov 2015 05:10 pm, Ben Finney wrote: > Steven D'Aprano writes: > >> Ben, I fear that you are not paying attention to me :-) > > Possibly, though I also think there's miscommunication in this thread. > > You speak of “compile time” and “run time”. You also speak

Re: Keeping context-manager object alive through function calls

2015-11-10 Thread Steven D'Aprano
On Wednesday 11 November 2015 09:36, Pablo Lucena wrote: > I am running into a bit of an issue with keeping a context manager open > through function calls. Here is what I mean: [...] > In order to keep the SSH session open and not have to re-establish it > across function calls, I would like to

[issue25600] argparse, argument_default=argparse.SUPPRESS seems to have no effect

2015-11-10 Thread mcer45
New submission from mcer45: The parameter argument_default=argparse.SUPPRESS seems to have no effect. Example: = help_dirs='ahoy parser = argparse.ArgumentParser(

Re: Question about math.pi is mutable

2015-11-10 Thread Steven D'Aprano
On Wednesday 11 November 2015 00:26, BartC wrote: > Does the Python language specify how it is to be compiled and executed? Not in so many words, but there are limitations on what you can do based on the specified semantics of Python. But so long as you meet those semantics, you can implement

[issue25590] tab-completition on instances repeatedly accesses attribute/descriptors values

2015-11-10 Thread Martin Panter
Martin Panter added the comment: uncreated-attr.patch is against the 3.6 branch, and includes the excessive getattr() test, and new code to include uncreated attribute names. I added a paragraph to What’s New describing the new completion behaviour. -- Added file:

[issue25590] tab-completition on instances repeatedly accesses attribute/descriptors values

2015-11-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Both patches LGTM. Thank you Martin. > Would we consider this a new feature for 3.6? We can consider this a fix of the regression in issue449227. But this behavior here is so long. I agree with applying it to 3.6 only. For nicer Mercurial history, it would

[issue25595] test_deleted_cwd in test_importlib is failed on AIX

2015-11-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Martin's original code looked nicer to me. It' a pity we can't use it. test_deleted_cwd_aix_3.patch LGTM. Thanks Martin! -- assignee: -> serhiy.storchaka ___ Python tracker

[issue25595] test_deleted_cwd in test_importlib is failed on AIX

2015-11-10 Thread Roundup Robot
Roundup Robot added the comment: New changeset d4dc36586f24 by Serhiy Storchaka in branch '3.5': Issue #25595: Fixed test_deleted_cwd in test_importlib on AIX. https://hg.python.org/cpython/rev/d4dc36586f24 New changeset 3f392050d519 by Serhiy Storchaka in branch 'default': Issue #25595: Fixed

[issue25595] test_deleted_cwd in test_importlib is failed on AIX

2015-11-10 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

Re: Keeping context-manager object alive through function calls

2015-11-10 Thread Chris Angelico
On Wed, Nov 11, 2015 at 9:36 AM, Pablo Lucena wrote: > And calling it as such: > > def do_more_stuff(device): > gen = do_stuff(device, return_handle=True) > data, conn = next(gen) > output = conn.send_command("show users") > #process output... > return

Re: bitwise operator, bits dont go into bitbucket..?

2015-11-10 Thread Chris Angelico
On Wed, Nov 11, 2015 at 9:56 AM, kent nyberg wrote: > So, to check if 0b010[this one bit]010 is set, i do & 0b0001000 > > That is, I set just that one to 1 in the other and then the & operator will > make it return > 0 if its not set. Since every other is zero, the return

[issue25498] Python 3.4.3 core dump with simple sample code

2015-11-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Added new comments on Rietveld. Would be nice to add tests for read-only and non-contiguous buffers. eryksun, what is your real name? What we have to add in the Misc/ACKS file? -- ___ Python tracker

[issue24661] CGIHTTPServer: premature unescaping of query string

2015-11-10 Thread Martin Panter
Martin Panter added the comment: The CGI server no longer unquotes the query string thanks to the fix for Issue 24657. The fix should be in the next (2.7.11) release. -- nosy: +martin.panter resolution: -> out of date stage: -> resolved status: open -> closed superseder: ->

[issue25583] os.makedirs with exist_ok=True raises PermissionError on Windows 7^

2015-11-10 Thread Daniel Plachotich
Daniel Plachotich added the comment: Yes, it's probably a better solution. If had been more careful, I wouldn't have scribbled so much text here :) . But is there any sense in adding Windows-specific test with EACCES since the problem with errno may affect other platforms as well (at least in

Re: Question about math.pi is mutable

2015-11-10 Thread BartC
On 10/11/2015 11:34, Steven D'Aprano wrote: On Tue, 10 Nov 2015 05:10 pm, Ben Finney wrote: I am a Bear of Little Brain, but: Isn't anything that the *compiler* does, by definition done at *compile* time? In a manner of speaking, yes, of course. But you've missed the critical issue: when

[issue25263] test_tkinter fails randomly on the buildbots "AMD64 Windows10" (3.4, 3.5, 3.x)

2015-11-10 Thread Roundup Robot
Roundup Robot added the comment: New changeset 385b3aaf8401 by Serhiy Storchaka in branch '3.4': Issue #25263: Fixed the tkinter.test.test_tkinter.test_font.FontTest test https://hg.python.org/cpython/rev/385b3aaf8401 New changeset db168611c6c8 by Serhiy Storchaka in branch '3.5': Issue #25263:

Re: corrupt download with urllib2

2015-11-10 Thread Peter Otten
Ulli Horlacher wrote: > if u.getcode() == 200: > print(u.read(),file=szo,end='') > szo.close() > else: > die('cannot get %s - server reply: %d' % (szurl,u.getcode())) More random remarks: - print() gives the impression that you are dealing with text, and using it

Re: corrupt download with urllib2

2015-11-10 Thread Ulli Horlacher
Peter Otten <__pete...@web.de> wrote: > > It works with Linux, but not with Windows 7, where the downloaded 7za.exe > > is corrupt: it has the wrong size, 589044 instead of 587776 Bytes. > > > > Where is my error? > > > sz = path.join(fexhome,'7za.exe') > > szurl =

corrupt download with urllib2

2015-11-10 Thread Ulli Horlacher
I am currently developing a program which should run on Linux and Windows. Later it shall be compiled with PyInstaller. Therefore I am using Python 2.7 My program must download http://fex.belwue.de/download/7za.exe I am using this code: sz = path.join(fexhome,'7za.exe') szurl =

[issue25595] test_deleted_cwd in test_importlib is failed on AIX

2015-11-10 Thread STINNER Victor
STINNER Victor added the comment: test_deleted_cwd_aix_alt.patch: I don't trust tempfile.TemporaryDirectory(), I prefer your patch. test_deleted_cwd_aix_2.patch looks good to me. -- ___ Python tracker

Re: corrupt download with urllib2

2015-11-10 Thread Peter Otten
Ulli Horlacher wrote: > I am currently developing a program which should run on Linux and Windows. > Later it shall be compiled with PyInstaller. Therefore I am using Python > 2.7 > > My program must download http://fex.belwue.de/download/7za.exe > > I am using this code: > It works with

[issue25263] test_tkinter fails randomly on the buildbots "AMD64 Windows10" (3.4, 3.5, 3.x)

2015-11-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The other failure is not Windows specific. It can be reproduced if run test_tk twice. FontTest.setUpClass() incorrectly call parent's method and the root attribute is set in parent class. tearDownClass() sets the root attribute to None in child class, and

Re: corrupt download with urllib2

2015-11-10 Thread Ulli Horlacher
Peter Otten <__pete...@web.de> wrote: > Ulli Horlacher wrote: > > > if u.getcode() == 200: > > print(u.read(),file=szo,end='') > > szo.close() > > else: > > die('cannot get %s - server reply: %d' % (szurl,u.getcode())) > > More random remarks: Always welcome - I am

[issue25583] os.makedirs with exist_ok=True raises PermissionError on Windows 7^

2015-11-10 Thread Martin Panter
Martin Panter added the comment: It is good to add a regression test for any bug if it’s not too hard. Yes this is not a Windows-only issue, but I understand it is much simpler to produce with Windows. Otherwise you need a special file system setup and a more obscure OS. Please review my

Re: using binary in python

2015-11-10 Thread Larry Hudson via Python-list
On 11/10/2015 12:14 PM, Dennis Lee Bieber wrote: On Mon, 9 Nov 2015 22:20:25 -0800, Larry Hudson via Python-list declaimed the following: Of course it can. The only difference a text file and a binary file is the way it's opened. Text files are opened with 'r' or

[issue25498] Python 3.4.3 core dump with simple sample code

2015-11-10 Thread Martin Panter
Martin Panter added the comment: I propose this patch, based on Eryksun’s patch (thanks Eryksun). New changes: * Added test case * Applied Serhiy’s review suggestion * Changed the new BufferError exceptions back to TypeError to match previous behaviour and test cases -- nosy: +eryksun

  1   2   >