[issue25485] Add a context manager to telnetlib.Telnet

2015-10-28 Thread Berker Peksag
Berker Peksag added the comment: This seems like a reasonable request to me. See https://docs.python.org/devguide/ to learn how to contribute to Python. -- nosy: +berker.peksag stage: -> needs patch ___ Python tracker

[issue20519] Replace uuid ctypes usage with an extension module.

2015-10-28 Thread Gustavo J. A. M. Carneiro
Gustavo J. A. M. Carneiro added the comment: New patch that: 1. adds assert(sizeof(uuid_t) == 16); to the extension module; 2. fixes the code path when ctypes has to be used instead of the extension module (needed a bit more refactoring, apologies if it makes the diff harder to read); 3.

Re: Windows 10 pip2.7.exe uninstall fails

2015-10-28 Thread Robin Becker
A message box is displayed:- "This app can't run on your PC To find a version for your PC, check with the software publisher". Close the message box and:- "Access is denied." Searching hasn't thrown up a single reference to uninstall errors like this, any ideas? FWIW on my 64bit

[issue25497] Rewrite test_robotparser

2015-10-28 Thread Berker Peksag
New submission from Berker Peksag: The attached patch rewrites test_robotparser to use a class based approach. Other changes: * Added support.reap_threads to PasswordProtectedSiteTestCase * Reenabled testPythonOrg since the python.org problem has already been fixed -- components:

[issue21827] textwrap.dedent() fails when largest common whitespace is a substring of smallest leading whitespace

2015-10-28 Thread R. David Murray
R. David Murray added the comment: It's one of the PEPs (I forget which one). We only apply non-security fixes to the most recent non-development branch...except that for now we also apply bug fixes to 2.7. So, 2.7, 3.5, and 3.6 are the targets for this issue. -- versions: -Python

[issue25489] sys.exit() caught in exception handler

2015-10-28 Thread R. David Murray
R. David Murray added the comment: Using sys.exit means you are depending on garbage collection to clean up all of your program's resources. In the general case this is a bad idea. A better design is to call loop.stop, and then do cleanup (which might involve calling some wait_closed

[issue8231] Unable to run IDLE without write-access to home directory

