[issue46899] use of uninitialized value with msan from subprocess_fork_exec

2022-03-01 Thread Yilei Yang
New submission from Yilei Yang : The uid & gid variable from https://github.com/python/cpython/blob/9833bb91e4d5c2606421d9ec2085f5c2dfb6f72c/Modules/_posixsubprocess.c#L737-L738 can be passed to the `do_fork_exec` call below uninitialized and cause msan to report use-of-uninitialized-v

[issue46825] slow matching on regular expression

2022-02-22 Thread Heran Yang
New submission from Heran Yang : I'm using `re.fullmatch` to match a string that only contains 0 and 1. The regular expression is: (0+|1(01*0)*1)+ It runs rather slow with Python 3.7, but when I try using regex in C++, with std::regex_constants::__polynomial, it works well. Would someone

[issue46803] Item not shown when using mouse wheel to scroll for Listbox/Combobox

2022-02-19 Thread Jason Yang
New submission from Jason Yang : When scrolled items by mouse wheel in tk.Listbox/ttk.Combobox, some items not shown. Is it a bug ? or I did something wrong ? In following case, 'Wednesday' will not shown when scroll mouse wheel at - tk.Listbox or vertical scrollbar of tk.Listbox

[issue46784] Duplicated symbols when linking embedded Python with libexpat

2022-02-17 Thread Yilei Yang
Change by Yilei Yang : -- keywords: +patch pull_requests: +29540 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31397 ___ Python tracker <https://bugs.python.org/issu

[issue46784] Duplicated symbols when linking embedded Python with libexpat

2022-02-17 Thread Yilei Yang
New submission from Yilei Yang : The libexpat 2.4.1 upgrade from https://bugs.python.org/issue44394 introduced the following new exported symbols: testingAccountingGetCountBytesDirect testingAccountingGetCountBytesIndirect unsignedCharToPrintable

[issue46554] Add append keyword argument to Path.write_text() and Path.write_bytes()

2022-02-05 Thread Keelung Yang
Keelung Yang added the comment: OK. Since most are opposed to append kwarg, I close this issue. Thanks ALL! -- resolution: -> wont fix stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue46180] Button clicked failed when mouse hover tooltip and tooltip destroyed

2022-02-01 Thread Jason Yang
Jason Yang added the comment: The platform is WIN10 which shown at last line in first message. I don't have other platforms to test if ok or not. -- ___ Python tracker <https://bugs.python.org/issue46

[issue46554] Add append keyword argument to Path.write_text() and Path.write_bytes()

2022-01-29 Thread Keelung Yang
Keelung Yang added the comment: Without append kwarg, users need two lines to append. It's bad to both readability and writability. Library developers should focus on bath language and library's design targets, but how frequently used. And as all discussed here, at least one applications

[issue46554] Add append keyword argument to Path.write_text() and Path.write_bytes()

2022-01-28 Thread Keelung Yang
Keelung Yang added the comment: In file operations, write/modify/append, which one is generic/common? They're all. Modifying need more then one line code, but write/oppend needn't. Two lines are bad to readability and readability counts. How do you determine it's not common enough

[issue46554] Add append keyword argument to Path.write_text() and Path.write_bytes()

2022-01-28 Thread Keelung Yang
Keelung Yang added the comment: This shouldn't be limited logging. In unstable application scene, file should be append and then close immediately to avoid breaking filesystem (e.g. inode is not updated timely). Such as main.py file in MicroPython development board, user may disconnect USB

[issue46554] Add append keyword argument to Path.write_text() and Path.write_bytes()

2022-01-27 Thread Keelung Yang
Keelung Yang added the comment: @barneygale, This is for simplifying code and improve readability, since `Readability counts` in The Zen of Python. Users needn't two lines code to append a file. And there is a minimal modifying to reach it. If inexperienced users are falling into the hole

[issue46554] Add append keyword argument to Path.write_text() and Path.write_bytes()

2022-01-27 Thread Keelung Yang
Change by Keelung Yang : -- components: +Library (Lib) type: -> enhancement versions: +Python 3.11 ___ Python tracker <https://bugs.python.org/issu

[issue46554] Add append keyword argument to Path.write_text() and Path.write_bytes()

