[issue25625] "chdir" Contex manager for pathlib

2021-10-20 Thread desbma
Change by desbma : -- nosy: -desbma ___ Python tracker <https://bugs.python.org/issue25625> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue5811] io.BufferedReader.peek(): Documentation differs from Implementation

2020-09-21 Thread desbma
Change by desbma : -- nosy: +desbma ___ Python tracker <https://bugs.python.org/issue5811> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue37157] shutil: add reflink=False to file copy functions to control clone/CoW copies (use copy_file_range)

2020-04-22 Thread desbma
Change by desbma : -- nosy: +desbma ___ Python tracker <https://bugs.python.org/issue37157> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue31749] Request: Human readable byte amounts in the standard library

2019-05-29 Thread desbma
Change by desbma : -- nosy: +desbma ___ Python tracker <https://bugs.python.org/issue31749> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue36046] support dropping privileges when running subprocesses

2019-03-02 Thread desbma
Change by desbma : -- nosy: +desbma ___ Python tracker <https://bugs.python.org/issue36046> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue36103] Increase shutil.COPY_BUFSIZE

2019-02-25 Thread desbma
desbma added the comment: If you do a benchmark by reading from a file, and then writing to /dev/null several times, without clearing caches, you are measuring *only* the syscall overhead: * input data is read from the Linux page cache, not the file on your SSD itself * no data is written

[issue36103] Increase shutil.COPY_BUFSIZE

2019-02-25 Thread desbma
desbma added the comment: Your first link explains why 128kB buffer size is faster in the context of cp: it's due to fadvise and kernel read ahead. None of the shutil functions call fadvise, so the benchmark and conclusions are irrelevant to the Python buffer size IMO. In general

[issue32073] Add copy_directory_metadata parameter to shutil.copytree

2018-08-03 Thread desbma
desbma added the comment: copy2 always raises "OSError: [Errno 95] Operation not supported" here https://github.com/python/cpython/blob/9bb6fe52742340f6c92f0dda18599a4577a94e18/Lib/shutil.py#L258 but I can work around that by passing copy_function=shutil.copy to copytree as I

[issue32073] Add copy_directory_metadata parameter to shutil.copytree

2018-08-03 Thread desbma
desbma added the comment: Note that in the examples above both copytree calls actually succeed (only metadata copy failed). The user can disable file metadata copy by passing 'copy_function=shutil.copy', but there is no way to do the same for directories and the directory copystat call

[issue32073] Add copy_directory_metadata parameter to shutil.copytree

2018-08-03 Thread desbma
desbma added the comment: Traceback is not very useful in that case: mkdir /tmp/a touch /tmp/a/b python Python 3.6.6 (default, Jun 27 2018, 13:11:40) [GCC 8.1.1 20180531] on linux Type "help", "copyright", "credits" or "license" for more informat

[issue24564] shutil.copytree fails when copying NFS to NFS

2018-08-02 Thread desbma
desbma added the comment: > Since the `copy_function` is customizable to switch between `copy` and > `copy2`, making copystat optional on files, perhaps the `copystat` should be > optional on directories, as well. Related: https://bugs.python.org/issue32073 -- nosy

[issue33671] Efficient zero-copy for shutil.copy* functions (Linux, OSX and Win)

2018-06-26 Thread desbma
Change by desbma : -- nosy: -desbma ___ Python tracker <https://bugs.python.org/issue33671> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue33639] Use high-performance os.sendfile() in shutil.copy*

2018-05-24 Thread desbma
desbma <dutch...@gmail.com> added the comment: Honestly, whatever gets this thing moving forward is good with me. I'm a bit depressed by the number of issues here that have a good patch waiting to be merged, or even read, and that languish for years. I haven't read your patch in

[issue33639] Use high-performance os.sendfile() in shutil.copy*

2018-05-24 Thread desbma
desbma <dutch...@gmail.com> added the comment: Duplicate of https://bugs.python.org/issue25156 ? -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue32073] Add copy_directory_metadata parameter to shutil.copytree