2015-10-28 Thread Mark Roseman
Mark Roseman added the comment: Checked on Linux and Mac - doesn't work correctly. mkdtemp() returns a different name every time it's called, and GetUserCfgDir() is called in three places, meaning we end up with three different tmp directories (which on quick examination didn't all get

Re: Pause and Resuming of a file upload process to AWS S3

2015-10-28 Thread Michiel Overtoom
Hi, > I wanted to know whether it is possible in python to pause and resume the > file upload process to AWS S3 Have a look at s3tools/s3cmd at http://s3tools.org/s3cmd, in http://s3tools.org/usage I read: --continue-put Continue uploading partially uploaded files Greetings, --

[issue25482] signal.set_wakeup_fd() doesn't work if the signal don't have handler

2015-10-28 Thread STINNER Victor
STINNER Victor added the comment: > IMO this reduces usefulness of set_wakeup_fd(). (...) Sorry, I don't understand your use case. Could you elaborate. What do you need? -- According to the GNU libc doc, the signal SIGWINCH is *ignored* by default: "Window size change. This is generated on

[issue19628] maxlevels -1 on compileall for unlimited recursion

2015-10-28 Thread Sworddragon
Sworddragon added the comment: I'm wondering what the recursion limit is if -l and -r are not given. Does it default to 10 too or is there no limit? If the first is the case maybe this should also get documented. -- ___ Python tracker

[issue21827] textwrap.dedent() fails when largest common whitespace is a substring of smallest leading whitespace

2015-10-28 Thread John Mark Vandenberg
John Mark Vandenberg added the comment: Not surprising also occurs on Python 3.2, 3.3, & 3.6. I'm not sure whether fixes like this are suitable to be merged into 3.2/3.3.(is there a document describing this?) -- nosy: +John.Mark.Vandenberg versions: +Python 3.2, Python 3.3, Python 3.6

Re: How to log the output from the multiple telnet sessions to separate log file

2015-10-28 Thread dieter
manjunatha.mahalinga...@gmail.com writes: > ... > I created the my own class MyLogger and passing log file name to it. I'm > seeing no log is being written to passed log file instead everything is > written to the logfilename [actually logfilename is variable with file name] > I'm trying to

[issue8231] Unable to run IDLE without write-access to home directory

2015-10-28 Thread Terry J. Reedy
Terry J. Reedy added the comment: Attached is a patch that I think will work. I have not tested it because I do not know how to make my home directory, and only my home directory, read-only. Brian, how did you do it? I now have Win 10. When I rt click user/terry and select properties, there

[issue25432] isinstance documentation: explain behavior when type is a tuple

2015-10-28 Thread Terry J. Reedy
Terry J. Reedy added the comment: Doing this now. -- assignee: docs@python -> terry.reedy ___ Python tracker ___

[issue25432] isinstance documentation: explain behavior when type is a tuple

2015-10-28 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- resolution: -> fixed stage: needs patch -> resolved status: open -> closed ___ Python tracker ___

[issue25432] isinstance documentation: explain behavior when type is a tuple

2015-10-28 Thread Roundup Robot
Roundup Robot added the comment: New changeset aaf8a25133ff by Terry Jan Reedy in branch '2.7': Issue #25432: Explain isinstance behaviour when type is a tuple. https://hg.python.org/cpython/rev/aaf8a25133ff New changeset 8b1418e5dcc8 by Terry Jan Reedy in branch '3.4': Issue #25432: Explain

Re: Pause and Resuming of a file upload process to AWS S3

2015-10-28 Thread dieter
ashw...@nanoheal.com writes: > I wanted to know whether it is possible in python to pause and resume the > file upload process to AWS S3 Have you checked that "AWS S3" supports it? If so, you will be able to do it with Python -- however, you likely need to use low level modules (such as

[issue25496] Default value for compresslevel is not documented

2015-10-28 Thread Sworddragon
New submission from Sworddragon: After ticket #21404 got solved I'm noticing that the default value for the compresslevel argument is not mentioned. Maybe this can be documented too. -- components: Library (Lib) messages: 253592 nosy: Sworddragon priority: normal severity: normal

[issue20607] multiprocessing cx_Freeze windows GUI bug (& easy fixes)

2015-10-28 Thread Mark Summerfield
Mark Summerfield added the comment: I've now signed the contributor agreement. However, with Python 3.4 I don't seem to get the same problem anymore even though there are a few places in the code where sys.std{err,out} are used without if ... is not None guards. --

[issue25495] binascii documentation incorrect

2015-10-28 Thread Mouse
Mouse added the comment: Yes I know where this came from. :-) Here is my proposed change. Replace the statement The length of data should be at most 57 to adhere to the base64 standard. with: To be MIME-compliant, the Base64 output (as defined in RFC4648) should be broken into lines of at

Re: UNABLE TO GET IDLE TO RUN

2015-10-28 Thread Peter Otten
Terry Reedy wrote: Thank you for your patience. > Why do you think it a misfeature for IDLE to execute code the way Python > does? Sadly I wasn't aware that the interactive interpreter is also vulnerable. I should have been, but failed to add one and one. Until now I have often started python

[issue21827] textwrap.dedent() fails when largest common whitespace is a substring of smallest leading whitespace

2015-10-28 Thread Raymond Hettinger
Raymond Hettinger added the comment: Serhiy, your way looks best. Go ahead with it. -- assignee: rhettinger -> serhiy.storchaka ___ Python tracker ___

List comprehension with if-else

2015-10-28 Thread Larry Martell
I'm trying to do a list comprehension with an if and that requires an else, but in the else case I do not want anything added to the list. For example, if I do this: white_list = [l.control_hub.serial_number if l.wblist == wblist_enum['WHITE'] else None for l in wblist] I end up with None in

Re: List comprehension with if-else

2015-10-28 Thread Zachary Ware
On Wed, Oct 28, 2015 at 11:25 AM, Larry Martell wrote: > I'm trying to do a list comprehension with an if and that requires an > else, but in the else case I do not want anything added to the list. > > For example, if I do this: > > white_list =

Re: List comprehension with if-else

2015-10-28 Thread Carl Meyer
Hi Larry, On 10/28/2015 10:25 AM, Larry Martell wrote: > I'm trying to do a list comprehension with an if and that requires an > else, but in the else case I do not want anything added to the list. > > For example, if I do this: > > white_list = [l.control_hub.serial_number if l.wblist == >

[issue25489] sys.exit() caught in exception handler

2015-10-28 Thread Guido van Rossum
Guido van Rossum added the comment: How about we extend loop.stop() so that you can pass it an exception to raise once the loop is stopped? This exception would then be thrown out of run_forever(). There may be some delay (callbacks already scheduled will run first) but it is how things were

[issue21333] Document recommended exception for objects that shouldn't be pickled

2015-10-28 Thread Michael Crouch
Michael Crouch added the comment: When pickling an object fails on line 70 of copy_reg.py, a "TypeError" is raised. However, according to section 11.1.3 of the Standard Library documentation, when an unpicklable object is passed to the dump() method the "PicklingError" exception will be

[issue21333] Document recommended exception for objects that shouldn't be pickled

2015-10-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PicklingError is raised in following cases: 1. Programmical Pickler error (Pickler.__init__() was not called by subclass' __init__()). 2. Due to protocol or implementation limitations: memoizing more than 2**32 objects, saving non-ASCII globals with

Re: UNABLE TO GET IDLE TO RUN

2015-10-28 Thread Michael Torrie
On 10/28/2015 10:10 AM, Peter Otten wrote: > Terry Reedy wrote: > > Thank you for your patience. > >> Why do you think it a misfeature for IDLE to execute code the way Python >> does? > > Sadly I wasn't aware that the interactive interpreter is also vulnerable. > I should have been, but failed

[issue25498] Python 3.4.3 core dump with simple sample code

2015-10-28 Thread Jake Montgomery
New submission from Jake Montgomery: We are seeing a consistent "invalid memory access" crash in Python3.4.3. *Test setup* This is occurring on Ubuntu 14.04.1 LTS. It is occurring on multiple unrelated installs, but has not been tested with any other operating system. It occurs using the

Re: UNABLE TO GET IDLE TO RUN

2015-10-28 Thread Peter Otten
Michael Torrie wrote: > On 10/28/2015 10:10 AM, Peter Otten wrote: >> Terry Reedy wrote: >> >> Thank you for your patience. >> >>> Why do you think it a misfeature for IDLE to execute code the way Python >>> does? >> >> Sadly I wasn't aware that the interactive interpreter is also vulnerable.

[issue25483] Improve f-string implementation: FORMAT_VALUE opcode

2015-10-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > I'll try to find some reasonable .h file to use and submit a new patch soon. It's Lib/opcode.py. -- nosy: +serhiy.storchaka ___ Python tracker

[issue21827] textwrap.dedent() fails when largest common whitespace is a substring of smallest leading whitespace

2015-10-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I thought that 3.4 will switch to "security fixes only" mode after releasing first release since releasing 3.5.0. It was so with 3.2 and 3.3. -- ___ Python tracker

[issue25483] Improve f-string implementation: FORMAT_VALUE opcode

2015-10-28 Thread Eric V. Smith
Eric V. Smith added the comment: Oops. Forgot to include the diff with that last message. But it turns out it doesn't work, anyway, because I put the #define's in opcode.h, which is generated (so my code got deleted!). I'll try to find some reasonable .h file to use and submit a new patch

[issue25483] Improve f-string implementation: FORMAT_VALUE opcode

2015-10-28 Thread Brett Cannon
Brett Cannon added the comment: I know this issue is slowly turning into "make Eric update outdated docs", but if you find that https://docs.python.org/devguide/compiler.html#introducing-new-bytecode is outdated, could you update that doc? -- ___

[issue21827] textwrap.dedent() fails when largest common whitespace is a substring of smallest leading whitespace

2015-10-28 Thread R. David Murray
Changes by R. David Murray : -- versions: +Python 3.4 ___ Python tracker ___ ___

[issue21827] textwrap.dedent() fails when largest common whitespace is a substring of smallest leading whitespace

2015-10-28 Thread R. David Murray
R. David Murray added the comment: You are right, I'd forgotten we hadn't done 3.4 final yet. -- ___ Python tracker ___

Re: List comprehension with if-else

2015-10-28 Thread Larry Martell
On Wed, Oct 28, 2015 at 12:36 PM, Zachary Ware wrote: > On Wed, Oct 28, 2015 at 11:25 AM, Larry Martell > wrote: >> I'm trying to do a list comprehension with an if and that requires an >> else, but in the else case I do not want anything

[issue25483] Improve f-string implementation: FORMAT_VALUE opcode

2015-10-28 Thread Eric V. Smith
Eric V. Smith added the comment: Brett: I'll take a look. Serhiy: I'm looking for a place to put some #defines related to the bit masks and bit values that my FORMAT_VALUE opcode is using for opargs. One option is to just put them in Tools/scripts/generate_opcode_h.py, so that they end up in

[issue25498] Python 3.4.3 core dump with simple sample code

2015-10-28 Thread R. David Murray
R. David Murray added the comment: The program does not crash for me on gentoo running python 3.4 tip (--with-pydebug). It does crash running gentoo's stock 3.4.3. So, perhaps this bug has already been fixed. -- nosy: +r.david.murray ___ Python

[issue25496] Default value for compresslevel is not documented

2015-10-28 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: Hi Sworddragon, Where compresslevel is not mentioned in the doc ? Thank you -- nosy: +matrixise ___ Python tracker

[issue25499] use argparse for the calendar module

2015-10-28 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: Why do you close it ? Ok, it's a duplicated issue, but the other issue is not closed. So, in that issue, there is no tests, maybe we can add some tests and re-submit a new patch. What do you think? -- ___ Python

[issue25156] shutil.copyfile should internally use os.sendfile when possible

2015-10-28 Thread Martin Panter
Martin Panter added the comment: Also, the os.sendfile() doc suggests that some platforms only support writing to sockets, so I definitely think a backup plan is needed. -- stage: -> patch review ___ Python tracker

[issue25395] SIGSEGV using json.tool: highly nested OrderedDict

2015-10-28 Thread Martin Panter
Martin Panter added the comment: Left a comment about a minor English grammar problem. The existing comment Serhiy mentioned was added way back in 2003 for Issue 668433. It appears to use the same underlying technique, reverting the nesting level before calling the base class dealloc. One

[issue25498] Python 3.4.3 core dump with simple sample code

2015-10-28 Thread eryksun
Changes by eryksun : -- keywords: +patch Added file: http://bugs.python.org/file40884/ctypes_from_buffer_1.patch ___ Python tracker

[issue25503] inspect.getdoc does find inherited property __doc__

2015-10-28 Thread John Mark Vandenberg
New submission from John Mark Vandenberg: inspect.getdoc's helper _finddoc raises an AttributeError on encountering a property, which is silently discarded. >>> class Foo(object): ... @property ... def foo(self): ... """foobar.""" ... return 'foo' ... >>> class

[issue24805] Python installer having problem in installing Python for all users in Windows

2015-10-28 Thread mandeep
mandeep added the comment: Team, Please let me know , if there is a workaround to this. -- ___ Python tracker ___

[issue25502] unnecessary re-imports

2015-10-28 Thread John Mark Vandenberg
Changes by John Mark Vandenberg : Added file: http://bugs.python.org/file40886/re-imports.diff ___ Python tracker ___

[issue25502] unnecessary re-imports

2015-10-28 Thread John Mark Vandenberg
New submission from John Mark Vandenberg: The following four modules re-import another module unnecessarily as it is already imported in the global scope. Lib/getpass.py : msvcrt Lib/pickletools.py : sys Lib/smtplib.py : sys PC/testpy.py : os In each case, the import being removed in the

Re: UNABLE TO GET IDLE TO RUN

2015-10-28 Thread Michael Torrie
On 10/28/2015 12:21 PM, Peter Otten wrote: > PS: The shell people have learned their lesson and no longer include the > working directory in the PATH: > $ ls # the real thing > $ ./ls # use at your own risk Sure but this is a somewhat different genre. > > So maybe > import string #

Re: Most space-efficient way to store log entries

2015-10-28 Thread Tim Chase
On 2015-10-29 00:21, Mark Lawrence wrote: > On 28/10/2015 22:53, Tim Chase wrote: >> If nobody is monitoring the logs, just write them to /dev/null >> for 100% compression. ;-) > > Can you get better than 100% compression if you write them to > somewhere other than /dev/null/ ? Well, /dev/null

[issue25486] Resurrect inspect.getargspec() in 3.6

2015-10-28 Thread John Mark Vandenberg
Changes by John Mark Vandenberg : -- nosy: +John.Mark.Vandenberg ___ Python tracker ___ ___

[issue25503] inspect.getdoc does find inherited property __doc__

2015-10-28 Thread John Mark Vandenberg
Changes by John Mark Vandenberg : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___

[issue25498] Python 3.4.3 core dump with simple sample code

2015-10-28 Thread eryksun
Changes by eryksun : Added file: http://bugs.python.org/file40883/ctypes_crash.py ___ Python tracker ___

[issue25496] tarfile: Default value for compresslevel is not documented

2015-10-28 Thread Sworddragon
Sworddragon added the comment: At tarfile, but the compresslevel argument is mentioned there but not its default value. -- title: Default value for compresslevel is not documented -> tarfile: Default value for compresslevel is not documented ___

Re: Most space-efficient way to store log entries

2015-10-28 Thread Chris Angelico
On Thu, Oct 29, 2015 at 12:09 PM, Cameron Simpson wrote: > On 29Oct2015 11:39, Chris Angelico wrote: >>> >>> If it's only zipped, it's not opaque. Just `zcat` or `zgrep` and >>> process away. The whole base64+minus_newlines thing does opaquify >>> and doesn't

[issue25498] Python 3.4.3 core dump with simple sample code

2015-10-28 Thread eryksun
Changes by eryksun : Removed file: http://bugs.python.org/file40884/ctypes_from_buffer_1.patch ___ Python tracker ___

[issue25499] use argparse for the calendar module

2015-10-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Because we need only one issue for every feature. Tests was committed in issue18982. The patch in issue18973 just waits for review. -- ___ Python tracker

[issue25485] Add a context manager to telnetlib.Telnet

2015-10-28 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: totally agree, I will work on this issue tomorrow -- ___ Python tracker ___

[issue25500] _find_and_load_unlocked doesn't always use __import__

2015-10-28 Thread Sergei Lebedev
New submission from Sergei Lebedev: According to the current import system documentation > When calling ``__import__()`` as part of an import statement, the import > system first checks the module global namespace for a function by that name. > If it is not found, then the standard builtin

[issue25500] _find_and_load_unlocked doesn't always use __import__

2015-10-28 Thread R. David Murray
Changes by R. David Murray : -- nosy: +brett.cannon, eric.snow ___ Python tracker ___

[issue18973] Use argparse in the calendar module

2015-10-28 Thread SilentGhost
Changes by SilentGhost : -- versions: +Python 3.6 -Python 3.4 ___ Python tracker ___ ___

[issue25483] Improve f-string implementation: FORMAT_VALUE opcode

2015-10-28 Thread Eric V. Smith
Eric V. Smith added the comment: Thanks, Serihy. I looked at those, and neither one is a great fit. But not having a better option, I went with ceval.h. Here's the patch. -- Added file: http://bugs.python.org/file40880/format-opcode-2.diff ___

[issue25485] Add a context manager to telnetlib.Telnet

2015-10-28 Thread desbma
desbma added the comment: I was actually writing a patch with a test, but since Stéphane beat me to it, I'll let him do the job :) -- ___ Python tracker

[issue25495] binascii documentation incorrect

2015-10-28 Thread Mouse
Mouse added the comment: Thank you for the quick turn-around, and for taking care of this issue! -- ___ Python tracker ___

[issue25485] Add a context manager to telnetlib.Telnet

2015-10-28 Thread SilentGhost
SilentGhost added the comment: This probably needs test -- nosy: +SilentGhost ___ Python tracker ___ ___

[issue25495] binascii documentation incorrect

2015-10-28 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: Here is a patch with the submitted description. -- keywords: +patch nosy: +matrixise Added file: http://bugs.python.org/file40878/issue25495.patch ___ Python tracker

[issue18973] Use argparse in the calendar module

2015-10-28 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: Hi Serhiy, I just reviewed your patch, works fine with 3.6. -- nosy: +matrixise ___ Python tracker ___

[issue25485] Add a context manager to telnetlib.Telnet

2015-10-28 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: Here is a small patch -- keywords: +patch nosy: +matrixise Added file: http://bugs.python.org/file40879/issue25485.patch ___ Python tracker

[issue25485] Add a context manager to telnetlib.Telnet

2015-10-28 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: Maybe, modify the documentation or improve the current examples. -- ___ Python tracker ___

[issue25501] Use async/await through asyncio docs

2015-10-28 Thread Brett Cannon
New submission from Brett Cannon: The asyncio docs still use `yield from` and @asyncio.coroutine all over the place instead of async/await. It would be best to update the docs to follow best practices (unless there is some reason I can't think of as to why this hasn't happened yet).

[issue25501] Use async/await through asyncio docs

2015-10-28 Thread Ezio Melotti
Changes by Ezio Melotti : -- keywords: +easy nosy: +ezio.melotti type: -> enhancement ___ Python tracker ___

[issue24765] Move .idlerc to %APPDATA%\IDLE on Windows

2015-10-28 Thread Mark Roseman
Mark Roseman added the comment: Further to Terry's backwards compatibility issues (also discussed in #8231). Storing things in the "correct" location (%APPDATA% on Windows, and Application Support on OS X) would presumably be the "right" thing to do if backwards compatibility weren't an

[issue25500] docs claim __import__ checked for in globals, but IMPORT_NAME bytecode does not

2015-10-28 Thread Brett Cannon
Brett Cannon added the comment: I think the documentation is wrong. Going all the way back to Python 2.7, you will see that importing a module emits IMPORT_NAME as the bytecode. That bytecode only looks for __import__ in the builtin namespace:

Re: how to get python socket to use a specific interface

2015-10-28 Thread Cameron Simpson
On 28Oct2015 10:41, Robin Becker wrote: binding to the local IP seems to be a windows only thing. No, it is a pretty standard BSD socket layer thing. (Windows got its original TCP stack from there too). I just tested a Linux RHEL6 host binding to a specific address just

[issue25498] Python 3.4.3 core dump with simple sample code

2015-10-28 Thread Martin Panter
Martin Panter added the comment: Crashes on Linux x86-64 for me with and without --with-pydebug, with the default 3.6 branch, 3.5.0, and 3.4 tip. No extra debugging output though in the --with-pydebug cases though. -- nosy: +martin.panter ___

Most space-efficient way to store log entries

2015-10-28 Thread Marc Aymerich
Hi, I'm writting an application that saves historical state in a log file. I want to be really efficient in terms of used bytes. What I'm doing now is: 1) First use zlib.compress 2) And then remove all new lines using binascii.b2a_base64, so I have a log entry per line. but b2a_base64 is far

