[issue17561] Add socket.bind_socket() convenience function

2019-04-08 Thread Giampaolo Rodola'
Change by Giampaolo Rodola' : -- pull_requests: +12658 stage: resolved -> patch review ___ Python tracker <https://bugs.python.org/issue17561> ___ ___ Python-

[issue17561] Add socket.bind_socket() convenience function

2019-04-08 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Patch committed as of: https://github.com/python/cpython/commit/eb7e29f2a9d075accc1ab3faf3612ac44f5e2183 For posterity, since the API evolved since the original proposal (as per PR review/suggestions), this is the final incarnation: # IPv4 only

[issue17561] Add socket.bind_socket() convenience function

2019-04-08 Thread Giampaolo Rodola'
Change by Giampaolo Rodola' : -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue35934] Add socket.create_server() utility function

2019-04-08 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: New changeset eb7e29f2a9d075accc1ab3faf3612ac44f5e2183 by Giampaolo Rodola in branch 'master': bpo-35934: Add socket.create_server() utility function (GH-11784) https://github.com/python/cpython/commit/eb7e29f2a9d075accc1ab3faf3612ac44f5e2183

[issue36488] os.sendfile() on BSD, macOS don't return bytes sent on EINTR

2019-04-05 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: sendfile() on BSD/OSX is complicated by the headers/trailers args. You'll have to take that into account in the retry logic, adding unnecessary complexity. Since sendfile() may already return fewer bytes than requested (e.g. non-blocking sockets or big

[issue32941] mmap should expose madvise()

2019-04-02 Thread Giampaolo Rodola'
Change by Giampaolo Rodola' : -- nosy: +giampaolo.rodola ___ Python tracker <https://bugs.python.org/issue32941> ___ ___ Python-bugs-list mailing list Unsub

[issue36488] os.sendfile() on BSD and macOS does not return bytes sent on EINTR

2019-03-30 Thread Giampaolo Rodola'
Change by Giampaolo Rodola' : -- title: os.sendfile() on BSD OSs and macOS does not return bytes sent on EINTR -> os.sendfile() on BSD and macOS does not return bytes sent on EINTR ___ Python tracker <https://bugs.python.org/issu

[issue36488] BSD/OSX: os.sendfile() does not return bytes sent on EINTR

2019-03-30 Thread Giampaolo Rodola'
Change by Giampaolo Rodola' : -- nosy: +rosslagerwall ___ Python tracker <https://bugs.python.org/issue36488> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36488] BSD/OSX: os.sendfile() does not return bytes sent on EINTR

2019-03-30 Thread Giampaolo Rodola'
New submission from Giampaolo Rodola' : >From "man sendfile" on both OSX and FreeBSD: <<[EINTR] A signal interrupted sendfile() before it could be completed. If specified, the number of bytes successfully sent will be returned in *len.>> Right now we catch EINTR and

[issue29515] socket module missing IPPROTO_IPV6, IPPROTO_IPV4 on Windows

2019-03-28 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Merged. I'm agnostic about backporting IPPROTO_IPV6 (or others) on < 3.8 so I'll leave it up to somebody else to decide/implement. -- status: open -> pending versions: -Python 3.7 ___ Python tracker

[issue29515] socket module missing IPPROTO_IPV6, IPPROTO_IPV4 on Windows

2019-03-28 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: New changeset 3eca28c61363a03b81b9fb12775490d6e42d8ecf by Giampaolo Rodola in branch 'master': bpo-29515: add missing socket.IPPROTO_* constants on Windows (GH-12183) https://github.com/python/cpython/commit/3eca28c61363a03b81b9fb12775490d6e42d8ecf

[issue29515] socket module missing IPPROTO_IPV6, IPPROTO_IPV4 on Windows

2019-03-18 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: I'd like to move forward with this in order to fix issue17561. If there are no complaints I'm gonna merge this in ~ a week. -- ___ Python tracker <https://bugs.python.org/issue29

[issue36256] parser module fails on legal input

2019-03-11 Thread Giampaolo Rodola'
Change by Giampaolo Rodola' : -- nosy: -giampaolo.rodola ___ Python tracker <https://bugs.python.org/issue36256> ___ ___ Python-bugs-list mailing list Unsub

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