2017-12-19 Thread desbma
desbma <dutch...@gmail.com> added the comment: Ping -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32073> ___ ___ Python

[issue32073] Add copy_directory_metadata parameter to shutil.copytree

2017-11-18 Thread desbma
Change by desbma <dutch...@gmail.com>: -- keywords: +patch pull_requests: +4394 stage: -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue32073] Add copy_directory_metadata parameter to shutil.copytree

2017-11-18 Thread desbma
New submission from desbma <dutch...@gmail.com>: I am sometimes using shutil.copytree to copy a directory to a destination that does not support setting metadata (like MTP mounts of Android devices). Using the copy_function parameter allows passing shutil.copy or a custom function to

[issue28708] Low FD_SETSIZE limit on Windows

2017-11-06 Thread desbma
desbma <dutch...@gmail.com> added the comment: I just want to say that I strongly support either bumping the value of FD_SETSIZE to something a lot higher than 512, or making it configurable from Python code. I am the author of a program that makes heavy use of asyncio. Some Windows

[issue29212] Python 3.6 logging thread name regression with concurrent.future threads

2017-09-02 Thread desbma
desbma added the comment: Gregory, please don't forget to backport the fix in the 3.6 branch, so that it is released with Python 3.6.3. Thank you -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue26826] Expose new copy_file_range() syscall in os module.

2017-08-31 Thread desbma
Changes by desbma <dutch...@gmail.com>: -- nosy: +desbma ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26826> ___ ___ Python

[issue31268] Inconsistent socket timeout exception

2017-08-24 Thread desbma
desbma added the comment: Thanks for the insight. Well the most logical thing for me for the OS to do, would have been: 1. Send an ARP request 2. At the first poll call, report a timeout if no response was received 3. Repeat to 2. until the destination is considered unreachable 4. At the next

[issue31268] Inconsistent socket timeout exception

2017-08-24 Thread desbma
desbma added the comment: Yes, you are right: I tried with a small C program, and compared with strace log of the Python program. In both cases poll sometimes returns -1 (error), or sometimes 0 (timeout). This is a weird behavior (at least for me) of the TCP stack, but clearly Python

[issue31268] Inconsistent socket timeout exception

2017-08-24 Thread desbma
New submission from desbma: When trying to connect a classic TCP socket to a non reachable peer, the exception reported is inconsistent if the socket has a timeout set. See the attached program, on my system (Arch Linux with Linux 4.9 & Python 3.6.2) it outputs: timeout timed out tim

[issue29212] Python 3.6 logging thread name regression with concurrent.future threads

2017-06-21 Thread desbma
desbma added the comment: Thank you Gregory for the insight and new patch. Can this be merged in the 3.6 branch as well (targeting the 3.6.3 release)? -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue29212] Python 3.6 logging thread name regression with concurrent.future threads

2017-06-21 Thread desbma
desbma added the comment: Ping. I think any change, included Inada Naoki's idea above is better that the current behavior that pollutes the logging module output. Unfortunately I cannot rely on the 3.6 new thread_name_prefix argument for portability reasons, and have to manually patch my

[issue28206] signal.Signals not documented

2017-06-04 Thread desbma
Changes by desbma <dutch...@gmail.com>: -- pull_requests: +2018 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28206> ___ __

[issue30219] webbrowser.open outputs xdg-open deprecation warning

2017-05-12 Thread desbma
desbma added the comment: The only issue with Python itself is that the output of a subprocess call hidden behind a high level abstraction is thrown into the user's face in an unexpected way. This just does not seem to be the right thing to do to me. The deprecation warning of xdg-open/gvfs

[issue30219] webbrowser.open outputs xdg-open deprecation warning

2017-05-11 Thread desbma
desbma added the comment: > For example, thanks to stdout/stderr, you noticed the warning. Without > stdout/stderr, the warning should be hidden. That is true, but as a Python user, it don't need to see that warning, only the xdg-utils developers do. I would have never seen it, and it

[issue30219] webbrowser.open outputs xdg-open deprecation warning

