[issue46926] runpy.run_path didn't set __package__ to None as describe in doc

2022-03-08 Thread Charlie Yan
Change by Charlie Yan : -- components: +Library (Lib) type: -> behavior ___ Python tracker <https://bugs.python.org/issue46926> ___ ___ Python-bugs-list mai

[issue46926] runpy.run_path didn't set __package__ to None as describe in doc

2022-03-04 Thread Charlie Yan
Change by Charlie Yan : -- title: runpy.run_path didn't set __package__ as describe in doc -> runpy.run_path didn't set __package__ to None as describe in doc ___ Python tracker <https://bugs.pytho

[issue46926] runpy.run_path didn't set __package__ as describe in doc

2022-03-04 Thread Charlie Yan
New submission from Charlie Yan : As described in the doc: https://docs.python.org/3.8/library/runpy.html#runpy.run_path > If the supplied path directly references a script file (whether as source or > as precompiled byte code), then __file__ will be set to the supplied path, > and

[issue43139] test_ttk test_compound and test_tk test_type fails with Tk 8.6.11.1

2021-02-12 Thread Felix Yan
Felix Yan added the comment: It's Arch Linux x86_64 with system tcl/tk. It's build in a clean chroot for packaging and always reproducible. -- ___ Python tracker <https://bugs.python.o

[issue43139] test_ttk test_compound and test_tk test_type fails with Tk 8.6.11.1

2021-02-05 Thread Felix Yan
New submission from Felix Yan : == FAIL: test_compound (tkinter.test.test_ttk.test_widgets.ButtonTest) -- Traceback (most recent call last): File "/

[issue42575] Suggest to add an LinkedList data structure to python

2020-12-04 Thread Sam Yan
New submission from Sam Yan : There has been no LinkedList data structure for Python. Therefore suggest adding a LinkedList data structure. -- components: C API files: LinkedList.py messages: 382557 nosy: SamUnimelb priority: normal severity: normal status: open title: Suggest to add

[issue42301] Lack function to track index of an element in heapq

2020-11-09 Thread Sam Yan
New submission from Sam Yan : Github PR #23204: For a given element in a heap, we can leverage the fact that we can search this element quicker thinking of the property of a heap. Therefore out of h.index(x) that a list linear search uses, I propose to use a special written index method to

[issue42204] "import setuptools" Results in "ModuleNotFoundError: No module named '_distutils_hack'"

2020-10-30 Thread Steven Yan
Change by Steven Yan : Removed file: https://bugs.python.org/file49550/pic.png ___ Python tracker <https://bugs.python.org/issue42204> ___ ___ Python-bugs-list mailin

[issue42204] "import setuptools" Results in "ModuleNotFoundError: No module named '_distutils_hack'"

2020-10-30 Thread Steven Yan
Change by Steven Yan : Added file: https://bugs.python.org/file49551/pic.png ___ Python tracker <https://bugs.python.org/issue42204> ___ ___ Python-bugs-list mailin

[issue42204] "import setuptools" Results in "ModuleNotFoundError: No module named '_distutils_hack'"

2020-10-30 Thread Steven Yan
Change by Steven Yan : -- components: Distutils files: pic.png nosy: dstufft, eric.araujo, sy priority: normal severity: normal status: open title: "import setuptools" Results in "ModuleNotFoundError: No module named '_distutils_hack'" type: behavior v

[issue41970] test_lib2to3 fails since Python 3.9

2020-10-08 Thread Felix Yan
Felix Yan added the comment: I use this in Arch's packaging: LC_CTYPE=en_US.UTF-8 xvfb-run -s "-screen 0 1920x1080x16 -ac +extension GLX" -a -n "$servernum" \ "${srcdir}/Python-${pkgver}/python" -m test.regrtest -v -uall -x test_tk (test_t

[issue41971] multiple tests in test_tools fail since Python 3.9