2019-03-11 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Little update about this. According to: http://man7.org/linux/man-pages/man2/copy_file_range.2.html ...it seems glibc 2.27 released on 2018-02-01 includes copy_file_range(). I'm not the best candidate for giving advice on C syscalls definitions

[issue4080] unittest: display time used by each test case

2019-03-10 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Hello. This is something I needed so I decided to implement it by taking inspiration from pytest's --durations=N argument, which basically does the same (except that it uses 0.XX precision instead of 0.XXX). PR at: https://github.com/python/cpython/pull

[issue4080] unittest: display time used by each test case

2019-03-10 Thread Giampaolo Rodola'
Change by Giampaolo Rodola' : -- pull_requests: +12254 ___ Python tracker <https://bugs.python.org/issue4080> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36208] AsyncIO V4MAPPED addresses with V6ONLY.

2019-03-06 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: I'm not sure I understand the issue, but setting IPV6_V6ONLY to 0 by default is not an option because asyncio wants to serve IPv4 and IPv6 with 2 distinct sockets on purpose. The reason for that is because when an IPv4 connection occurs we want

[issue29515] socket module missing IPPROTO_IPV6, IPPROTO_IPV4 on Windows

2019-03-05 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: IPPROTO_TCP/UDP/RAW/ICMP are already there. AFAICT the only useful one here is IPPROTO_IPV6, because it's needed for enabling dual-stack. I don't think IPPROTO_IPV4 is a must (e.g. it's not available on Linux). Same for IPPROTO_ICMPV6. The only reason we

[issue29515] socket module missing IPPROTO_IPV6, IPPROTO_IPV4 on Windows

2019-03-05 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Done: https://github.com/python/cpython/pull/12183/ This adds quite a bunch of new constants so I would be keen on considering it an enhancement rather than a bugfix and land it in 3.8 only. As for 3.7 and 3.6 (and 2.7?) it may make sense to fix

[issue27409] List socket.SO_*, SCM_*, MSG_*, IPPROTO_* symbols

2019-03-05 Thread Giampaolo Rodola'
Change by Giampaolo Rodola' : -- nosy: +giampaolo.rodola ___ Python tracker <https://bugs.python.org/issue27409> ___ ___ Python-bugs-list mailing list Unsub

[issue29515] socket module missing IPPROTO_IPV6, IPPROTO_IPV4 on Windows

2019-03-05 Thread Giampaolo Rodola'
Change by Giampaolo Rodola' : -- keywords: +patch pull_requests: +12179 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue29515> ___ _

[issue29515] socket module missing IPPROTO_IPV6, IPPROTO_IPV4 on Windows

2019-03-05 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: @Eryk do you mind if I make a PR with your code(I will of course author you)? Regardless from issue17561 I think this is an important fix because without IPPROTO_IPV6 is not possible to implement a dual-stack IPv4/6 socket on Windows

[issue31861] add aiter() and anext() functions to operator module

2019-03-04 Thread Giampaolo Rodola'
Change by Giampaolo Rodola' : -- nosy: -giampaolo.rodola ___ Python tracker <https://bugs.python.org/issue31861> ___ ___ Python-bugs-list mailing list Unsub

[issue30235] Validate shutil supports path-like objects, update docs accordingly

2019-02-28 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: One thing to note is the copy_function parameter: if a path-like object is given as input should the copy_function receive the same object instead of a path string? >>> copytree(path_like_src, path_like_dst, copy_function=foo) Because of i

[issue35652] Add use_srcentry parameter to shutil.copytree() II

2019-02-26 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: New changeset c606a9cbd48f69d3f4a09204c781dda9864218b7 by Giampaolo Rodola in branch 'master': bpo-35652: shutil.copytree(copy_function=...) erroneously pass DirEntry instead of path str (GH-11997) https://github.com/python/cpython/commit

[issue36103] Increase shutil.COPY_BUFSIZE

2019-02-26 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: @Inada: having played with this in the past I seem to remember that on Linux the bigger bufsize doesn't make a reasonable difference (but I may be wrong), that's why I suggest to try some benchmarks. In issue33671 I pasted some one-liners you can use

[issue35802] os.stat / os.lstat always present, but code checks hastattr(os, 'stat') / hasattr(os, 'lstat')

2019-02-25 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: A BB failed. Looks like it's unrelated with this change: https://buildbot.python.org/all/#/builders/99/builds/2198 -- nosy: +giampaolo.rodola ___ Python tracker <https://bugs.python.org/issue35

[issue36105] Windows: use GetNativeSystemInfo instead of GetSystemInfo

2019-02-25 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: It appears you guys are right. Sorry for the noise. -- ___ Python tracker <https://bugs.python.org/issue36105> ___ ___ Pytho

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

2019-02-25 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Yes, it's deliberate, see PR-12016. -- ___ Python tracker <https://bugs.python.org/issue33671> ___ ___ Python-bugs-list m

[issue36105] Windows: use GetNativeSystemInfo instead of GetSystemInfo

2019-02-25 Thread Giampaolo Rodola'
New submission from Giampaolo Rodola' : This is what MS doc says about GetSystemInfo: https://docs.microsoft.com/en-us/windows/desktop/api/sysinfoapi/nf-sysinfoapi-getsysteminfo <> $ grep -r GetSystemInfo Modules/_ctypes/malloc_closure.c:GetSystemInfo(); Modules/mmapmo

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

2019-02-24 Thread Giampaolo Rodola'
Change by Giampaolo Rodola' : -- pull_requests: -7529 ___ Python tracker <https://bugs.python.org/issue33671> ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2019-02-24 Thread Giampaolo Rodola'
Change by Giampaolo Rodola' : -- pull_requests: -7536 ___ Python tracker <https://bugs.python.org/issue33671> ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2019-02-24 Thread Giampaolo Rodola'
Change by Giampaolo Rodola' : -- pull_requests: -7528 ___ Python tracker <https://bugs.python.org/issue33671> ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2019-02-24 Thread Giampaolo Rodola'
Change by Giampaolo Rodola' : -- pull_requests: +12047 ___ Python tracker <https://bugs.python.org/issue33671> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35648] Add use_srcentry parameter to shutil.copytree()

2019-02-24 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: When user uses copy_function argument, the callback function should always receive path strings, both for consistency and for not breaking backward compatibility. This line: use_srcentry = copy_function is copy2 or copy_function is copy ...makes

[issue35813] shared memory construct to avoid need for serialization between processes

2019-02-23 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: IMHO given the size of the change and how quickly this evolved I would probably feel safer to mark the API as experimental (no pun intended, this is great work), at least in alpha2. I believe we now have a good explanation in the docs but it still needs

[issue35813] shared memory construct to avoid need for serialization between processes

2019-02-23 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: > Side note: I’m the author of the sysv_ipc package you found, as well as the > posix_ipc package. Sorry, I didn't realize it was you. > Not true. A manager started by one process can be connected to by another > process that is

[issue35648] Add use_srcentry parameter to shutil.copytree()

2019-02-23 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: It turns out that's a bug I introduced in PR-7874. I'm providing: https://github.com/python/cpython/pull/11997 ...which fixes it without introducing a new parameter. I also verified that monkey patching shutil.copy2 and shutil.copy doesn't cause any issue

[issue35652] Add use_srcentry parameter to shutil.copytree() II

2019-02-23 Thread Giampaolo Rodola'
Change by Giampaolo Rodola' : -- pull_requests: +12024 ___ Python tracker <https://bugs.python.org/issue35652> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33695] Have shutil.copytree(), copy() and copystat() use cached scandir() stat()s

2019-02-23 Thread Giampaolo Rodola'
Change by Giampaolo Rodola' : -- pull_requests: +12025 ___ Python tracker <https://bugs.python.org/issue33695> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35648] Add use_srcentry parameter to shutil.copytree()

2019-02-23 Thread Giampaolo Rodola'
Change by Giampaolo Rodola' : -- assignee: docs@python -> resolution: later -> status: closed -> open ___ Python tracker <https://bugs.python.or

[issue35652] Add use_srcentry parameter to shutil.copytree() II

2019-02-23 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Not sure why you created 2 identical issues. Closing this one as a duplicate of issue35648. -- nosy: +giampaolo.rodola resolution: -> duplicate stage: patch review -> resolved status: open -> closed _

[issue35652] Add use_srcentry parameter to shutil.copytree() II

2019-02-23 Thread Giampaolo Rodola'
Change by Giampaolo Rodola' : -- pull_requests: -12023 ___ Python tracker <https://bugs.python.org/issue35652> ___ ___ Python-bugs-list mailing list Unsub

[issue35813] shared memory construct to avoid need for serialization between processes

2019-02-23 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: > We are consciously choosing to not support an atomic "create or attach". > This significantly simplifies the API and avoids the valid concerns raised > around user confusion relating to that behavior (including the use of > dif

[issue35652] Add use_srcentry parameter to shutil.copytree() II

2019-02-23 Thread Giampaolo Rodola'
Change by Giampaolo Rodola' : -- pull_requests: +12023 ___ Python tracker <https://bugs.python.org/issue35652> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35813] shared memory construct to avoid need for serialization between processes

2019-02-22 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Also, there is no way to delete/unwrap memory without using an existing SharedMemory instance, which is something we may not have on startup. Perhaps we should have a "shared_memory.unlink(name)" function similar to os.unlink() which simp

[issue35813] shared memory construct to avoid need for serialization between processes

2019-02-22 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Code looks much better now. I'm still not convinced "SharedMemory(name=None, create=False, size=0)" is the best API. How are you supposed to "create or attach" atomically? You can do that with O_EXCL but as it stands this is not t

[issue36067] subprocess terminate() "invalid handle" error when process is gone

2019-02-21 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Interesting. Because both errors/conditions are mapped to ERROR_INVALID_HANDLE we need the creation time. I can work on a patch for that. Potentially I can also include OSX, Linux and BSD* implementations for methods involving os.kill(pid). That would

[issue36067] subprocess terminate() "invalid handle" error when process is gone

2019-02-21 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: On POSIX there is that risk, yes. As for Windows, the termination is based on the process handle instead of the PID, but I am not sure if that makes a difference. The risk of reusing the PID/handle is not related to this issue though. The solution I

[issue36067] subprocess terminate() "invalid handle" error when process is gone

2019-02-21 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: I think this is somewhat similar to issue14252. The problem I see is that we should either raise ProcessLookupError or ignore the error (better). This concept of suppressing errors if process is gone is currently already established in 2 places: https

[issue36067] subprocess terminate() "invalid handle" error when process is gone

2019-02-21 Thread Giampaolo Rodola'
New submission from Giampaolo Rodola' : Happened in psutil: https://ci.appveyor.com/project/giampaolo/psutil/builds/22546914/job/rlp112gffyf2o30i == ERROR: psutil.tests.test_process.TestProcess.test_halfway_terminated_process

[issue29515] socket module missing IPPROTO_IPV6, IPPROTO_IPV4 on Windows

2019-02-19 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: @eryksun I tried your patch (https://bugs.python.org/issue29515#msg287477) on Windows 10 and it looks good. It introduces the following new constants: IPPROTO_IGMP IPPROTO_GGP IPPROTO_PUP IPPROTO_IDP IPPROTO_ND IPPROTO_MAX IPPROTO_HOPOPTS IPPROTO_IPV4

[issue29515] socket module missing IPPROTO_IPV6, IPPROTO_IPV4 on Windows

2019-02-19 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: It turns out having this fix would be useful for proceeding with issue17561, which right now cannot support dual-stack IPv4/6 on Windows because IPPROTO_IPV6 is missing, see my comment: https://github.com/python/cpython/pull/11784#issuecomment-465078646

[issue20215] socketserver.TCPServer can not listen IPv6 address

2019-02-18 Thread Giampaolo Rodola'
Change by Giampaolo Rodola' : -- nosy: +giampaolo.rodola ___ Python tracker <https://bugs.python.org/issue20215> ___ ___ Python-bugs-list mailing list Unsub

[issue17561] Add socket.bind_socket() convenience function

2019-02-17 Thread Giampaolo Rodola'
Change by Giampaolo Rodola' : -- stage: patch review -> commit review ___ Python tracker <https://bugs.python.org/issue17561> ___ ___ Python-bugs-list mai

[issue33935] shutil.copyfile throws incorrect SameFileError on Google Drive File Stream

2019-02-17 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: @eryksun > Using the VSN and file index as if they're the same as POSIX st_dev and > st_ino is technically wrong. There is no guarantee that this tuple uniquely > identifies a file in Windows. I agree. FWIW, I faced the same issue on pyftpdlib

[issue35813] shared memory construct to avoid need for serialization between processes

2019-02-16 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: > It looks like it does skip calling ftruncate() if size is 0. From > posixshmem.c: Let me rephrase: are we forced to specify a value (aka call ftruncate()) on create ? If we are as I think, could size have a reasonable default value instea

[issue35813] shared memory construct to avoid need for serialization between processes

2019-02-16 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: As for *flags* argument "man shm_open" mentions 5 possible flags: - O_RDONLY, OR_RDWR: these can be served by existing *read_only* arg - O_CREAT, O_EXCL: dictates whether to raise error if file exists; could be served via *attach_if_exists* arg

[issue35813] shared memory construct to avoid need for serialization between processes

2019-02-16 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: > The unlink() method is available on the SharedMemory class. No manager is > required. This is also captured in the docs. I missed that, sorry. >> 3) it seems "size" kwarg cannot be zero (current default) > From the docs: When

[issue35813] shared memory construct to avoid need for serialization between processes

2019-02-16 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Hopefully my last iteration: =) 1) As for SharedMemoryManager, I believe it should live in multiprocessing.managers, not shared_memory.py. It's a subclass of Manager and behaves like a manager (start(), shutdown(), get_server(), etc.), so IMO that's its