2017-05-11 Thread desbma
desbma added the comment: Why do you think this isn't a good idea? As a user, what am supposed to do with that warning: * about a program I have no idea I was calling (the webbrowser module abstraction is here so I don't have to think about it) * I have no control about it's invocation

[issue30219] webbrowser.open outputs xdg-open deprecation warning

2017-05-10 Thread desbma
desbma added the comment: Ping -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30219> ___ ___ Python-bugs-list mailing list

[issue30219] webbrowser.open outputs xdg-open deprecation warning

2017-05-02 Thread desbma
desbma added the comment: Also most other Popen calls in the webbrowser module already silence the called program's output, so it makes sense to do the same for the BackgroundBrowser class. Here is a small patch for discussion. -- keywords: +patch Added file: http://bugs.python.org

[issue30219] webbrowser.open outputs xdg-open deprecation warning

2017-05-02 Thread desbma
desbma added the comment: I'm on Arch Linux with Cinnamon, all packages up to date and xdg-utils 1.1.1 (https://www.archlinux.org/packages/extra/any/xdg-utils/). The fix you mention has not been included in a release yet, last release of xdg-utils is from 2015 (https

[issue30219] webbrowser.open outputs xdg-open deprecation warning

2017-05-01 Thread desbma
Changes by desbma <dutch...@gmail.com>: -- type: -> behavior ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30219> ___ ___

[issue30219] webbrowser.open outputs xdg-open deprecation warning

2017-05-01 Thread desbma
New submission from desbma: Python 3.6.1 (default, Mar 27 2017, 00:27:06) [GCC 6.3.1 20170306] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import webbrowser >>> webbrowser.open("https://ww

[issue29212] Python 3.6 logging thread name regression with concurrent.future threads

2017-02-09 Thread desbma
desbma added the comment: Ping, so that this has a chance for the 3.6.1 release. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue29212] Python 3.6 logging thread name regression with concurrent.future threads

2017-01-23 Thread desbma
desbma added the comment: I don't think using repr(self) as a fallback was intentional, that is why I wrote regression, but I may be wrong. I agree that the previous default 'Thread-x' gives little information, but only the user can give a relevant name to describe what a thread is doing

[issue29212] Python 3.6 logging thread name regression with concurrent.future threads

2017-01-22 Thread desbma
desbma added the comment: Ping -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29212> ___ ___ Python-bugs-list mailing list

[issue29212] Python 3.6 logging thread name regression with concurrent.future threads

2017-01-12 Thread desbma
desbma added the comment: Thoughts anyone? This is a minor bug, but for a common use case (easy to hit), and the fix is trivial. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue29212] Python 3.6 logging thread name regression with concurrent.future threads

2017-01-09 Thread desbma
Changes by desbma <dutch...@gmail.com>: -- components: +Library (Lib) versions: +Python 3.7 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue29212] Python 3.6 logging thread name regression with concurrent.future threads

2017-01-09 Thread desbma
desbma added the comment: Here is a patch that restores the previous behavior and update test to catch bogus naming. -- keywords: +patch Added file: http://bugs.python.org/file46224/issue29212_1.patch ___ Python tracker <rep...@bugs.python.

[issue29212] Python 3.6 logging thread name regression with concurrent.future threads

2017-01-09 Thread desbma
desbma added the comment: The bug seem to have been introduced by https://hg.python.org/cpython/rev/1002a1bdc5b1 -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue29212] Python 3.6 logging thread name regression with concurrent.future threads

2017-01-08 Thread desbma
New submission from desbma: Logging statement using 'threadName' from concurrent.futures threads produce the wrong output with Python 3.6. The attached program with Python 3.5.X outputs: MainThread From main thread Thread-1 From worker thread But with 3.6, it outputs: MainThread From main

[issue26403] Catch FileNotFoundError in socketserver.DatagramRequestHandler

2016-02-22 Thread desbma
Changes by desbma <dutch...@gmail.com>: -- title: Don't call sendto in socketserver.DatagramRequestHandler if there is nothing to send -> Catch FileNotFoundError in socketserver.DatagramRequestHandler ___ Python tracker <rep...@bug