[issue8231] Unable to run IDLE without write-access to home directory

2015-10-28 Thread Mark Roseman
Mark Roseman added the comment: Just a note that the 'store things in APPDATA' is issue #24765 -- ___ Python tracker ___

Re: Most space-efficient way to store log entries

2015-10-28 Thread Chris Angelico
On Thu, Oct 29, 2015 at 9:30 AM, Marc Aymerich wrote: > I'm writting an application that saves historical state in a log file. > I want to be really efficient in terms of used bytes. Why, exactly? By zipping the state, you make it utterly opaque. It'll require some sort of

[issue25501] Use async/await through asyncio docs

2015-10-28 Thread Guido van Rossum
Guido van Rossum added the comment: It makes it more awkward to keep the asyncio docs in sync between 3.4 and 3.5. Also it makes copying examples harder for users who need compatibility with 3.4 or 3.3. -- ___ Python tracker

[issue25500] docs claim __import__ checked for in globals, but IMPORT_NAME bytecode does not

2015-10-28 Thread R. David Murray
R. David Murray added the comment: Fix the docs. -- nosy: +r.david.murray ___ Python tracker ___ ___

[issue25156] shutil.copyfile should internally use os.sendfile when possible

2015-10-28 Thread desbma
desbma added the comment: Thoughts anyone? Here is a patch that implements the change. My tests show a 30-40% performance improvement for 128KB-512MB single file copy: 128 KB file copy: $ dd if=/dev/urandom of=/tmp/f1 bs=1K count=128 Without the patch: $ ./python -m timeit -s 'import shutil;