[issue35813] shared memory construct to avoid need for serialization between processes

2019-02-16 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: > Because shared memory blocks are not "owned" by a single process... > [...] > I propose a simpler, consistent-across-platforms API like: > SharedMemory(name=None, create=False, size=0) Maybe something like this instead?

[issue35813] shared memory construct to avoid need for serialization between processes

2019-02-16 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: > Because shared memory blocks are not "owned" by a single process, they are > not destroyed/freed when a process exits. 1) it seems SharedMemory.close() does not destroy the memory region (I'm able to re-attach to it via name). If I'm n

[issue36003] set better defaults for TCPServer options

2019-02-15 Thread Giampaolo Rodola'
Change by Giampaolo Rodola' : -- keywords: +patch pull_requests: +11908 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue36003> ___ _

[issue36003] set better defaults for TCPServer options

2019-02-15 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Update: because "request_queue_size" is passed to server_activate() method which can be subclassed, a better default for not breaking backward compatibility is 0 (not None). -- ___ Python track

[issue36003] set better defaults for TCPServer options

2019-02-15 Thread Giampaolo Rodola'
New submission from Giampaolo Rodola' : socketserver.TCPServer provides the following defaults: allow_reuse_address = False request_queue_size = 5 Proposal is to: * have "allow_reuse_address = True" on POSIX in order to immediately reuse previous sockets which were bound on the sa

[issue12317] inspect.getabsfile() is not documented

2019-02-14 Thread Giampaolo Rodola'
Change by Giampaolo Rodola' : -- nosy: -giampaolo.rodola ___ Python tracker <https://bugs.python.org/issue12317> ___ ___ Python-bugs-list mailing list Unsub

[issue35934] Add socket.create_server() utility function

2019-02-14 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Correct. Sorry for the typo. -- ___ Python tracker <https://bugs.python.org/issue35934> ___ ___ Python-bugs-list mailin

[issue35982] Create unit-tests for os.renames()

2019-02-13 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Assigning this to me. FWIW I created a post on python-dev in order to add a test.support.rmpath() utility function and hopefully cover other os.* functions which may also be untested or not properly tested: https://mail.python.org/pipermail/python-dev

[issue35951] os.renames() creates directories if original name doesn't exist

2019-02-12 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: The proposed change makes the problem a lot less likely to occur, but technically it doesn't fix it because if the src file/dir disappears between "os.path.exists(src)" and os.rename(src, dst)" calls you'll end up with a race condition. We

[issue35934] Add socket.bind_socket() utility function

2019-02-11 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Closing this out as duplicate. Will continue in issue35934. -- resolution: -> duplicate stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue17561] Add socket.bind_socket() convenience function