2020-10-07 Thread Felix Yan
New submission from Felix Yan : I am packaging Python for Arch and the test suite of Python 3.8.6 passes here without these: == FAIL: test_multiple_roots (test.test_tools.test_c_analyzer.test_common.test_files.IterFilesTests

[issue41970] test_lib2to3 fails since Python 3.9

2020-10-07 Thread Felix Yan
New submission from Felix Yan : I am packaging Python for Arch and the tests suite of Python 3.8.6 pass here without this: ``` 0:09:06 load avg: 0.87 [205/424] test_lib2to3

[issue41952] Top Sentence Had a Extra Space Between "Oct" and "5"

2020-10-05 Thread Steven Yan
Change by Steven Yan : -- title: Extra Space Between "Oct" and "5" -> Top Sentence Had a Extra Space Between "Oct" and "5" ___ Python t

[issue41952] Extra Space Between "Oct" and "5"

2020-10-05 Thread Steven Yan
Change by Steven Yan : -- assignee: terry.reedy components: IDLE nosy: sy, terry.reedy priority: normal severity: normal status: open title: Extra Space Between "Oct" and "5" type: enhancement versions: Python 3.9 ___ Py

[issue38263] [Windows] multiprocessing: DupHandle.detach() race condition on DuplicateHandle(DUPLICATE_CLOSE_SOURCE)

2020-09-21 Thread Yan Ren
Yan Ren added the comment: append Nosy List. -- nosy: +pemryan ___ Python tracker <https://bugs.python.org/issue38263> ___ ___ Python-bugs-list mailin

[issue41346] test_thousand and compileall hangs on riscv64

2020-07-20 Thread Felix Yan
New submission from Felix Yan : In my riscv64 build, test_thousand (test.test_multiprocessing_forkserver.WithProcessesTestBarrier) always hangs on some locking thing, and the compileall part during installation hangs the same way. I am not sure if it's toolchain related or something

[issue41306] test_tk failure on Arch Linux

2020-07-16 Thread Felix Yan
Felix Yan added the comment: tkinter.TCL_VERSION: 8.6 tkinter.TK_VERSION: 8.6 tkinter.info_patchlevel: 8.6.10 It's always reproducible in either a real desktop or Xvfb with arbitrary resolution etc as far as I have tested. -- ___ Python tr

[issue41306] test_tk failure on Arch Linux

2020-07-15 Thread Felix Yan
New submission from Felix Yan : test_from (tkinter.test.test_tkinter.test_widgets.ScaleTest) is currently failing on Arch Linux, and at least another place: https://python-build-standalone.readthedocs.io/en/latest/status.html The error looks like

[issue41302] _decimal failed to build with system libmpdec 2.5

2020-07-15 Thread Felix Yan
Change by Felix Yan : -- pull_requests: +20631 status: pending -> open pull_request: https://github.com/python/cpython/pull/21488 ___ Python tracker <https://bugs.python.org/issu

[issue41302] _decimal failed to build with system libmpdec 2.5

2020-07-15 Thread Felix Yan
Felix Yan added the comment: Yes, I am currently defining it manually as a workaround for building 3.8.4 in Arch. Also opened GH-21481 for this :) -- ___ Python tracker <https://bugs.python.org/issue41

[issue41302] _decimal failed to build with system libmpdec 2.5

2020-07-15 Thread Felix Yan
Change by Felix Yan : -- keywords: +patch pull_requests: +20624 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/21481 ___ Python tracker <https://bugs.python.org/issu

[issue41302] _decimal failed to build with system libmpdec 2.5

2020-07-15 Thread Felix Yan
New submission from Felix Yan : In bpo-40874, mpdecimal.h in the vendored libmpdec has defines of UNUSED while the standalone released version of mpdecimal 2.5.0 doesn't. This breaks _decimal module build with system libmpdec due to UNUSED is undefined. Errors are like: cpython/Mo

[issue39385] Add an assertNoLogs context manager to unittest TestCase

2020-04-23 Thread Kit Yan Choi
Kit Yan Choi added the comment: Thank you for looking into this. Yes, I agree it makes sense to have assertNoWarns for the same reason. -- ___ Python tracker <https://bugs.python.org/issue39

[issue39385] Add an assertNoLogs context manager to unittest TestCase

2020-01-19 Thread Kit Yan Choi
Change by Kit Yan Choi : -- keywords: +patch pull_requests: +17459 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18067 ___ Python tracker <https://bugs.python.org/issu

[issue39385] Add an assertNoLogs context manager to unittest TestCase

2020-01-18 Thread Kit Yan Choi
New submission from Kit Yan Choi : assertLogs is really useful (issue18937). Unfortunately it does not cover the use cases where one wants to ensure no logs are emitted. Similar to assertLogs, we can have a context manager for asserting no logs, something like this?: with assertNoLogs

[issue39210] Sorting falls back to use __gt__ when __lt__ is not present

2020-01-04 Thread Yan Mitrofanov
Yan Mitrofanov added the comment: I got your point. So it seems that two pieces of documentation are not equivalent: https://docs.python.org/3/howto/sorting.html#odd-and-ends > The sort routines are guaranteed to use __lt__() when making comparisons > between two objects.

[issue39210] Sorting falls back to use __gt__ when __lt__ is not present

2020-01-04 Thread Yan Mitrofanov
New submission from Yan Mitrofanov : Sorting documentation claims that sorting algorithm is only using < comparisons https://docs.python.org/3/howto/sorting.html#odd-and-ends https://docs.python.org/3/library/stdtypes.html#list.sort When __lt__ implementation is missing, you get an except

[issue38915] 'r[/]*', str, re.MULTILINE | re.DOTALL Won't match // in a string in Python3.6.8

2019-11-26 Thread Yan
Change by Yan : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue38915> ___ ___ P

[issue38915] 'r[/]*', str, re.MULTILINE | re.DOTALL Won't match // in a string in Python3.6.8

2019-11-26 Thread Yan
New submission from Yan : str="//" matches = re.finditer('r[/]*', str, re.MULTILINE | re.DOTALL) for match in matches: print(match.group(0)) The above will match double forward slash in Python2.7.15 but NOT in Python3.6.8. -- components: Library (Lib) m

[issue38296] unittest expectedFailure does not differentiate errors from failures

2019-09-28 Thread Kit Yan Choi
Kit Yan Choi added the comment: I think Python does differentiate "test error" and "test failure" such that a test outcome state can be one of these: success, failure, error, skipped. One could refine these to six: expected success, unexpected success, expected failure

[issue38296] unittest expectedFailure does not differentiate errors from failures

2019-09-28 Thread Kit Yan Choi
Kit Yan Choi added the comment: Pining Chris based on previous discussion in issue16997 ... Hope that's okay. I notice that the language in my initial message also conflates error and failure. My apologies on the carelessness. Just to clarify: @unittest.expectedFailure def

[issue38296] unittest expectedFailure does not differentiate errors from failures

2019-09-27 Thread Kit Yan Choi
Change by Kit Yan Choi : -- nosy: -Kit Choi ___ Python tracker <https://bugs.python.org/issue38296> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38296] unittest expectedFailure does not differentiate errors from failures

2019-09-27 Thread Kit Yan Choi
Kit Yan Choi added the comment: For your test: class T(unittest.TestCase): def test_f(self): raise TypeError() If you run this test with unittest test runner, you should get this result: E == ERROR: test_f (test_main.T

[issue38280] Feature request: Add support to compile to native binary like as golang

2019-09-25 Thread WHK Yan
New submission from WHK Yan : It would be very useful to be able to compile at a low level a complete Python functional script and generate a native binary for each type of operating system and architecture just like golang does. For example: Run script: $ go run script.go Compile script

[issue33835] Too strong side effect?

2018-06-11 Thread X. Yan
X. Yan added the comment: I see. Thanks for the detailed explanations. Best, Xiaogang On 6/11/2018 2:00 PM, Steven D'Aprano wrote: > Steven D'Aprano added the comment: > > Both names "v1" and "v2" refer to the same object. Python does not make >

[issue33835] Too strong side effect?

2018-06-11 Thread X. Yan
X. Yan added the comment: Hi Serhiy, Thanks for your reply. However, the issue I reported was not about sharing the default value. I understand that the parameter L would keep its value [1] from function f's first run, and used it in the second run to get [1, 2]. My point is tha

[issue33835] Too strong side effect?

2018-06-11 Thread X. Yan
New submission from X. Yan : I am familiar with quite a few languages such as C++, C, PASCAL, Matlab, etc., but starting to practice Python. When I tested the code: def f(a, L=[]): L.append(a) return L followed by calls as follows, v1 = f(1) v2 = f(2) , to my surprise, I

[issue30724] ZipFile.open treats directory path as empty file

2017-06-21 Thread Kit Yan Choi
New submission from Kit Yan Choi: Given a zipfile with the following content: subdir/ file1.txt subdir/file2.txt >>> archive = ZipFile(file_path, "r") >>> f = archive.open("subdir/", "r") >>>f.read() b'' It is

[issue27650] Implement `__repr__` methods for logging.Logger and others

2016-12-27 Thread Felix Yan
Changes by Felix Yan : -- nosy: +felixonmars ___ Python tracker <http://bugs.python.org/issue27650> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue25681] Assignment of one element in nested list changes multiple elements

2015-11-20 Thread Yan
Yan added the comment: Thanks for the quick response. It makes sense to me. I misunderstood the * operator. -- ___ Python tracker <http://bugs.python.org/issue25

[issue25681] Assignment of one element in nested list changes multiple elements

2015-11-20 Thread Yan
New submission from Yan: Is this the correct behavior? >>> l=[['']*2]*3 >>> b=[['', ''], ['', ''], ['', '']] >>> l == b True >>> l[0][1]='A' >>> b[0][1]='A'

[issue25195] mock.ANY doesn't match mock.MagicMock() object

2015-09-20 Thread Felix Yan
Changes by Felix Yan : -- type: -> behavior ___ Python tracker <http://bugs.python.org/issue25195> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue25195] mock.ANY doesn't match mock.MagicMock() object

2015-09-20 Thread Felix Yan
New submission from Felix Yan: Since Python 3.5.0 mock.MagicMock() object seems not matched by mock.ANY. This behavior looks weird and breaks tests of boto. Minimized example: In Python 3.4.3: >>> from unittest import mock >>> m = mock.MagicMock() &g

[issue25096] test_gdb failed to read version for gdb >= 7.10

2015-09-13 Thread Felix Yan
New submission from Felix Yan: The regex in test_gdb reads only one digit of gdb's minor version, which would fail for gdb >= 7.10, and skip the test as 7.1 < 7.4. Original commit: https://hg.python.org/cpython/rev/b71cda2f48c6#l1.9 Patch attached. -- components:

[issue24950] FAIL: test_expanduser when $HOME=/

2015-08-27 Thread Felix Yan
Felix Yan added the comment: btw, there seems to be a relevant failure in test_pathlib as well: test test_pathlib failed -- Traceback (most recent call last): File "/build/python/src/Python-3.5.0rc2/Lib/test/test_pathlib.py", line 2015, in test_expanduser self.assertEqual(p1.

[issue24950] FAIL: test_expanduser when $HOME=/

2015-08-27 Thread Felix Yan
Changes by Felix Yan : -- title: FAIL: test_posixpath when $HOME=/ -> FAIL: test_expanduser when $HOME=/ ___ Python tracker <http://bugs.python.org/issu

[issue24950] FAIL: test_posixpath when $HOME=/

2015-08-27 Thread Felix Yan
Changes by Felix Yan : -- title: FAIL: test_expanduser when $HOME=/ -> FAIL: test_posixpath when $HOME=/ ___ Python tracker <http://bugs.python.org/issu

[issue24950] FAIL: test_expanduser when $HOME=/

2015-08-27 Thread Felix Yan
New submission from Felix Yan: test_expanduser in test.test_posixpath.PosixPathTest fails when the users $HOME being exactly "/", after the patch in issue17809 was introduced. test test_posixpath failed -- Traceback (most recent call last): File "/build/python/src/Python-3.

[issue21638] Seeking to EOF is too inefficient!

2014-06-03 Thread Linlin Yan
Linlin Yan added the comment: I ensured that the problem is in libc. I will try to figure out it by updating libc or optimizing some related parameters. -- resolution: -> third party status: open -> closed ___ Python tracker

[issue21638] Seeking to EOF is too inefficient!

2014-06-03 Thread Linlin Yan
Linlin Yan added the comment: Thanks! I agree with that. -- ___ Python tracker <http://bugs.python.org/issue21638> ___ ___ Python-bugs-list mailing list Unsub

[issue21638] Seeking to EOF is too inefficient!

2014-06-02 Thread Linlin Yan
Linlin Yan added the comment: I agree that Python 2 should use fopen / fread rather than directly read(). But you may misunderstand this. The 'strace' tool reports Linux system calls, including read() rather than fread(), and I guess that read() should be finally called in fread() impl

[issue21638] Seeking to EOF is too inefficient!

2014-06-02 Thread Linlin Yan
New submission from Linlin Yan: I noticed this problem when I run a Python2 program (MACS: http://liulab.dfci.harvard.edu/MACS/) very inefficiently on a large storage on a high performace server (64-bit Linux). It was much slower (more than two days) than running it on a normal PC (less than

[issue12635] use "as" for block scope support

2011-07-25 Thread HaiYun Yan
New submission from HaiYun Yan : use "as" for block scope support just like mozilla javascript "let" extension https://developer.mozilla.org/en/new_in_javascript_1.7#Block_scope_with_let_%28Merge_into_let_Statement%29 usage: as_clause(as_declare): "as" NAME a

[issue12473] factory func of collections.defaultdict should receive the "missing key" as args when called.

2011-07-02 Thread HaiYun Yan
New submission from HaiYun Yan : for example: def calc(params): """ i am factoring numbers. """ # an expensive CPU cost function but # passin params and return result are both lightweight cachedcalc = collections.defaultdict(calc) result = cachedcalc

[issue1432] Strange behavior of urlparse.urljoin

2007-11-16 Thread yan
yan added the comment: That sounds great, thanks a lot. __ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1432> __ ___ Python-bugs-list mailing list Unsubs

[issue1432] Strange behavior of urlparse.urljoin

2007-11-14 Thread yan
yan added the comment: Not really, it's just for PATH component. But the QUERY and PARAMETER are not the same. just check the RFC1808. 5.1. Normal Examples Base: http://a/b/c/d;p?q#f> ?y = http://a/b/c/d;p?y> ;x = http://a/b/c/d;x>

[issue1432] Strange behavior of urlparse.urljoin

2007-11-12 Thread yan
New submission from yan: When I use python 2.4/2.5, I found a strange behavior like this: urlparse.urljoin("http://www.python.org/[EMAIL PROTECTED]","[EMAIL PROTECTED]") It will return "http://www.python.org/[EMAIL PROTECTED]". But I think it should be "htt