2022-01-27 Thread Keelung Yang
New submission from Keelung Yang : Three reasons to improve issue 35095: Implement pathlib.Path.append_bytes and pathlib.Path.append_text 1. If I want to append text to log at each startup(before calling basicConfig), there is no simple way to do this. 2. Adding append keyword is better

[issue46525] datetime.timestamp() lose precision when the time is too large

2022-01-25 Thread Yilei Yang
New submission from Yilei Yang : Examples: >>> datetime.datetime(, 1, 1, microsecond=99).timestamp() 7952371200.99 >>> datetime.datetime(, 1, 1, microsecond=99).timestamp() 43012195201.0 >>> datetime.datetime(2567, 1, 1, microsecond=98).timest

[issue35095] Implement pathlib.Path.append_bytes and pathlib.Path.append_text

2022-01-24 Thread Keelung Yang
Keelung Yang added the comment: @pitrou Firstly, I can't agree with `it is quite uncommon to open a file in append mode`. It should be depended to users and their application scenes. @pablogsal Secondly, I think `Path.write_*(, append=False)` is better then adding new APIs, as discussed

[issue46464] concurrent.futures.ProcessPoolExecutor can deadlock when tcmalloc is used

2022-01-21 Thread Yilei Yang
New submission from Yilei Yang : When Python is built and linked with tcmalloc, using ProcessPoolExecutor may deadlock. Here is a reproducible example: $ cat t.py from concurrent import futures import sys def work(iteration, item): sys.stdout.write(f'working: iteration={iteration}, item

[issue46179] Delete selected item generate "<>" event or not in different version of tkinter or Python

2021-12-26 Thread Jason Yang
Jason Yang added the comment: >From https://core.tcl-lang.org/tk/reportlist, I found the same issue ttk::treeview <> event bug https://core.tcl-lang.org/tk/tktview?name=2a6c62afd9 It is an old bug from 2014 anf not fixed, and now it fixed. OK, no more question about it. Thank you

[issue46180] Button clicked failed when mouse hover tooltip and tooltip destroyed

2021-12-26 Thread Jason Yang
New submission from Jason Yang : Button no response when clicked if mouse move into tooltip and tooltip destroyed for Python 3.9.9/3.10.1 and tkinter 8.6.12 You can check it by moving mouse into button, then move to tooltip after it shown, then click button and you won't get response

[issue46179] Delete selected item generate "<>" event or not in different version of tkinter or Python

2021-12-26 Thread Jason Yang
New submission from Jason Yang : In python(3.8.10)/tkinter(8.6.9), it won't generate "<>" event if we delete selected item of ttk.Treeview, but it will for python(3.9.9/3.10.1)/tkinter(8.6.12). Check it just by clicking 'Delete Item 1' button in following demo code ```python

[issue20092] type() constructor should bind __int__ to __index__ when __index__ is defined and __int__ is not

2021-11-19 Thread Patrick Yang
Patrick Yang added the comment: I ended up in this issue after I learnt the following from the Python Library Reference Manual. float(..). For a general Python object x, float(x) delegates to x.__float__(). If __float__() is not defined then it falls back to __index__

[issue45210] tp_dealloc docs should mention error indicator may be set

2021-09-15 Thread Edward Yang
New submission from Edward Yang : The fact that the error indicator may be set during tp_dealloc is somewhat well known (https://github.com/posborne/dbus-python/blob/fef4bccfc535c6c2819e3f15384600d7bc198bc5/_dbus_bindings/conn.c#L387) but it's not documented in the official manual. We should

[issue12458] Tracebacks should contain the first line of continuation lines

2021-06-15 Thread Edward Yang
Edward Yang added the comment: Supposing I like the old behavior (line number of the end of the statement), is there any way to recover that line number from the traceback after this change? -- nosy: +ezyang ___ Python tracker <ht

[issue43940] int casting to float results to a different value in memory

2021-04-26 Thread Huang Yang
Huang Yang added the comment: OK. Seems it's the default behavior of CPU instruction. And CPU follows the IEEE standard of float. Is there any workaround? -- status: pending -> open ___ Python tracker <https://bugs.python.org/issu

[issue43940] int casting to float results to a different value in memory

2021-04-25 Thread Huang Yang
Huang Yang added the comment: Also reproducible by: from ctypes import * i = int('7f94e57c', 16) cp = pointer(c_int(i)) fp = cast(cp, POINTER(c_float)) print(fp.contents.value) # nan p = pointer(c_float(fp.contents.value)) ip = cast(p, POINTER(c_int)) print(hex(ip.contents.value

[issue43940] int casting to float results to a different value in memory

2021-04-25 Thread Huang Yang
Huang Yang added the comment: It's reproducible only if the float is nan, with prefix 7f or ff. Seems the value is OR operated by 0x0040. -- ___ Python tracker <https://bugs.python.org/issue43

[issue43940] int casting to float results to a different value in memory

2021-04-25 Thread Huang Yang
New submission from Huang Yang : from ctypes import * import struct i = int('7f94e57c', 16) cp = pointer(c_int(i)) fp = cast(cp, POINTER(c_float)) print(fp.contents.value) # nan print(struct.pack(">f", fp.contents.value).hex()) # 7fd4e57c # value changed: 7f94e57

[issue43628] Incorrect argument errors for random.getstate()

2021-03-25 Thread Yang Feng
New submission from Yang Feng : In documentation of random.getstate(), it says: “random.getstate() Return an object capturing the current internal state of the generator. This object can be passed to setstate() to restore the state.” random.getstate() takes 0 argument and return the current

[issue43185] AssertRaises() causes core dump in handling recursion

2021-02-10 Thread Yang Feng
Yang Feng added the comment: Could you please tell me your secret method of getting the minimal script? I will try to provide minimal ones in our following work. -- ___ Python tracker <https://bugs.python.org/issue43

[issue43190] < test.support > check_free_after_iterating( ) causes core dump in handling iteration.

2021-02-10 Thread Yang Feng
New submission from Yang Feng : In the following program, we call check_free_after_iterating( ) twice, in the second time, we recursively call function test_free_after_iterating(). Python interpreter crashes. +++ import unittest import test.support

[issue43189] decorator function run_with_locale() crashes Python interpreter

2021-02-10 Thread Yang Feng
New submission from Yang Feng : We use run_with_locale() as decorator function, then we recursively call test_float__format__locale in the following example. Python interpreter crashes. +++ from test.support import run_with_locale @run_with_locale

[issue43188] multiple operations of dict causes core dump of Python interpreter.

2021-02-10 Thread Yang Feng
New submission from Yang Feng : In the following programs, we call check_reentrant_insertion("s") twice, after multiple of update and clear of dict, the Python interpreter crashes. +++ def check_reentrant_insertion(mutate): clas

[issue43187] Dict creation in recursive function cause interpreter crashes.

2021-02-10 Thread Yang Feng
New submission from Yang Feng : In the following programs, dict is created in recursive calls. Then a core dump is reported by Python interpreter. +++ def test_equal_operator_modifying_operand(): class X(): def __del__(DictTest

[issue43186] Recursive call causes core dump in assertRaises

2021-02-10 Thread Yang Feng
New submission from Yang Feng : In following teststr.py, class MyString is nestedly instanced in method __getattr__(). This script will lead to a "core dump" in Python interpreter. My Python version is 3.9.1 and my operating system is Ubuntu 16.04.

[issue43185] AssertRaises() causes core dump in handling recursion

2021-02-10 Thread Yang Feng
New submission from Yang Feng : Seeing the following program, in the second assertRaises(), function "test_invalid_adpcm_state()" is recursively called. Then a fatal Python error shows up and the Python interpreter crashes. ++ import unitt

[issue42186] unittest overrides more serious warnings filter added before unittest.main()

2020-10-28 Thread Yilei Yang
New submission from Yilei Yang : Because unittest adds a `default` filter before tests run, other warnings filters are overridden if added before. Ideally, unittest should not make the warnings less serious, e.g. if there is already an 'error' filter that raises exception, it shouldn't

[issue35286] wrong result for difflib.SequenceMatcher

2020-10-28 Thread Boris Yang
Change by Boris Yang : -- stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue35286> ___ ___ Python-bugs-list

[issue41105] Add some extra content check in configure process for some empty header file who has been deprecated by glibc

2020-06-24 Thread Jiachen Yang
Change by Jiachen Yang : -- nosy: +Jiachen Yang ___ Python tracker <https://bugs.python.org/issue41105> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40897] Inheriting from Generic causes inspect.signature to always return (*args, **kwargs) for constructor (and all subclasses)

2020-06-06 Thread Edward Yang
New submission from Edward Yang : Consider the following program: ``` import inspect from typing import Generic, TypeVar T = TypeVar('T') class A(Generic[T]): def __init__(self) -> None: pass print(inspect.signature(A)) ``` I expect inspect.signature to ret

[issue35228] Index search in CHM help crashes viewer

2020-05-31 Thread Keelung Yang
Keelung Yang added the comment: It's reoccurable in Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:37:02) [MSC v.1924 64 bit (AMD64)] on windows version 10.0.19041.264 Just need to open "Python 3.8 Manuals (64-bit)" --> index --> input 'p' on keyboard. -- nos

[issue35212] Expressions with format specifiers in f-strings give wrong code position in AST

2020-04-06 Thread yang
Change by yang : -- keywords: +patch nosy: +fhsxfhsx nosy_count: 2.0 -> 3.0 pull_requests: +18760 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19398 ___ Python tracker <https://bugs.python.org/i

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

2020-03-27 Thread Windson Yang
Windson Yang added the comment: Any update? -- ___ Python tracker <https://bugs.python.org/issue36453> ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2020-03-27 Thread Windson Yang
Windson Yang added the comment: Any update? -- ___ Python tracker <https://bugs.python.org/issue36093> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38921] Max Recursion Depth Reached in Logging Library

2020-01-17 Thread yang
yang added the comment: You assigned a handler to a variable `formatter`, and then called `setFormatter(formatter)`, but `formatter` is in fact a handler. The two classes `Formatter` and `Handler` happen to have a same name method `format` which is called when logging. So what happend

[issue36078] argparse: positional with type=int, default=SUPPRESS raise ValueError

2020-01-14 Thread yang
yang added the comment: I ran into the same issue and looked into the code, and found it more complicated than I thought. The more I went on, more issues occur. I wonder if I should open a new issue, but I will first comment here. If you feel like this should be a new issue, I will open one

[issue38626] small change at bisect_left function for easy understanding

2019-10-28 Thread Windson Yang
New submission from Windson Yang : bisect_left should be similar to bisect_right. However, the current implement didn't reflect it. A little bit update for the bisect_left function could make the user easy to understand their relation. def bisect_left(a, x, lo=0, hi=None): if lo <

[issue38125] Can' build document in Sphinx v2.2.0

2019-10-28 Thread Windson Yang
Change by Windson Yang : -- stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue38125> ___ ___ Python-bugs-list

[issue38125] Can' build document in Sphinx v2.2.0

2019-09-11 Thread Windson Yang
New submission from Windson Yang : I got two errors when I try to build python document with make venv make html The first one is > Since v2.0, Sphinx uses "index" as master_doc by default. Please add > "master_doc = 'contents'" to your conf.py. After f

[issue37846] declare that Text I/O use buffer inside

2019-08-14 Thread Windson Yang
Windson Yang added the comment: I found the document is not that clear when I try to understand what happens when Python read/write a file. I'm not sure who also needs this information. As you said, It wouldn't help the user program in Python. However, make it more clear maybe help users

[issue37846] declare that Text I/O use buffer inside

2019-08-13 Thread Windson Yang
New submission from Windson Yang : At the beginning of https://docs.python.org/3.7/library/io.html#io.RawIOBase, we declared that > Binary I/O (also called buffered I/O) and > Raw I/O (also called unbuffered I/O) But we didn't mention if Text I/O use buffer or not which led to con

[issue29750] smtplib doesn't handle unicode passwords

2019-07-31 Thread Windson Yang
Windson Yang added the comment: I just updated the PR -- ___ Python tracker <https://bugs.python.org/issue29750> ___ ___ Python-bugs-list mailing list Unsub

[issue29750] smtplib doesn't handle unicode passwords

2019-07-31 Thread Windson Yang
Change by Windson Yang : -- pull_requests: +14813 pull_request: https://github.com/python/cpython/pull/15064 ___ Python tracker <https://bugs.python.org/issue29

[issue29750] smtplib doesn't handle unicode passwords

2019-07-31 Thread Windson Yang
Windson Yang added the comment: Sorry, I forgot about this PR, I will update the patch depends on review soon :D -- ___ Python tracker <https://bugs.python.org/issue29

[issue15474] Differentiate decorator and decorator factory in docs

2019-06-03 Thread Windson Yang
Windson Yang added the comment: Hi, Andrés Delfino. Are you still working on it? -- nosy: +Windson Yang ___ Python tracker <https://bugs.python.org/issue15

[issue37086] time.sleep error message misleading

2019-06-02 Thread Windson Yang
Change by Windson Yang : -- keywords: +patch pull_requests: +13652 stage: -> patch review pull_request: https://github.com/python/cpython/pull/13768 ___ Python tracker <https://bugs.python.org/issu

[issue37086] time.sleep error message misleading

2019-06-02 Thread Windson Yang
Windson Yang added the comment: I just create a PR for it. -- nosy: +Windson Yang ___ Python tracker <https://bugs.python.org/issue37086> ___ ___ Python-bug

[issue26468] shutil.copy2 raises OSError if filesystem doesn't support chmod

2019-06-02 Thread Windson Yang
Change by Windson Yang : -- keywords: +patch pull_requests: +13651 stage: -> patch review pull_request: https://github.com/python/cpython/pull/13765 ___ Python tracker <https://bugs.python.org/issu

[issue37073] clarify functions docs in IO modules and Bytes Objects

2019-05-31 Thread Windson Yang
Change by Windson Yang : -- pull_requests: +13602 pull_request: https://github.com/python/cpython/pull/13715 ___ Python tracker <https://bugs.python.org/issue37

[issue37073] clarify functions docs in IO modules and Bytes Objects

2019-05-31 Thread Windson Yang
Change by Windson Yang : -- keywords: +patch pull_requests: +13600 stage: -> patch review pull_request: https://github.com/python/cpython/pull/13713 ___ Python tracker <https://bugs.python.org/issu

[issue37073] clarify functions docs in IO modules and Bytes Objects

2019-05-31 Thread Windson Yang
Windson Yang added the comment: Sure. Feel free to edit my PR. -- ___ Python tracker <https://bugs.python.org/issue37073> ___ ___ Python-bugs-list mailin

[issue37079] PEM cadata causes ssl.SSLError: nested asn1 error

2019-05-28 Thread Jizhou Yang
Jizhou Yang added the comment: Thanks a lot for the quick answer! Verified that the proposed solution works with PEM certificates in both Python 2 and 3. -- stage: -> resolved status: pending -> closed ___ Python tracker <https://bugs.p

[issue37079] PEM cadata causes ssl.SSLError: nested asn1 error

2019-05-28 Thread Jizhou Yang
New submission from Jizhou Yang : Loading cadata in PEM format results in a nested asn1 error. Workaround is to convert cadata to unicode. Minimum code for reproducing the issue: >>>import ssl >>> with open('ca.crt') as f: ... ca_crt = f.read() ... >>> c =

[issue37079] PEM cadata causes ssl.SSLError: nested ans1 error

2019-05-28 Thread Jizhou Yang
Change by Jizhou Yang : -- assignee: christian.heimes components: SSL nosy: Jizhou Yang, christian.heimes priority: normal severity: normal status: open title: PEM cadata causes ssl.SSLError: nested ans1 error type: crash versions: Python 2.7

[issue37073] clarify functions docs in IO modules and Bytes Objects

2019-05-28 Thread Windson Yang
New submission from Windson Yang : > PyBytes_FromStringAndSize(const char *v, Py_ssize_t len): > Return a new bytes object with a copy of the string v as value and length len > on success, and NULL on failure. If v is NULL, the contents of the bytes > object are uninitialized.

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

2019-05-23 Thread Windson Yang
Windson Yang added the comment: I think we should mention it at the document, like in the tell() function. -- ___ Python tracker <https://bugs.python.org/issue36

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

2019-05-23 Thread Windson Yang
Windson Yang added the comment: I'm not sure it's a bug. When you write binary data to file (use BufferedIOBase by default). It actually writes the data to a buffer. That is why tell() gets out of sync. You can follow the instrument belolw. For instance, call flush() after writing to get

[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

[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

[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

[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

[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

[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/issue30

[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

[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

[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

[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.

[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

[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 self.pos = oldpos

[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 tracker <ht

[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 of L to 1(L[::3]

[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 them c

[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

[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

[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 q.emp

[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

[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

[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

[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

[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:

[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

[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

[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

[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

[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

[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 <ht

[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

[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 function

[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

[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 f

[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.extend_path(path, name)) def

[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

  1   2   3   >