[issue26403] Don't call sendto in socketserver.DatagramRequestHandler if there is nothing to send

2016-02-22 Thread desbma
desbma added the comment: OK, so first part of this issue (sendto called even if no data has been written) is indeed a duplicate of https://bugs.python.org/issue1767511 sorry for that. For the second part of the issue (the exception not silenced), I have attached a new patch

[issue1767511] SocketServer.DatagramRequestHandler with empty response

2016-02-22 Thread desbma
Changes by desbma <dutch...@gmail.com>: -- nosy: +desbma ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue1767511> ___ __

[issue26403] Don't call sendto in socketserver.DatagramRequestHandler if there is nothing to send

2016-02-21 Thread desbma
Changes by desbma <dutch...@gmail.com>: -- type: -> behavior ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26403> ___ ___

[issue26403] Don't call sendto in socketserver.DatagramRequestHandler if there is nothing to send

2016-02-21 Thread desbma
Changes by desbma <dutch...@gmail.com>: -- title: Don't call sendto in DatagramRequestHandler if there is nothing to send -> Don't call sendto in socketserver.DatagramRequestHandler if there is nothing to send ___ Python tra

[issue26403] Don't call sendto in DatagramRequestHandler if there is nothing to send

2016-02-21 Thread desbma
Changes by desbma <dutch...@gmail.com>: -- components: +Library (Lib) -Macintosh keywords: +patch Added file: http://bugs.python.org/file41991/issue26403.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue26403] Don't call sendto in DatagramRequestHandler if there is nothing to send

2016-02-21 Thread desbma
New submission from desbma: When using socketserver to create a simple server for Unix Domain sockets (see server_dgram.py), and when sending data with a client that immediately shuts down (without waiting for a response, on Linux I test with 'echo data | nc -Uu -w 0 /tmp/s.socket') I get

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

2016-02-07 Thread desbma
desbma added the comment: If anyone is interested, I have created a package to monkey patch shutil.copyfile to benefit from sendfile, similarly to the last patch, but it also works on older Python versions down to 2.7. PyPI link: https://pypi.python.org/pypi/pyfastcopy

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

2016-01-02 Thread desbma
desbma added the comment: Can this patch be merged, or is there something I can do to improve it? -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

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

2015-12-05 Thread desbma
desbma added the comment: Thank you SilentGhost for the second review on the v4 patch. Attached is the v5 patch which hopefully is getting even better. -- Added file: http://bugs.python.org/file41252/issue25156_v5.patch ___ Python tracker <

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

2015-12-04 Thread desbma
desbma added the comment: Here is a new patch, with changes suggested by SilentGhost and josh.rosenberg in the review. -- Added file: http://bugs.python.org/file41243/issue25156_v4.patch ___ Python tracker <rep...@bugs.python.org>

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

2015-12-02 Thread desbma
desbma added the comment: Ping A small patch, but a good performance improvement :) -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue25061] Add native enum support for argparse

2015-11-04 Thread desbma
desbma added the comment: I guess the question is whether Enum should be considered a first class 'native' type that deserves support in argparse, or just a tool among others in the stdlib. The fact that Enum is implemented as a class, and lives in a module, tends to lead to the second

[issue25061] Add native enum support for argparse