2019-02-11 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: After iterating over this over the last few days I realized it makes more sense to implement and discuss the whole thing in here and as a single PR, so sorry about previously splitting this in a separate ticket/PR. Relevant PR is now this one

[issue35918] multiprocessing's SyncManager.dict.has_key() method is broken

2019-02-11 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: New changeset 58f05ce059cc5207320fef27a9fbc0ffdc2b1d1a by Giampaolo Rodola (Miss Islington (bot)) in branch '3.7': bpo-35918: Remove broken has_key method and add test (GH-11819) (#11824) https://github.com/python/cpython/commit

[issue35918] multiprocessing's SyncManager.dict.has_key() method is broken

2019-02-11 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: New changeset a31f4cc881992e84d351957bd9ac1a92f882fa39 by Giampaolo Rodola (Rémi Lapeyre) in branch 'master': bpo-35918: Remove broken has_key method and add test (#11819) https://github.com/python/cpython/commit/a31f4cc881992e84d351957bd9ac1a92f882fa39

[issue35813] shared memory construct to avoid need for serialization between processes

2019-02-11 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: I submitted an initial review / comments in the PR. I think this is good for a first iteration in order to understand what APIs to expose publicly (also, keep in mind I may not have a full picture of how this is intended to be used precisely

[issue35940] multiprocessing manager tests fail in the Refleaks buildbots

2019-02-10 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Pablo thanks a lot for taking care of this. -- ___ Python tracker <https://bugs.python.org/issue35940> ___ ___ Python-bug

[issue17561] Add socket.create_server_sock() convenience function

2019-02-07 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: After careful thinking I realize I'm not completely sure about how to expose the IPv4/6 functionality yet. I prefer to defer it for later and start landing a bind_socket() utility function which serves as a base for this functionality. See: issue17561

[issue35934] Add socket.bind_socket() utility function

2019-02-07 Thread Giampaolo Rodola'
Change by Giampaolo Rodola' : -- keywords: +patch pull_requests: +11769 ___ Python tracker <https://bugs.python.org/issue35934> ___ ___ Python-bugs-list mailin

[issue35934] Add socket.bind_socket() utility function

2019-02-07 Thread Giampaolo Rodola'
Change by Giampaolo Rodola' : -- keywords: +patch, patch, patch pull_requests: +11769, 11770, 11771 ___ Python tracker <https://bugs.python.org/issue35

[issue35934] Add socket.bind_socket() utility function

2019-02-07 Thread Giampaolo Rodola'
Change by Giampaolo Rodola' : -- keywords: +patch, patch pull_requests: +11769, 11770 ___ Python tracker <https://bugs.python.org/issue35934> ___ ___ Python-bug

[issue35934] Add socket.bind_socket() utility function

2019-02-07 Thread Giampaolo Rodola'
New submission from Giampaolo Rodola' : The main point of this patch is to automatize all the necessary tasks which are usually involved when creating a server socket, amongst which: * determining the right family based on address, similarly to socket.create_connection() * whether to use

[issue35913] asyncore: allow handling of half closed connections

2019-02-06 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: I agree. The problem I have with this is that it introduces a new method (handle_eof), which ends up in the "new functionality" bucket (even though it's not backward incompatible per-se, as it defaults on calling handle_close() anyway,

[issue35913] asyncore: allow handling of half closed connections

2019-02-06 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: > When recv() return 0 we may still have data to send. It seems recv() returning b"" is an alias for "connection lost". E.g. in Twisted: https://github.com/twisted/twisted/blob/06c891502be9f6389451fcc959cad5485f55d653/src/twisted/in

[issue35813] shared memory construct to avoid need for serialization between processes

2019-02-06 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Also, for completeness (since discussion is getting split), please see my proposal to move SharedMemoryManager and SharedMemoryServer into multiprocessing.managers namespace and rename shared_memory.py to _shared_memory.py: https://mail.python.org

[issue35919] multiprocessing: shared manager Pool fails with AttributeError

2019-02-06 Thread Giampaolo Rodola'
New submission from Giampaolo Rodola' : import multiprocessing import multiprocessing.managers def f(n): return n * n def worker(pool): with pool: pool.apply_async(f, (10, )) manager = multiprocessing.managers.SyncManager() manager.start() pool = manager.Pool(processes=4

[issue35913] asyncore: allow handling of half closed connections

2019-02-06 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Assigning this to me but am not sure 1) when I'll be able to look at this 2) whether it's worth it as asyncore is deprecated in favor of asyncio. -- assignee: -> giampaolo.rodola ___ Python tracker <

[issue35918] multiprocessing's SyncManager.dict.has_key() method is broken

2019-02-06 Thread Giampaolo Rodola'
New submission from Giampaolo Rodola' : Related to BPO-35917: $ ./python Python 3.8.0a1+ (heads/master:cd90f6a369, Feb 6 2019, 17:16:10) [GCC 7.3.0] on linux >>> import multiprocessing.managers >>> m = multiprocessing.managers.SyncManager() >>> m.start() &g

[issue35813] shared memory construct to avoid need for serialization between processes

2019-02-06 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Unit-tests at https://bugs.python.org/issue35917. -- nosy: +giampaolo.rodola ___ Python tracker <https://bugs.python.org/issue35

[issue35917] multiprocessing: provide unit-tests for manager classes and shareable types

2019-02-06 Thread Giampaolo Rodola'
Change by Giampaolo Rodola' : -- keywords: +patch, patch, patch pull_requests: +11740, 11741, 11742 ___ Python tracker <https://bugs.python.org/issue35

[issue35917] multiprocessing: provide unit-tests for manager classes and shareable types

2019-02-06 Thread Giampaolo Rodola'
Change by Giampaolo Rodola' : -- keywords: +patch, patch pull_requests: +11740, 11741 ___ Python tracker <https://bugs.python.org/issue35917> ___ ___ Python-bug

[issue35917] multiprocessing: provide unit-tests for manager classes and shareable types

2019-02-06 Thread Giampaolo Rodola'
Change by Giampaolo Rodola' : -- keywords: +patch pull_requests: +11740 ___ Python tracker <https://bugs.python.org/issue35917> ___ ___ Python-bugs-list mailin

[issue35917] multiprocessing: provide unit-tests for manager classes and shareable types

2019-02-06 Thread Giampaolo Rodola'
New submission from Giampaolo Rodola' : This is a follow up of BPO-35813 and PR-11664 and it provides unit tests for SyncManager and SharedMemoryManager classes + all the shareable types which are supposed to be supported by them. Also, see relevant python-dev discussion at: https

[issue35537] use os.posix_spawn in subprocess

2019-01-27 Thread Giampaolo Rodola'
Change by Giampaolo Rodola' : -- pull_requests: +11528 ___ Python tracker <https://bugs.python.org/issue35537> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue20849] add exist_ok to shutil.copytree

2018-12-28 Thread Giampaolo Rodola'
Change by Giampaolo Rodola' : -- assignee: -> giampaolo.rodola resolution: -> fixed stage: patch review -> commit review status: open -> closed ___ Python tracker <https://bugs.python

[issue20849] add exist_ok to shutil.copytree

2018-12-28 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: New changeset 9e00d9e88fbf943987e4771c753f5ca8f794103e by Giampaolo Rodola (jab) in branch 'master': bpo-20849: add dirs_exist_ok arg to shutil.copytree (patch by Josh Bronson) https://github.com/python/cpython/commit

[issue17561] Add socket.create_server_sock() convenience function

2018-12-18 Thread Giampaolo Rodola'
Change by Giampaolo Rodola' : -- pull_requests: +10452 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue17561> ___ ___ Python-bugs-lis

[issue35517] selector.EpollSelector: add new parameter to support EPOLLEXCLUSIVE

2018-12-17 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: I took a look at your PR. As the PR currently stands it only works with epoll() selector. For the other selectors this is just an extra argument which does nothing, so it complicates the API of 2 methods for no real gain. Also, a single argument

[issue35517] selector.EpollSelector: add new parameter to support EPOLLEXCLUSIVE

2018-12-17 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: I see. Then I would say it's a matter of deciding what's the best API to provide. Another possibility is to promote the underlying epoll() instance as a public property, so one can do: >>> s = selectors.EpollSelector() >>> s.regis

[issue35517] selector.EpollSelector: add new parameter to support EPOLLEXCLUSIVE

2018-12-17 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: I'm not sure I understand what EPOLLEXCLUSIVE is about. Could you provide a use case? Also, there are other constants which may also be useful such as EPOLLWAKEUP and EPOLLONESHOT: http://man7.org/linux/man-pages/man2/epoll_ctl.2.html So perhaps it makes

[issue17561] Add socket.create_server_sock() convenience function

2018-12-16 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Interesting. Yes, I agree this proposal is still desirable. We can reuse socket.create_server_sock() in smtpd, ftplib, socketserver (issue20215) and http.server (issue24209) modules which will inherit dual-stack IPv4/6 capabilities for free. I should

[issue35434] Wrong bpo linked in What's New in 3.8

2018-12-07 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: My bad. Thanks for fixing it. -- ___ Python tracker <https://bugs.python.org/issue35434> ___ ___ Python-bugs-list mailin

<    1   2   3   4   5   6   7   8   9   10   >