[issue35324] ssl: FileNotFoundError when do handshake

2018-12-07 Thread Windson Yang
Windson Yang added the comment: I can't reproduce on my laptop. Would you please upload a minimal example? -- nosy: +Windson Yang ___ Python tracker <https://bugs.python.org/is

[issue35267] reproducible deadlock with multiprocessing.Pool

2018-12-08 Thread Windson Yang
Windson Yang added the comment: As Jonathan Gossage said, I think it may break some code to fix this issue, maybe we could just add a warning on the document? -- ___ Python tracker <https://bugs.python.org/issue35

[issue35325] imp.find_module() return value documentation discrepancy

2018-12-08 Thread Windson Yang
Change by Windson Yang : -- keywords: +patch pull_requests: +10277 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue35325> ___ ___ Py

[issue35105] Document that CPython accepts "invalid" identifiers

2018-12-08 Thread Windson Yang
Windson Yang added the comment: Any ideas? Or I will create a PR in a week without 'CPython implementation detail' -- ___ Python tracker <https://bugs.python.o

[issue35367] FileExistsError During os.symlink() Displays Arrow in the Wrong Direction

2018-12-13 Thread Windson Yang
Change by Windson Yang : -- pull_requests: +10373 ___ Python tracker <https://bugs.python.org/issue35367> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35267] reproducible deadlock with multiprocessing.Pool

2018-12-13 Thread Windson Yang
Change by Windson Yang : -- keywords: +patch pull_requests: +10374 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue35267> ___ ___ Py

[issue35324] ssl: FileNotFoundError when do handshake

2018-12-20 Thread Windson Yang
Windson Yang added the comment: >From the docs Changed in version 3.7: Hostname or IP address is matched by OpenSSL during handshake. The function match_hostname() is no longer used. In case OpenSSL refuses a hostname or IP address, the handshake is aborted early and a TLS al

[issue35105] Document that CPython accepts "invalid" identifiers

2018-12-20 Thread Windson Yang
Change by Windson Yang : -- keywords: +patch pull_requests: +10494 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue35105> ___ ___ Py

[issue35105] Document that CPython accepts "invalid" identifiers

2019-01-04 Thread Windson Yang
Windson Yang added the comment: I agreed with @Raymond Hettinger, I will update the PR from your suggestion if no other ideas in next week. -- ___ Python tracker <https://bugs.python.org/issue35

[issue35325] imp.find_module() return value documentation discrepancy

2019-01-04 Thread Windson Yang
Windson Yang added the comment: > The documentation should state that "pathname" will be None (not the empty > string) for built-in and frozen modules in order to be in line with the > implementation. Both the "file" and "pathname" will be None for

[issue34628] urllib.request.urlopen fails when userinfo is present in URL