2015-11-03 Thread desbma
desbma added the comment: I came up with something that satisfies my needs (no boilerplate code, and intuitive add_argument call). I modified your factory, and defined a simple action class (this is a quick and dirty prototype for discussion, I am in no way asking that such thing should

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

2015-10-31 Thread desbma
desbma added the comment: Here is an updated patch that takes into account Martin's suggestions, both here and in the code review. -- Added file: http://bugs.python.org/file40911/issue25156_v3.patch ___ Python tracker <rep...@bugs.python.org>

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

2015-10-30 Thread desbma
desbma added the comment: Here is an improved patch with the following changes: * Fallback to copyfileobj if sendfile fails with errno set to EINVAL or ENOSYS * Add a test for > 4GB file -- Added file: http://bugs.python.org/file40906/issue25156_v2.pa

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

2015-10-29 Thread desbma
desbma added the comment: I played a bit with Unix domain sockets, and it appears you can not open them like a file with open(). So they do no work with the current implementation of shutil.copyfile anyway. -- ___ Python tracker <

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

2015-10-29 Thread desbma
desbma added the comment: Thanks for 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. You are right, the man page clearly says: > Applications may wish to fall back to read(2

[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 <rep...@bugs.python.org> <http://bugs.python.org/i

[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

[issue25485] Add a context manager to telnetlib.Telnet

2015-10-26 Thread desbma
New submission from desbma: telnetlib.Telnet could have a context manager to call close() automatically. I can provide a patch if the idea is approved, although I have never contributed to Python. -- components: Library (Lib) messages: 253489 nosy: desbma priority: normal severity

[issue25238] Version added of context parameter for xmlrpc.client.ServerProxy incorrect

2015-10-03 Thread desbma
desbma added the comment: Previous sentence is if we only mention 3.4.3 of course. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue25238] Version added of context parameter for xmlrpc.client.ServerProxy incorrect

2015-10-03 Thread desbma
desbma added the comment: In my mind 3.4.3 < 3.5, so unless mentioned otherwise it is implied that the change is in all versions of the 3.5 branch. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.or

[issue25238] Version added of context parameter for xmlrpc.client.ServerProxy incorrect

2015-09-26 Thread desbma
New submission from desbma: Doc of 3.4 branch says the context parameter for xmlrpc.client.ServerProxy was added at version 3.4.3: https://docs.python.org/3.4/library/xmlrpc.client.html?highlight=xmlrpc.client#module-xmlrpc.client Although doc of 3.5 branch says the context parameter

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

2015-09-21 Thread desbma
desbma added the comment: Additional advantage of calling sendfile from shutil.copyfile: other fonctions in shutil module would automatically benefit from the use of senfile because they call copyfile directly (copy, copy2) or indirectly (copytree). So for example, the performance

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

2015-09-17 Thread desbma
New submission from desbma: This is related to issue25063 (https://bugs.python.org/issue25063). Trying to use sendfile internally in shutil.copyfileobj was considered risky because of special Python files that expose a file descriptor but wrap it to add special behavior (eg: GzipFile). I

[issue25061] Add native enum support for argparse

2015-09-17 Thread desbma
desbma added the comment: Thanks for sharing this code, I like the factory idea. I'll have a look at creating a custom Action class too. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue25063] shutil.copyfileobj should internally use os.sendfile when possible

2015-09-13 Thread desbma
desbma added the comment: If I understand you correctly, a naive implementation like this: use_chunk_copy = False try: fdsrc = fsrc.fileno() fddst = fdst.fileno() except OSError: # fallback on current chunk based Python copy use_chunk_copy = True else: # we have 2 fd, try sendfile

[issue25061] Add native enum support for argparse

2015-09-13 Thread desbma
desbma added the comment: I would like the enum type to be stored directly. With your approach, the user does not know what are the possible choices, until he/she tries a invalid value and get the exception. If I pass the enum type to the choice parameter, the help message is not very user

[issue25061] Add native enum support for argparse

2015-09-10 Thread desbma
Changes by desbma <dutch...@gmail.com>: -- components: +Library (Lib) ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25061> ___ _

[issue25063] shutil.copyfileobj should internally use os.sendfile when possible

2015-09-10 Thread desbma
New submission from desbma: Sorry if it has already been discussed, or if this is a stupid idea. By looking at the signature, my thought was that the only use of shutil.copyfileobj was to wrap the use of sendfile, and use a fallback if it is not available on the system or not usable

[issue3548] subprocess.pipe function

2015-09-10 Thread desbma
Changes by desbma <dutch...@gmail.com>: -- nosy: +desbma ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue3548> ___ ___ Python

[issue25061] Add native enum support for argparse

2015-09-10 Thread desbma
New submission from desbma: I often find myself using the following pattern with argparse: import argparse import enum CustomEnumType = enum.Enum("CustomEnumType", ("VAL1", "VAL2", "VAL3", ...)) arg_parser = argparse.Argumen