Re: Most space-efficient way to store log entries

2015-10-28 Thread Tim Chase
On 2015-10-29 09:38, Chris Angelico wrote: > On Thu, Oct 29, 2015 at 9:30 AM, Marc Aymerich > wrote: > > I'm writting an application that saves historical state in a log > > file. I want to be really efficient in terms of used bytes. > > Why, exactly? > > By zipping the

Re: Most space-efficient way to store log entries

2015-10-28 Thread Mark Lawrence
On 28/10/2015 22:53, Tim Chase wrote: On 2015-10-29 09:38, Chris Angelico wrote: On Thu, Oct 29, 2015 at 9:30 AM, Marc Aymerich wrote: I'm writting an application that saves historical state in a log file. I want to be really efficient in terms of used bytes. Why,

[issue25501] Use async/await through asyncio docs

2015-10-28 Thread Andrew Svetlov
Andrew Svetlov added the comment: Also sphinx (pygments actually) still do not support async/await syntax highlighting yet. -- nosy: +asvetlov ___ Python tracker

[issue25501] Use async/await through asyncio docs

2015-10-28 Thread Andrew Svetlov
Andrew Svetlov added the comment: We have dropped 3.3 in aiohttp BTW. Proper handling of resource leaks is too annoying without PEP 442 which don't crash with core dump starting from Python 3.4.1 -- ___ Python tracker