2019-01-10 Thread Windson Yang
Windson Yang added the comment: I found that Requests library use urllib3 library which looks like ignore the user info part (in request_context https://github.com/urllib3/urllib3/blob/master/src/urllib3/poolmanager.py#L208). Did I miss something or we should also ignore it

[issue35745] Add import statement in dataclass code snippet

2019-01-15 Thread Windson Yang
New submission from Windson Yang : Most of the example in https://docs.python.org/3/library/dataclasses.html miss code like from dataclasses import dataclass, field from typing import List I think we should add this statement in the code snippet. -- assignee: docs@python components

[issue35745] Add import statement in dataclass code snippet

2019-01-15 Thread Windson Yang
Windson Yang added the comment: I'm not sure if we should put from dataclasses import dataclass everywhere or we should put it just in the first example as I did in the PR. -- ___ Python tracker <https://bugs.python.org/is

[issue34397] remove redundant overflow checks in tuple and list implementations

2019-01-24 Thread Windson Yang
Windson Yang added the comment: I reviewed the patch months ago, maybe we need a core developer review this path? -- ___ Python tracker <https://bugs.python.org/issue34

[issue34628] urllib.request.urlopen fails when userinfo is present in URL

2019-01-26 Thread Windson Yang
Windson Yang added the comment: Why requests library didn't raise an error because urllib3 (the library requests using) ignore the auth part right now > Currently we expect our users to handle authentication headers themselves. > It's unfortunate that we silently strip

[issue35846] Incomplete documentation for re.sub

2019-01-31 Thread Windson Yang
Windson Yang added the comment: I wonder if possible that c not in ASCIILETTERS when we get KeyError? if c in ASCIILETTERS: raise s.error('bad escape %s' % this, len(this)) -- nosy: +Windson Yang ___ Python track

[issue35868] Support ALL_PROXY environment variable in urllib

2019-01-31 Thread Windson Yang
Windson Yang added the comment: This is not a bug, it would be better to submit your ideas to python-ideas mail-list -- nosy: +Windson Yang ___ Python tracker <https://bugs.python.org/issue35

[issue35858] Consider adding the option of running shell/console commands inside the REPL

2019-01-31 Thread Windson Yang
Windson Yang added the comment: Hello, jcrmatos. Maybe you can submit your idea to python-ideas mail-list. -- nosy: +Windson Yang ___ Python tracker <https://bugs.python.org/issue35

[issue35892] Fix awkwardness of statistics.mode() for multimodal datasets

2019-02-16 Thread Windson Yang
Windson Yang added the comment: IMHO, we don't need to add the option. We can return the smallest value from the **table** instead of the code below. if len(table) == 1: return table[0][0] [1] https://github.com/python/cpython/blob/master/Lib/statistics.py#L502 --

[issue35892] Fix awkwardness of statistics.mode() for multimodal datasets

2019-02-16 Thread Windson Yang
Windson Yang added the comment: I only tested stats.mode() from scipy, data = 'BBAAC' should also return 'A'. But in your code **return return Counter(seq).most_common(1)[0][0]** will return B. Did I miss something? -- ___ Py

[issue35892] Fix awkwardness of statistics.mode() for multimodal datasets

2019-02-18 Thread Windson Yang
Windson Yang added the comment: I think right now we can > Change mode() to return the first tie instead of raising an exception. This > is a behavior change but leaves you with the cleanest API going forward. as well as > Add a Deprecation warning to the current behavior of mo

[issue36047] socket file handle does not support stream write

2019-02-19 Thread Windson Yang
Windson Yang added the comment: >From the docs >https://docs.python.org/3/library/socket.html#socket.socket.makefile, the >default mode for makefile() is 'r' (only readable). In your example, just use >S = s.makefile(mode='w') instead.

[issue36049] No __repr__() for queue.PriorityQueue and queue.LifoQueue

2019-02-20 Thread Windson Yang
Windson Yang added the comment: Hello, Zahash Z. May I ask what is your expected behavior for the return value of __repr__() from PriorityQueue. I'm agreed with Stéphane Wirtel, I don't think returning all the items would be a good idea, maybe we can improve it in another way. Fo

[issue36093] UnicodeEncodeError raise from smtplib.verify() method

2019-02-22 Thread Windson Yang
New submission from Windson Yang : AFAIK, the email address should support non-ASCII character (from https://stackoverflow.com/questions/760150/can-an-email-address-contain-international-non-english-characters and SMTPUTF8 option from https://docs.python.org/3/library/smtplib.html

[issue36093] UnicodeEncodeError raise from smtplib.verify() method

2019-02-23 Thread Windson Yang
Windson Yang added the comment: Btw, from the docs https://docs.python.org/3/library/smtplib.html#smtplib.SMTP.sendmail > msg may be a string containing characters in the ASCII range, or a byte > string. A string is encoded to bytes using the ascii codec, and lone \r and > \n c

[issue36153] Freeze support documentation is misleading.

2019-02-28 Thread Windson Yang
Windson Yang added the comment: IIUC, your script (using Sklearn/tensorflow) will cause an infinite loop when building with pyinstaller. Would you mind upload an example script so I can try to reproduce it? -- nosy: +Windson Yang ___ Python

[issue29539] [smtplib] collect response data for all recipients

2019-02-28 Thread Windson Yang
Windson Yang added the comment: sls, are you working on this feature now? -- nosy: +Windson Yang ___ Python tracker <https://bugs.python.org/issue29539> ___ ___

[issue36203] PyWeakref_NewRef docs are misleading

2019-03-06 Thread Windson Yang
Windson Yang added the comment: Yes, Maxwell. I guess the docs are misleading, the code locate in https://github.com/python/cpython/blob/master/Objects/weakrefobject.c#L748 if (callback == Py_None) callback = NULL; if (callback == NULL) /* return existing weak reference

[issue36203] PyWeakref_NewRef docs are misleading

2019-03-07 Thread Windson Yang
Windson Yang added the comment: It looks to me the fix is easy, we just will return NULL and raise TypeError when the callback is not callable, None, or NULL. I'm not an expert in C, but I would love to create a PR for it if you don't

[issue36230] Please sort assertSetEqual's output

2019-03-07 Thread Windson Yang
Windson Yang added the comment: Just to be clear, as Raymond said, when we have two non-sortable objects (for instance, two instances which their class didn't implement the __lt__ and __gt__ methods), we should compare their repr() without sort() like now. -- nosy: +Windson

[issue36230] Please sort assertSetEqual's output

2019-03-07 Thread Windson Yang
Change by Windson Yang : -- versions: +Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7 ___ Python tracker <https://bugs.python.org/issue36230> ___ ___

[issue36230] Please sort assertSetEqual's output

2019-03-08 Thread Windson Yang
Windson Yang added the comment: My point is careful about the non-sortable object. My mistake, this should be an enhancement, not a bug. -- versions: -Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7 ___ Python tracker <ht

[issue36248] document about `or`, `and` operator.

2019-03-08 Thread Windson Yang
New submission from Windson Yang : I think we should document the behavior as below, (maybe at https://docs.python.org/3/reference/expressions.html#operator-precedence) >>> 1 or 0 and 3 1 >>> 0 or 1 and 3 3 Please correct me if we already document it. -- ass

[issue36248] document about `or`, `and` operator.

2019-03-09 Thread Windson Yang
Windson Yang added the comment: Thank you Serhiy, we did document here: > The expression x and y first evaluates x; if x is false, its value is > returned; otherwise, y is evaluated and the resulting value is returned. > The expression x or y first evaluates x; if x is true, its

[issue36248] document about `or`, `and` operator.

2019-03-09 Thread Windson Yang
Windson Yang added the comment: SilentGhost, I think you give a great example to explain this behavior. If the behavior is obvious to you, we can close this issue. -- ___ Python tracker <https://bugs.python.org/issue36

[issue18697] Unify arguments names in Unicode object C API documentation

2019-03-09 Thread Windson Yang
Change by Windson Yang : -- versions: +Python 2.7, Python 3.4, Python 3.5 ___ Python tracker <https://bugs.python.org/issue18697> ___ ___ Python-bugs-list mailin

[issue18697] Unify arguments names in Unicode object C API documentation

2019-03-09 Thread Windson Yang
Windson Yang added the comment: I agreed with @Matheus, it would be better than the current implementation -- nosy: +Windson Yang versions: +Python 3.6, Python 3.7 -Python 2.7, Python 3.4, Python 3.5 ___ Python tracker <https://bugs.python.

[issue18697] Unify arguments names in Unicode object C API documentation

2019-03-09 Thread Windson Yang
Change by Windson Yang : -- versions: -Python 2.7 ___ Python tracker <https://bugs.python.org/issue18697> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue26018] documentation of ZipFile file name encoding

2019-03-09 Thread Windson Yang
Windson Yang added the comment: I can't find the Note in the current document -- nosy: +Windson Yang versions: +Python 3.4, Python 3.5 -Python 3.7, Python 3.8 ___ Python tracker <https://bugs.python.org/is

[issue26018] documentation of ZipFile file name encoding

2019-03-09 Thread Windson Yang
Windson Yang added the comment: Please ignore the last message, the docs locate in 3.4 and 3.5 -- ___ Python tracker <https://bugs.python.org/issue26

[issue14934] generator objects can clear their weakrefs before being resurrected

2019-03-16 Thread Windson Yang
Windson Yang added the comment: In the docs https://docs.python.org/3/extending/newtypes.html#weak-reference-support points out: > /* Clear weakrefs first before calling any destructors */ So maybe we should also update the docs after fix this bug. Anyway, I will try to understand/

[issue14934] generator objects can clear their weakrefs before being resurrected

2019-03-20 Thread Windson Yang
Windson Yang added the comment: The fixed looks easy, we call `PyObject_CallFinalizerFromDealloc` before PyObject_ClearWeakRefs. But I can't come up with the use case for testing when generator resurrects from `PyObject_CallFinalizer`. Any

[issue14817] pkgutil.extend_path has no tests

2019-03-21 Thread Windson Yang
Windson Yang added the comment: I would like to work on this and make a PR. -- nosy: +Windson Yang type: -> enhancement versions: +Python 3.7, Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python.org/issu

[issue36411] Python 3 f.tell() gets out of sync with file pointer in binary append+read mode

2019-03-24 Thread Windson Yang
Windson Yang added the comment: This looks interesting. Let me try to fix it. -- nosy: +Windson Yang versions: +Python 3.8, Python 3.9 -Python 3.6 ___ Python tracker <https://bugs.python.org/issue36

[issue14817] pkgutil.extend_path has no tests

2019-03-26 Thread Windson Yang
Windson Yang added the comment: My base idea would be some unittests for the function like: class ExtendPathBaseTests(unittest.TestCase): def test_input_string(self): path = 'path' name = 'foo' self.assertEqual('path', pkgutil.ext

[issue36453] get_importer only return the first valid path_hook(importer)

2019-03-27 Thread Windson Yang
New submission from Windson Yang : Is it an expected behavior the get_importer function only returns the first valid path_hook(importer) from sys.path_hooks? def get_importer(path_item): """Retrieve a finder for the given path item The returned find

[issue14817] pkgutil.extend_path has no tests

2019-04-17 Thread Windson Yang
Change by Windson Yang : -- keywords: +patch pull_requests: +12795 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue14817> ___ ___ Py

[issue14817] pkgutil.extend_path has no tests

2019-04-17 Thread Windson Yang
Windson Yang added the comment: I added some tests in the PR. Actually, there are some tests for extend_path already (see https://github.com/python/cpython/blob/master/Lib/test/test_pkgutil.py#L235). However, I didn't test every line of the code in the extend_path fun

[issue36654] Add example to tokenize.tokenize

2019-04-17 Thread Windson Yang
New submission from Windson Yang : > The tokenize() generator requires one argument, readline, which must be a > callable object which provides the same interface as the io.IOBase.readline() > method of file objects. Each call to the function should return one line of > input as

[issue36661] Missing dataclass decorator import in dataclasses module docs

2019-04-19 Thread Windson Yang
Windson Yang added the comment: I can find some example in the docs that didn't `import the correct module` even in the first example. Should we add the `import` statement for all of them? -- nosy: +Windson Yang ___ Python tracker &

[issue36661] Missing dataclass decorator import in dataclasses module docs

2019-04-20 Thread Windson Yang
Windson Yang added the comment: I agreed most of the documents won't need the change, but some documents like https://docs.python.org/3/library/dataclasses.html#dataclasses.field didn't mention we have to run `from typing import List` and I guess most developers not familiar

[issue36679] duplicate method definition in Lib/test/test_genericclass.py

2019-04-20 Thread Windson Yang
Change by Windson Yang : -- keywords: +patch pull_requests: +12816 stage: needs patch -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue36680] duplicate method definition in Lib/test/test_importlib/test_util.py

2019-04-20 Thread Windson Yang
Change by Windson Yang : -- keywords: +patch pull_requests: +12817 stage: needs patch -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue36681] duplicate method definition in Lib/test/test_logging.py

2019-04-20 Thread Windson Yang
Change by Windson Yang : -- keywords: +patch pull_requests: +12818 stage: needs patch -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue36682] duplicate method definitions in Lib/test/test_sys_setprofile.py

2019-04-20 Thread Windson Yang
Change by Windson Yang : -- keywords: +patch pull_requests: +12819 stage: needs patch -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue36682] duplicate method definitions in Lib/test/test_sys_setprofile.py

2019-04-20 Thread Windson Yang
Change by Windson Yang : -- pull_requests: +12820 ___ Python tracker <https://bugs.python.org/issue36682> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36683] duplicate method definition in Lib/test/test_utf8_mode.py

2019-04-20 Thread Windson Yang
Change by Windson Yang : -- keywords: +patch pull_requests: +12821 stage: needs patch -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue36678] duplicate method definitions in Lib/test/test_dataclasses.py

2019-04-21 Thread Windson Yang
Change by Windson Yang : -- keywords: +patch pull_requests: +12826 stage: needs patch -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue36654] Add example to tokenize.tokenize

2019-04-24 Thread Windson Yang
Windson Yang added the comment: Yes, I can make a PR for it. -- ___ Python tracker <https://bugs.python.org/issue36654> ___ ___ Python-bugs-list mailin

[issue36654] Add example to tokenize.tokenize

2019-04-24 Thread Windson Yang
Change by Windson Yang : -- keywords: +patch pull_requests: +12871 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue36654> ___ ___ Py

[issue36731] Add example to priority queue

2019-04-25 Thread Windson Yang
New submission from Windson Yang : We don't have the base example for priority queue in https://docs.python.org/3.8/library/heapq.html#priority-queue-implementation-notes, We can add something like: > q = Q.PriorityQueue() > q.put(10) > q.put(1) > q.put(5) > while not

[issue36759] datetime: astimezone() results in OSError: [Errno 22] Invalid argument

2019-04-30 Thread Windson Yang
Windson Yang added the comment: on macOS 10.14.4, I got `ValueError: offset must be a timedelta representing a whole number of minutes, not datetime.timedelta(0, 29143).` I will do some research to see why this happen. -- nosy: +Windson Yang

[issue36759] datetime: astimezone() results in OSError: [Errno 22] Invalid argument

2019-05-01 Thread Windson Yang
Windson Yang added the comment: Thanks, SilentGhost, you are right. I will leave this to a Windows expert instead. -- ___ Python tracker <https://bugs.python.org/issue36

[issue36757] uuid constructor accept invalid strings (extra dash)

2019-05-01 Thread Windson Yang
Windson Yang added the comment: > Maybe a line should be added in the documentation to prevent people using > this as a validator without more check? I don't expect uuid.UUID could be used as a validator myself, but I agreed we can warn users in the documentation if lots of t

[issue36761] Extended slice assignment + iterable unpacking

2019-05-01 Thread Windson Yang
Windson Yang added the comment: In your first case, *any positive index except 2 will work*, For example: L = [0, 1, 2] L[::1], *rest = "abcdef" # L became ['a'] or L[::3], *rest = "abcdef" # L became ['a', 1, 2] I found iff when you change the length

[issue36762] Teach "import *" to warn when overwriting globals or builtins

2019-05-01 Thread Windson Yang
Windson Yang added the comment: Another question will be are we going to replace the * in our source code in the future? Since I found lots of our code use 'from xxx import *' pattern. -- nosy: +Windson Yang ___ Python track

[issue34155] email.utils.parseaddr mistakenly parse an email

2019-05-02 Thread Windson Yang
Windson Yang added the comment: I found the issue located in https://github.com/python/cpython/blob/master/Lib/email/_parseaddr.py#L277 elif self.field[self.pos] in '.@': # email address is just an addrspec # this isn't very efficient since we start over se

[issue34155] email.utils.parseaddr mistakenly parse an email

2019-05-03 Thread Windson Yang
Windson Yang added the comment: Frome the answer from Alnitak (https://stackoverflow.com/questions/12355858/how-many-symbol-can-be-in-an-email-address). Maybe we should raise an error when the address has multiple @ in it. -- ___ Python tracker

[issue36823] shutil.copytree copies directories and files but fails with that same directory with '[Errno 1] Operation not permitted')

2019-05-07 Thread Windson Yang
Windson Yang added the comment: Just to make sure, the expected behavior would be the items should not be copied because of the permission and the error messages above, right? -- nosy: +Windson Yang ___ Python tracker <https://bugs.python.

[issue18765] unittest needs a way to launch pdb.post_mortem or other debug hooks

2019-05-07 Thread Windson Yang
Windson Yang added the comment: Hello, @Rémi, are you still working on this issue? -- nosy: +Windson Yang ___ Python tracker <https://bugs.python.org/issue18

[issue36689] docs: os.path.commonpath raises ValueError for different drives

2019-05-12 Thread Windson Yang
Windson Yang added the comment: An easy fix would be "Raise ValueError if paths contain (note: use contain instead of contains) both absolute and relative pathnames or the path are on the different drives." -- nosy: +Windson Yang

[issue30535] Explicitly note that meta_path is not empty

2019-05-13 Thread Windson Yang
Change by Windson Yang : -- keywords: +patch pull_requests: +13211 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue30535> ___ ___ Py

[issue30535] Explicitly note that meta_path is not empty

2019-05-13 Thread Windson Yang
Windson Yang added the comment: I created a PR for it. TBO, meta_path is not a good name since it doesn't contain any *path* at all. -- nosy: +Windson Yang ___ Python tracker <https://bugs.python.org/is

[issue9267] Update pickle opcode documentation in pickletools for 3.x

2019-05-13 Thread Windson Yang
Windson Yang added the comment: Where are the documents actually? -- nosy: +Windson Yang ___ Python tracker <https://bugs.python.org/issue9267> ___ ___ Pytho

[issue26124] shlex.quote and pipes.quote do not quote shell keywords

2019-05-14 Thread Windson Yang
Change by Windson Yang : -- keywords: +patch pull_requests: +13245 stage: needs patch -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue18911] minidom does not encode correctly when calling Document.writexml

2019-05-15 Thread Windson Yang
Change by Windson Yang : -- keywords: +patch pull_requests: +13263 stage: needs patch -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue18911] minidom does not encode correctly when calling Document.writexml

2019-05-15 Thread Windson Yang
Windson Yang added the comment: I added a PR for like this: .. note:: You should specify the "xmlcharrefreplace" error handler when open a file with specified encoding:: writer = open( filename, "w", encoding="utf-8

[issue21861] io class name are hardcoded in reprs

2019-05-16 Thread Windson Yang
Windson Yang added the comment: IIUC, in the c code we just hardcode the name "_io.FileIO" for "PyFileIO_Type" in https://github.com/python/cpython/blob/master/Modules/_io/fileio.c#L1180. If we want to get a dynamic name, we should replace the hardcode name with th

[issue32739] collections.deque rotate(n=1) default value not documented

2018-01-31 Thread Yang Yu
New submission from Yang Yu : https://docs.python.org/3/library/collections.html#collections.deque rotate() works the same as rotate(1). The documentation did not mention the default for n. -- assignee: docs@python components: Documentation messages: 311403 nosy: docs@python, yuy

[issue33152] clean code

2018-03-27 Thread Windson Yang
New submission from Windson Yang : https://github.com/python/cpython/blob/master/Lib/timeit.py#L202 use a list comprehension instead -- components: Distutils messages: 314504 nosy: Windson Yang, dstufft, eric.araujo priority: normal severity: normal status: open title: clean code type

[issue33225] imaplib module IMAP4.append() unexpected response BAD Command Error

2018-04-04 Thread Yang Yu
New submission from Yang Yu : part of bytestring in message in .append() includes 'text-align: center;\r\n}

[issue31575] Functional Programming HOWTO sub-optimal example for reduce

2017-09-25 Thread Anran Yang
New submission from Anran Yang: At the end of the Functional Programming HOWTO document (https://docs.python.org/3.7/howto/functional.html) the usage of reduce/lambda/for loops are compared and discussed. However, the example for reduce seems sub-optimal and thus the discussion is not that

[issue31896] In function define class inherit ctypes.structure, and using ctypes.pointer leak memory

2017-10-29 Thread Yang Big
New submission from Yang Big : Here my code: 2 import sys 3 import ctypes 4 5 6 def hi(): 7 class timespec(ctypes.Structure): 8 ┆ """Time specification, as described in clock_gettime(3).""" 9 ┆ _fields_ = (

[issue21149] logging._removeHandlerRef is not threadsafe during interpreter shutdown

2017-11-10 Thread Yilei Yang
Yilei Yang added the comment: Here is a minimal example: main.py: from pkg_a import lib_a pkg_a/__init__.py pkg_a/lib_a.py import logging import sys import pkg_a # This is important handler = logging.StreamHandler(sys.stderr) It does not happen in Python 3 though (3.5.3

[issue34049] abs() method accept argument that implement __abs__()

2018-07-04 Thread Windson Yang
New submission from Windson Yang : Just like callable() method in https://docs.python.org/3/library/functions.html#callable > ...instances are callable if their class has a __call__() method. I think we should also mention this in abs(), abs(x) Return the absolute value of a number. I

[issue34049] abs() method accept argument that implement __abs__()

2018-07-05 Thread Windson Yang
Change by Windson Yang : -- keywords: +patch pull_requests: +7697 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue34049> ___ ___ Py

[issue34049] abs() method accept argument that implement __abs__()

2018-07-05 Thread Windson Yang
Windson Yang added the comment: I'd love to. (BTW, @rhettinger I just watched your fantastic multiprocessing tutorial. :D) -- ___ Python tracker <https://bugs.python.org/is

[issue34049] abs() method accept argument that implement __abs__()

2018-07-05 Thread Windson Yang
Change by Windson Yang : -- assignee: -> docs@python components: +Documentation -Library (Lib) nosy: +docs@python ___ Python tracker <https://bugs.python.org/issu

[issue34051] Update multiprocessing example

2018-07-05 Thread Windson Yang
New submission from Windson Yang : The docs at https://docs.python.org/3.8/library/multiprocessing.html#synchronization-between-processes give an example: from multiprocessing import Process, Lock def f(l, i): l.acquire() try: print('hello world', i)

[issue34051] Update multiprocessing example

2018-07-05 Thread Windson Yang
Change by Windson Yang : -- nosy: +zach.ware ___ Python tracker <https://bugs.python.org/issue34051> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34059] multiprocessing deadlock

2018-07-06 Thread Windson Yang
Windson Yang added the comment: I'm can't reproduce the deadlock, maybe it's related to torch package? Can you try without torch to see if this happens again? -- nosy: +Windson Yang ___ Python tracker <https://bugs.pyt

[issue34051] Update multiprocessing example

2018-07-07 Thread Windson Yang
Windson Yang added the comment: Hello, @Antoine Pitrou. Maybe there is another way to let the reader know "only one process prints to standard output at a time" instead of sleep() function? -- ___ Python tracker <https://bu

[issue34051] Update multiprocessing example

2018-07-07 Thread Windson Yang
Windson Yang added the comment: Thank you, I think to use acquire() and release() may be better than with statement in this example. I will close this issue. -- ___ Python tracker <https://bugs.python.org/issue34

[issue34051] Update multiprocessing example

2018-07-07 Thread Windson Yang
Change by Windson Yang : -- stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue34051> ___ ___ Python-bugs-list

[issue34134] multiprocessing memory huge usage

2018-07-16 Thread Windson Yang
New submission from Windson Yang : I'm using macOX and I got huge memory usage when using generator with multiprocess. (see file) I think this is because (https://github.com/python/cpython/blob/master/Lib/multiprocessing/pool.py#L383) if not hasattr(iterable, &#x

[issue34134] multiprocessing memory huge usage

2018-07-16 Thread Windson Yang
Windson Yang added the comment: Thank you for the hint, INADA. I think we should add something like "if you are using generator, consider use imap instead" in https://docs.python.org/3.4/library/multiprocessing.html?highlight=process#multiprocessing.poo

[issue34134] multiprocessing memory huge usage

2018-07-17 Thread Windson Yang
Windson Yang added the comment: Thank you, I will try to make a pull request and let other to edit it. -- ___ Python tracker <https://bugs.python.org/issue34

[issue34134] multiprocessing memory huge usage

2018-07-17 Thread Windson Yang
Windson Yang added the comment: Thank you Xiang Zhang, I found the code keeps hanging when I use imap, I will try to figure out tomorrow. -- ___ Python tracker <https://bugs.python.org/issue34

[issue34134] multiprocessing memory huge usage

2018-07-17 Thread Windson Yang
Windson Yang added the comment: The code didn't work with imap because imap create a generator, so we can't access result outside the with statement. with Pool(os.cpu_count()) as p: result = p.imap(clean_up, k, 50) for r in result: print(r)

[issue34134] multiprocessing memory huge usage

2018-07-18 Thread Windson Yang
Windson Yang added the comment: Yes, we should not. But we can do this when use map function. the document gives a good example but doesn't say much about real differences between map and imap. Maybe we should add some notes like INADA suggest. map function will convert iterable to li

<    1   2   3   >