[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

[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

[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

[issue34134] multiprocessing memory huge usage

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

[issue34159] asyncio basic event loop stuck with no tasks scheduled or ready

2018-07-19 Thread Windson Yang
Windson Yang added the comment: Would you mind adding an example file? -- nosy: +Windson Yang ___ Python tracker <https://bugs.python.org/issue34159> ___ ___

[issue34161] (good first issue) Tutorial 7.1 str.format() code example syntax error

2018-07-20 Thread Windson Yang
Windson Yang added the comment: Hi, Orlando, this link maybe useful: https://devguide.python.org/documenting/ -- nosy: +Windson Yang ___ Python tracker <https://bugs.python.org/issue34

[issue33635] OSError when using pathlib.Path.rglob() to list device files

2018-07-20 Thread Windson Yang
Windson Yang added the comment: I tried to fix this issue and I found this should be related to os.stat() in os.py. But I can't find the os.stat() API in the file, any ideas? -- nosy: +Windson Yang ___ Python tracker <https://bugs.py

[issue34172] multiprocessing.Pool and ThreadPool leak resources after being deleted

2018-07-20 Thread Windson Yang
Windson Yang added the comment: > A. This does not happen, creating a Pool, deleting it and collecting the > garbage, does not call terminate. Would you give me an example how you delete the Pool and collecting the garbage? If you use context manager, It will call terminate() function

[issue34172] multiprocessing.Pool and ThreadPool leak resources after being deleted

2018-07-21 Thread Windson Yang
Windson Yang added the comment: A patch would just add def __del__(self): self.terminate() in the Pool object. -- ___ Python tracker <https://bugs.python.org/issue34

[issue34172] multiprocessing.Pool and ThreadPool leak resources after being deleted

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

[issue34172] multiprocessing.Pool and ThreadPool leak resources after being deleted

2018-07-22 Thread Windson Yang
Windson Yang added the comment: Add a __del__ method in the Pool class should work. But I'm not sure we should do this. -- ___ Python tracker <https://bugs.python.org/is

[issue29750] smtplib doesn't handle unicode passwords

2018-07-26 Thread Windson Yang
Windson Yang added the comment: @Vadim Pushtaev I also want to work on it. If you wanna work together. Maybe we can talk on zulipchat. :D -- nosy: +Windson Yang ___ Python tracker <https://bugs.python.org/issue29

[issue33741] UnicodeEncodeError onsmtplib.login(MAIL_USER, MAIL_PASSWORD)

2018-08-26 Thread Windson Yang
Change by Windson Yang : -- pull_requests: +8410 ___ Python tracker <https://bugs.python.org/issue33741> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue29750] smtplib doesn't handle unicode passwords

2018-08-26 Thread Windson Yang
Change by Windson Yang : -- keywords: +patch pull_requests: +8411 stage: needs patch -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue34552] Clarify built-in types comparisons

2018-08-30 Thread Windson Yang
New submission from Windson Yang : In https://docs.python.org/3.5/library/stdtypes.html#comparisons "some types (for example, function objects) support only a degenerate notion of comparison where any two objects of that type are unequal." We had some discussion at zulipchat alrea

[issue34552] Clarify built-in types comparisons

2018-09-02 Thread Windson Yang
Change by Windson Yang : -- keywords: +patch pull_requests: +8497 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue34552> ___ ___ Py

[issue29750] smtplib doesn't handle unicode passwords

2018-09-02 Thread Windson Yang
Windson Yang added the comment: I added a pitch to support utf-8. -- ___ Python tracker <https://bugs.python.org/issue29750> ___ ___ Python-bugs-list mailin

[issue34576] SimpleHTTPServer: warn users on security

2018-09-04 Thread Windson Yang
Windson Yang added the comment: The SimpleHTTPServer module has been merged into http.server in Python 3. So we add this to python2 document? -- nosy: +Windson Yang ___ Python tracker <https://bugs.python.org/issue34

[issue34753] Use coroutine object or coroutine function instead of coroutine

2018-09-20 Thread Windson Yang
New submission from Windson Yang : A PR https://github.com/python/cpython/pull/9408 solved an ambiguous problem about coroutine. Which led me to https://docs.python.org/3/library/asyncio-task.html#awaitables > Note that in this documentation the term “coroutine” can be used for two > c

[issue34753] Use coroutine object or coroutine function instead of coroutine

2018-09-20 Thread Windson Yang
Windson Yang added the comment: Sure, I found around 7 places may need to change, I can fix some of them right, and I will put the rest links which I'm not sure in the PR comment. -- ___ Python tracker <https://bugs.python.org/is

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

2018-09-21 Thread Windson Yang
Windson Yang added the comment: Hello, Tim Peters. I wonder why we need to add size_t here: assert((size_t)Py_SIZE(a) + (size_t)Py_SIZE(b) <= (size_t)PY_SSIZE_T_MAX); AFAIK, PY_SSIZE_T_MAX = ((Py_ssize_t)(((size_t)-1)>>1)) which is signed, either Py_SIZE(a) or Py_SIZE(b) is a

[issue34753] Use coroutine object or coroutine function instead of coroutine

2018-09-23 Thread Windson Yang
Change by Windson Yang : -- keywords: +patch pull_requests: +8928 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue34753> ___ ___ Py

[issue34912] Update overflow checks in resize_buffer

2018-10-05 Thread Windson Yang
New submission from Windson Yang : In [resize_buffer](https://github.com/python/cpython/blob/e42b705188271da108de42b55d9344642170aa2b/Modules/_io/stringio.c#L85) /* For simplicity, stay in the range of the signed type. Anyway, Python doesn't allow strings to be longer than

[issue34965] Python on Docker container using flask is going down after sometime

2018-10-12 Thread Windson Yang
Windson Yang added the comment: Hello, Srikanth, We can't fix/find the bug by the info you give, Would you mind provide the traceback log after crashing? -- nosy: +Windson Yang ___ Python tracker <https://bugs.python.org/is

[issue35118] Add peek() or first() method in queue

2018-10-30 Thread Windson Yang
New submission from Windson Yang : I found other languages like Java and C++ have the method to access the first value in Queue like first() and peek(). Since we use deque_ to create Queue now, it's easy to implement in python using the index. Otherwise, we can add this to the docume

[issue35117] set.discard should return True or False based on if element existed.

2018-10-30 Thread Windson Yang
Windson Yang added the comment: I guess we can implement using ref_count? However, I agreed "The use of variables that haven't been defined or set (implicitly or explicitly) is almost always a bad thing in any language since it indicates that the logic of the program hasn'

[issue35118] Add peek() or first() method in queue

2018-10-30 Thread Windson Yang
Windson Yang added the comment: For deque, we can add peek() function to deque or just make it clear in the document that we can use deque[0] to access the first element(I can only find index method in the document) For Queue, I found Java and C++ has the function like first() or peek

[issue34965] Python on Docker container using flask is going down after sometime

2018-10-31 Thread Windson Yang
Windson Yang added the comment: Hello, Srikanth, I think you have to look through the docker documents like https://docs.docker.com/config/containers/logging/ -- ___ Python tracker <https://bugs.python.org/issue34

[issue35118] Add peek() or first() method in queue

2018-10-31 Thread Windson Yang
Change by Windson Yang : -- keywords: +patch pull_requests: +9576 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue35118> ___ ___ Py

[issue34912] Update overflow checks in resize_buffer

2018-10-31 Thread Windson Yang
Windson Yang added the comment: Sorry, Stefan Behnel, I still don't get it. alloc will always bigger than size after the if else case: if (size < alloc / 2) { /* Major downsize; resize down to exact size. */ alloc = size + 1; } else if (size

[issue35120] SSH tunnel support to ftp lib

2018-10-31 Thread Windson Yang
Windson Yang added the comment: Hello, Mohit Sharma. Would you mind adding more details about the bug? -- nosy: +Windson Yang ___ Python tracker <https://bugs.python.org/issue35

[issue35105] Document that CPython accepts "invalid" identifiers

2018-10-31 Thread Windson Yang
Windson Yang added the comment: I agreed we should document it, it' not obvious to me at least. -- nosy: +Windson Yang ___ Python tracker <https://bugs.python.org/is

[issue35113] inspect.getsource returns incorrect source for classes when class definition is part of multiline strings

2018-11-01 Thread Windson Yang
Windson Yang added the comment: Yes, the code located at https://github.com/python/cpython/blob/7cd25434164882c2093ea41ccfc7b95a05cd5cbd/Lib/inspect.py#L794 I think to use a comment status var would be a solution, Do you have any idea to fix it? -- nosy: +Windson Yang

[issue35140] encoding problem: gbk

2018-11-01 Thread Windson Yang
Windson Yang added the comment: If I understand your question correctly, you should save the file(the one contain Chinese chars) with GBK encoding using your editor. Otherwise, your editor would save it using the default encoding which led to python can't decode it corr

[issue35140] encoding problem: gbk

2018-11-02 Thread Windson Yang
Windson Yang added the comment: Thank you, Lin. Can you reproduce on your machine, I guess it is related to terminal encoding or text file ending. However, I can't reproduce on macOS. -- ___ Python tracker <https://bugs.python.org/is

[issue35140] encoding problem: gbk

2018-11-02 Thread Windson Yang
Windson Yang added the comment: It's fine @anmikf, keep practice :D. Let's recap what happened: Run encoding_problem_gbk.py on Windows10 using Python 3.7.0 will cause "SyntaxError: encoding problem: gbk". But it will run as expected if 1. The file has less than less than

[issue35140] encoding problem: coding:gbk cause syntaxError

2018-11-02 Thread Windson Yang
Change by Windson Yang : -- title: encoding problem: gbk -> encoding problem: coding:gbk cause syntaxError ___ Python tracker <https://bugs.python.org/issu

[issue35146] Bad Regular Expression Broke re.findall()

2018-11-02 Thread Windson Yang
Windson Yang added the comment: The last line "re.error: nothing to repeat at position 0" shows that you should not put raw * as the first element, use \* instead. -- nosy: +Windson Yang ___ Python tracker <https://bugs.python.o

[issue35121] Cookie domain check returns incorrect results

2018-11-02 Thread Windson Yang
Windson Yang added the comment: I wonder https://github.com/python/cpython/blob/master/Lib/test/test_http_cookiejar.py#L420 ("http://foo.bar.com/";, "com", True), ("http://foo.com/";, "com", True), are expected b

[issue35131] Cannot access to customized paths within .pth file

2018-11-02 Thread Windson Yang
Windson Yang added the comment: Hello, Valentin Zhao, do you have time to fix it? Or I can create a PR -- nosy: +Windson Yang ___ Python tracker <https://bugs.python.org/issue35

[issue35105] Document that CPython accepts "invalid" identifiers

2018-11-08 Thread Windson Yang
Windson Yang added the comment: I try to create a PR for it. Should we add 'CPython implementation detail' at the document? Because this happens at cpython as well as pypy. BTW, where should we add the document? I have two choices. * https://docs.python.org/3/reference/datamodel.h

[issue35131] Cannot access to customized paths within .pth file

2018-11-08 Thread Windson Yang
Windson Yang added the comment: I tried to create a PR for it, However, I don't know how to handle the code at https://github.com/python/cpython/blob/d4c76d960b/Lib/site.py#L159 So how to check UnicodeDecodeError when we just open the file, I use readlines() but it may use too many m

[issue35201] Recursive '**' matches non-existent directories.

2018-11-09 Thread Windson Yang
Change by Windson Yang : -- versions: +Python 3.5, Python 3.7, Python 3.8 ___ Python tracker <https://bugs.python.org/issue35201> ___ ___ Python-bugs-list mailin

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

2018-11-09 Thread Windson Yang
Windson Yang added the comment: First, we can add some check at https://github.com/python/cpython/blob/e42b705188271da108de42b55d9344642170aa2b/Lib/http/client.py#L871 and raise an error if the URL contains userinfo part. Second, we should catch some exception in urllib.request.urlopen, if

[issue25438] document what codec PyMemberDef T_STRING decodes the char * as

2018-11-12 Thread Windson Yang
Windson Yang added the comment: I will work on it today :D -- nosy: +Windson Yang ___ Python tracker <https://bugs.python.org/issue25438> ___ ___ Python-bug

[issue35250] Minor parameter documentation mismatch for turtle

2018-11-15 Thread Windson Yang
Windson Yang added the comment: Yes, you are right. A quick fix would change 'num' to 'btn' in parameters in https://docs.python.org/3.3/library/turtle.html?highlight=turtle#turtle.onclick. I think they are the same thing. Do you want to create a patch? --

[issue25438] document what codec PyMemberDef T_STRING decodes the char * as

2018-11-16 Thread Windson Yang
Change by Windson Yang : -- keywords: +patch, patch, patch pull_requests: +9824, 9825, 9826 stage: needs patch -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue25438] document what codec PyMemberDef T_STRING decodes the char * as

2018-11-16 Thread Windson Yang
Change by Windson Yang : -- keywords: +patch pull_requests: +9824 stage: needs patch -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue25438] document what codec PyMemberDef T_STRING decodes the char * as

2018-11-16 Thread Windson Yang
Change by Windson Yang : -- keywords: +patch, patch pull_requests: +9824, 9826 stage: needs patch -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue35267] reproducible deadlock with multiprocessing.Pool

2018-11-16 Thread Windson Yang
Windson Yang added the comment: Hello, dzhu. I can reproduce on my OSX, since you already dive into the code, do you have any idea to fix or improve it? -- nosy: +Windson Yang ___ Python tracker <https://bugs.python.org/issue35

<    1   2