[issue25498] Python 3.4.3 core dump with simple sample code

2015-10-28 Thread Martin Panter
Martin Panter added the comment: I traced this down to part of revision 1da9630e9b7f (Issue #22896). If I revert the changes to CDataType_from_buffer() at , the crash no longer happens. I suspect the offending code is this, that is trying

[issue25489] sys.exit() caught in exception handler

2015-10-28 Thread Brian Sutherland
Brian Sutherland added the comment: Calling loop.stop() means that I need other, more complex code, to store and return the non-zero exit status. -- ___ Python tracker

[issue25496] Default value for compresslevel is not documented

2015-10-28 Thread Berker Peksag
Changes by Berker Peksag : -- assignee: -> docs@python components: +Documentation keywords: +easy nosy: +berker.peksag, docs@python stage: -> needs patch versions: +Python 3.4, Python 3.6 ___ Python tracker

Re: how to get python socket to use a specific interface

2015-10-28 Thread Robin Becker
.. binding to the local IP seems to be a windows only thing. No, it is a pretty standard BSD socket layer thing. (Windows got its original TCP stack from there too). I just tested a Linux RHEL6 host binding to a specific address just now using telnet: /usr/bin/telnet -b x.x.x.193

[issue25482] signal.set_wakeup_fd() doesn't work if the signal don't have handler

2015-10-28 Thread Berker Peksag
Changes by Berker Peksag : -- nosy: +haypo ___ Python tracker ___ ___

[issue21827] textwrap.dedent() fails when largest common whitespace is a substring of smallest leading whitespace

2015-10-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM. But the implementation can be more efficient. Here is optimized patch. 34e88a05562f.diff: $ ./python -m timeit -s 'import textwrap; s = "{0} x\n{0}\tx\n".format(" "*100)' -- 'textwrap.dedent(s)' 1 loops, best of 3: 87.5 usec per loop $ ./python -m

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

2015-10-28 Thread Martin Panter
Martin Panter added the comment: Please see Issue 25498 for a crash possibly caused by the memoryview hack in CDataType_from_buffer(). -- ___ Python tracker

Re: Most space-efficient way to store log entries

2015-10-28 Thread Chris Angelico
On Thu, Oct 29, 2015 at 9:53 AM, Tim Chase wrote: > On 2015-10-29 09:38, Chris Angelico wrote: >> On Thu, Oct 29, 2015 at 9:30 AM, Marc Aymerich >> wrote: >> > I'm writting an application that saves historical state in a log >> > file. I want

Re: Most space-efficient way to store log entries

2015-10-28 Thread Chris Angelico
On Thu, Oct 29, 2015 at 11:21 AM, Mark Lawrence wrote: >> Though one also has to consider the speed of reading it off the drive >> for processing. If you have spinning-rust drives, it's pretty slow >> (and SSD is still not like accessing RAM), and reading zipped >>

[issue25156] shutil.copyfile should internally use os.sendfile when possible

2015-10-28 Thread Josh Rosenberg
Josh Rosenberg added the comment: Adding interested parties from earlier ticket. -- nosy: +josh.r, martin.panter, r.david.murray ___ Python tracker ___

Re: Most space-efficient way to store log entries

2015-10-28 Thread Cameron Simpson
On 29Oct2015 11:39, Chris Angelico wrote: If it's only zipped, it's not opaque. Just `zcat` or `zgrep` and process away. The whole base64+minus_newlines thing does opaquify and doesn't really save all that much for the trouble. If you zip the whole file as a whole, yes. If

[issue25156] shutil.copyfile should internally use os.sendfile when possible

2015-10-28 Thread Martin Panter
Martin Panter added the comment: I’ve never used sendfile() nor shutil.copyfile(), but my immediate reaction is maybe we need a backup plan if os.sendfile() is available but not supported in the circumstances. E.g. if it is practical to use copyfile() to copy from a named socket in the