[issue26143] Ensure that IDLE's stdlib imports are from the stdlib

2017-04-30 Thread Louie Lu
Louie Lu added the comment: Because sys module is correctly imported, we can modify sys.path to change the import behave. Add new PR 1364 for this. This add a new private function `_fix_import_path` that will remove the local import path `''`, when running IDLE from command line

[issue26143] Ensure that IDLE's stdlib imports are from the stdlib

2017-04-30 Thread Louie Lu
Changes by Louie Lu <m...@louie.lu>: -- pull_requests: +1474 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26143> ___ __

[issue30200] tkinter ListboxSelect

2017-04-29 Thread Louie Lu
Louie Lu added the comment: This behavior is as same as on my Linux Python 2.7.13: (, (2,)) # Select Font (, (3,)) # Select Style (, ()) # Deselect Font And also, you don't need a try expect to handle this situation. You can see that when de-select the listbox, curselection() will return

[issue30200] tkinter ListboxSelect

2017-04-29 Thread Louie Lu
Louie Lu added the comment: I think this is only a normal behavior now. Generate two events make sense, they are generate by different widget: .!editor.!font_dialog.!frame.!frame.!listbox (0,) # Select Font .!editor.!font_dialog.!frame2.!frame.!listbox (0,) # Select Style .!editor

[issue30200] tkinter ListboxSelect

2017-04-29 Thread Louie Lu
Louie Lu added the comment: But I'm not sure if this is a behavior error or something else, I'm still trying to find the root cause. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue30200] tkinter ListboxSelect

2017-04-29 Thread Louie Lu
Louie Lu added the comment: The problem cause by listbox.curselection(). When crossing from a listbox to another listbox, it will trigger twice event. The first time get a valid select tuple from curselection() (which will return (index, label)), and the second time will generate empty tuple

[issue30200] tkinter ListboxSelect

2017-04-29 Thread Louie Lu
Louie Lu added the comment: I can reproduce the problem at 2.7.13 on Linux. Exception in Tkinter callback Traceback (most recent call last): File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1542, in __call__ return self.func(*args) File "tests.py", li

[issue24263] unittest cannot load module whose name starts with Unicode

2017-04-28 Thread Louie Lu
Louie Lu added the comment: Add PR: https://github.com/python/cpython/pull/1338/ rbcollins: Need for help to review the patch, I think that both `$thing` and `$thing.py` can't be used in python (and for UNIX dir), and `\u2603` (☃) though can do something like `☃.py`, but it is not a valid

[issue24263] unittest cannot load module whose name starts with Unicode

2017-04-28 Thread Louie Lu
Changes by Louie Lu <m...@louie.lu>: -- pull_requests: +1449 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue24263> ___ __

[issue30181] Incorrect parsing of test case docstring

2017-04-26 Thread Louie Lu
Louie Lu added the comment: This is because unittest.TestCase method `shortDescription()` will only return the first line of docstring, writing at here*: """ The default implementation of this method returns the first line of the test method’s docstring, if available, or None

[issue30182] Incorrect in referring to ISO as "International Standards Organization"

2017-04-26 Thread Louie Lu
Louie Lu added the comment: Add the link: Python 3: https://docs.python.org/3/howto/unicode.html Python 2: https://docs.python.org/2/howto/unicode.html Both of 2 and 3 howto unicode use "International Standards Organization" Jesse, would you like to create a PR for this? -

[issue28964] AST literal_eval exceptions provide no information about line number

2017-04-26 Thread Louie Lu
Louie Lu added the comment: Steve, will you work on this patch to GitHub? -- nosy: +louielu ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue28698] Python 3.x ctypes c_wchar_p return is different from official documentation example

2017-04-26 Thread Louie Lu
Changes by Louie Lu <m...@louie.lu>: -- pull_requests: +1399 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28698> ___ __

[issue28698] Python 3.x ctypes c_wchar_p return is different from official documentation example

2017-04-26 Thread Louie Lu
Changes by Louie Lu <m...@louie.lu>: -- pull_requests: +1398 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28698> ___ __

[issue18943] argparse: default args in mutually exclusive groups

2017-04-26 Thread Louie Lu
Louie Lu added the comment: paul, will you work on this patch? or I can help this issue, too. -- nosy: +louielu type: -> behavior versions: +Python 3.7 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.or

[issue19184] dis module has incorrect docs for RAISE_VARARGS

2017-04-26 Thread Louie Lu
Louie Lu added the comment: I've made a PR, could serhiy or georg help for review? Thanks! -- nosy: +louielu ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue30013] Compiler warning in Modules/posixmodule.c

2017-04-26 Thread Louie Lu
Louie Lu added the comment: serhiy, haypo, what do you think about this warning's fixed? Thanks! -- nosy: +haypo, serhiy.storchaka ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue30163] argparse mx_group is required, when action value equal default will be ignore

2017-04-26 Thread Louie Lu
Louie Lu added the comment: Thanks, paul. Your msg help a lot. Will you work on #18943? I can help for this or review the pending patch. -- resolution: -> duplicate ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.or

[issue30163] argparse mx_group is required, when action value equal default will be ignore

2017-04-25 Thread Louie Lu
Louie Lu added the comment: Maybe documentation should note that: """ # error if this argument is not allowed with other previously # seen arguments, assuming that actions that use the default # value don't really count as "present" """ -- __

[issue21150] Add quick links table to argparse docs

2017-04-25 Thread Louie Lu
Louie Lu added the comment: Could Raymond, Gaurav or paul help to review the PR's summary table? Thanks! -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue30163] argparse mx_group is required, when action value equal default will be ignore

2017-04-25 Thread Louie Lu
Louie Lu added the comment: Strange, this will only trigger when that argument type is int. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue30163] argparse mx_group is required, when action value equal default will be ignore

2017-04-25 Thread Louie Lu
New submission from Louie Lu: When adding mutually exclusive group and required is True, and the group argument has default value. If we type its default value, argparse will ignore the input and return `argument is required` --- PoC import argparse parser

[issue30163] argparse mx_group is required, when action value equal default will be ignore

2017-04-25 Thread Louie Lu
Changes by Louie Lu <m...@louie.lu>: -- type: -> behavior ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30163> ___ ___

[issue30157] csv.Sniffer.sniff() regex error

2017-04-24 Thread Louie Lu
Changes by Louie Lu <m...@louie.lu>: -- title: csn.Sniffer.sniff() regex error -> csv.Sniffer.sniff() regex error ___ Python tracker <rep...@bugs.python.org> <http://bugs.pyt

[issue9285] Add a profile decorator to profile and cProfile

2017-04-22 Thread Louie Lu
Louie Lu added the comment: Giampaolo, the assertion is still worked good, and no need to remove them. The assertion is to prevent dispatch return too more, to return upper then when the profiler was created. The problem why profile __enter__ can't work, is because it misses

[issue23420] python -m cProfile -s fails with non informative message

2017-04-22 Thread Louie Lu
Louie Lu added the comment: If we can solve #30118 for argument unittest, and apply #18971 for optparse to argparse, this issue will then can be solve, too. -- nosy: +louielu ___ Python tracker <rep...@bugs.python.org> <http://bugs.p

[issue29237] Create enum for pstats sorting options

2017-04-22 Thread Louie Lu
Louie Lu added the comment: Mariatta, is there any movement on this issue? Thanks! -- nosy: +louielu ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue18576] Document test.support.script_helper

2017-04-22 Thread Louie Lu
Louie Lu added the comment: The PR on GitHub is based on bobcatfist's patch, addressed on Martin request and some minor change. -- nosy: +louielu ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue29782] Use __builtin_clzl for bits_in_digit if available

2017-04-22 Thread Louie Lu
Louie Lu added the comment: If this issue is closed by "not a big performance improvement", maybe the XXX in mathmoudle.c should be take off? """ /* XXX: This routine does more or less the same thing as * bits_in_digit() in Objects/longobject.c. Someday it would

[issue30113] Allow helper functions to wrap sys.setprofile

2017-04-22 Thread Louie Lu
Changes by Louie Lu <m...@louie.lu>: -- pull_requests: +1368 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30113> ___ __

[issue30113] Allow helper functions to wrap sys.setprofile

2017-04-22 Thread Louie Lu
Louie Lu added the comment: Thanks, Nick. Your analysis is very helpful. After some testing, I found the problem here is because when we using `sys.setprofile` in the helper function, we didn't simulate the call (from where profiler create to helper function), that cause profile's frame link

[issue18576] Document test.support.script_helper

2017-04-22 Thread Louie Lu
Changes by Louie Lu <m...@louie.lu>: -- pull_requests: +1367 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue18576> ___ __

[issue30136] Add test.support.script_helper to documentation

2017-04-21 Thread Louie Lu
New submission from Louie Lu: `test.support.script_helper` didn't document at `test` document. It should be add on. -- assignee: docs@python components: Documentation messages: 292103 nosy: docs@python, louielu priority: normal severity: normal status: open title: Add

[issue30118] Adding unittest for cProfile / profile command line interface

2017-04-21 Thread Louie Lu
Changes by Louie Lu <m...@louie.lu>: -- pull_requests: +1350 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30118> ___ __

[issue18971] Use argparse in the profile/cProfile modules

2017-04-20 Thread Louie Lu
Louie Lu added the comment: haypo, murray, thanks for pointing this thing, I will let go about the bad message test, move to output file and sort test tomorrow, also add a new issue: #30118 -- ___ Python tracker <rep...@bugs.python.org>

[issue30118] Adding unittest for cProfile / profile command line interface

2017-04-20 Thread Louie Lu
New submission from Louie Lu: Serhiy provide a cProfile / profile CLI optparse to argparse patch in #18971, it is time to add up the unittest of CLI test. I'll add the unittest these days for it. -- components: Library (Lib) messages: 291981 nosy: louielu, serhiy.storchaka priority

[issue18971] Use argparse in the profile/cProfile modules

2017-04-20 Thread Louie Lu
Louie Lu added the comment: bad news, somehow the output of std.err and std.out have different between optparse and argparse, even if the test is done, it still need to convert some testcase to argparse compatible. -- nosy: +louielu ___ Python

[issue9285] Add a profile decorator to profile and cProfile

2017-04-20 Thread Louie Lu
Changes by Louie Lu <m...@louie.lu>: -- pull_requests: +1335 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue9285> ___ __

[issue30113] Add profile test case for trace_dispatch_return assertion

2017-04-20 Thread Louie Lu
Changes by Louie Lu <m...@louie.lu>: -- pull_requests: +1334 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30113> ___ __

[issue30113] Add profile test case for trace_dispatch_return assertion

2017-04-20 Thread Louie Lu
New submission from Louie Lu: This is a sub-problem of #9285, in #9285, we aim to provide cProfile and profile a context manager, this will need to add code like this: def __enter__(self): self.set_cmd('') sys.setprofile(self.dispatcher) return self Unfortunately

[issue30112] useful things

2017-04-20 Thread Louie Lu
Louie Lu added the comment: Please don't click the link, Google chrome return a security error """ Attackers on www.arqja.com may trick you into doing something dangerous like installing software or revealing your personal information (for example, passwords, phone numbers,

[issue21150] Add quick links table to argparse docs

2017-04-20 Thread Louie Lu
Changes by Louie Lu <m...@louie.lu>: -- pull_requests: +1332 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue21150> ___ __

[issue21150] Add quick links table to argparse docs

2017-04-19 Thread Louie Lu
Changes by Louie Lu <m...@louie.lu>: -- nosy: +louielu ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue21150> ___ ___ Python

[issue30078] "-m unittest --help" says nothing about direct script exection

2017-04-19 Thread Louie Lu
Changes by Louie Lu <m...@louie.lu>: -- pull_requests: +1306 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30078> ___ __

[issue30078] "-m unittest --help" says nothing about direct script exection

2017-04-19 Thread Louie Lu
Louie Lu added the comment: Add a simple line to `MAIN_EXAMPLES`: "%(prog)s path/to/test_file.py - run tests from test_file.py" -- nosy: +louielu ___ Python tracker <rep...@bugs.python.org> <http://bugs.py

[issue14102] argparse: add ability to create a man page

2017-04-19 Thread Louie Lu
Louie Lu added the comment: Sorry that I didn't figure out what you said in the previous msg. > provide a command-line interface for an end user I add a parameter that developer can switch command line option for man page, if the option is on, user can do this: ./python foo.py --manp

[issue14102] argparse: add ability to create a man page

2017-04-19 Thread Louie Lu
Louie Lu added the comment: Also, `print_manpage` use the same infra as `print_help` and `print_usage`, so it can use the parameter `file` to output to different stream or file. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.p

[issue14102] argparse: add ability to create a man page

2017-04-19 Thread Louie Lu
Louie Lu added the comment: Attachment is the poc of generating man page via `print_manpage`: $ ./python poc_2.py > output && man ./output -- Added file: http://bugs.python.org/file46812/poc_2.py ___ Python tracker <rep...@bugs.pyt

[issue14102] argparse: add ability to create a man page

2017-04-19 Thread Louie Lu
Louie Lu added the comment: > How to use this feature? > argparse is executed every time when the end user runs the program. > But generating a man page is the action that should be executed at > develop or build stage. > ... > How generating a man page should be invoked?

[issue14102] argparse: add ability to create a man page

2017-04-18 Thread Louie Lu
Louie Lu added the comment: Hi all, I've created a PR for this, please help for code review. I found that previous method from Oz had a problem, that man page and general help page will share a Formatter, that cause an unexpected behavior that help page will generate with troff format (Unix

[issue14102] argparse: add ability to create a man page

2017-04-18 Thread Louie Lu
Changes by Louie Lu <m...@louie.lu>: -- pull_requests: +1300 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue14102> ___ __

[issue30031] Improve queens demo (use argparse and singular form)

2017-04-17 Thread Louie Lu
Louie Lu added the comment: Pavlo, you are right, making the argument have backward compatible is good. String quote I'll prefer `'` more than `"`. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.

[issue30090] Failed to build these modules: _ctypes

2017-04-17 Thread Louie Lu
Changes by Louie Lu <m...@louie.lu>: -- components: +Build -Interpreter Core type: compile error -> ___ Python tracker <rep...@bugs.python.org> <http://bugs.pyt

[issue30090] Failed to build these modules: _ctypes

2017-04-17 Thread Louie Lu
Louie Lu added the comment: Are you using Ubuntu or other Linux distribution? This problem is because you didn't install the dependency package. You may first try to use the instruction at devguide: http://cpython-devguide.readthedocs.io/setup.html#build-dependencies Or, assume you have

[issue30031] Improve queens demo (use argparse and singular form)

2017-04-17 Thread Louie Lu
Louie Lu added the comment: I make some review at GitHub. Do David and Terry suggest to also fix the problem about PEP8 coding style, since this demo have many places didn't fit PEP8. -- nosy: +louielu ___ Python tracker <rep...@bugs.python.

[issue30088] mailbox.Maildir doesn't create subdir structure when create=True and base dir exists

2017-04-17 Thread Louie Lu
Louie Lu added the comment: I think this patch make the behavior changed. Documentation wrote that: "If create is True, the mailbox is created if it does not exist.", the current version did that exactly, it won't create subdir (tmp, new, and cur) when dir exists. The situation

[issue30040] new empty dict can be more small

2017-04-17 Thread Louie Lu
Louie Lu added the comment: I'm testing[1] that if we make a fast path that detect if keys is `empty_keys_struct` inside `dictresize`. It can be faster than original patch, but still slower than default (unpatch) in most case. ➜ cpython git:(compact_empty_dict) ✗ ./python.default -m perf

[issue30040] new empty dict can be more small

2017-04-16 Thread Louie Lu
Louie Lu added the comment: forgive my words, I trace the wrong code, sorry about that. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue30040] new empty dict can be more small

2017-04-16 Thread Louie Lu
Louie Lu added the comment: Inada's patch version act different inside `PyObject_SetItem`, when running this code: 'x = {}; x['a'] = 123' at PyObject_SetItem, patch version goes to this line: >│179 if (m && m->mp_ass_subscript) │180 return m->mp_ass

[issue28698] Python 3.x ctypes c_wchar_p return is different from official documentation example

2017-04-15 Thread Louie Lu
Changes by Louie Lu <m...@louie.lu>: -- pull_requests: +1289 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28698> ___ __

[issue19184] dis module has incorrect docs for RAISE_VARARGS

2017-04-15 Thread Louie Lu
Changes by Louie Lu <m...@louie.lu>: -- pull_requests: +1288 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue19184> ___ __

[issue25794] __setattr__ does not always overload operators

2017-04-14 Thread Louie Lu
Changes by Louie Lu <m...@louie.lu>: -- nosy: +louielu ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25794> ___ ___ Python

[issue29881] Add a new private API clear private variables, which are initialized once, at Python shutdown

2017-04-11 Thread Louie Lu
Changes by Louie Lu <m...@louie.lu>: -- nosy: +louielu ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29881> ___ ___ Python

[issue24076] sum() several times slower on Python 3 64-bit

2017-04-11 Thread Louie Lu
Changes by Louie Lu <m...@louie.lu>: -- title: sum() several times slower on Python 3 -> sum() several times slower on Python 3 64-bit ___ Python tracker <rep...@bugs.python.org> <http://bugs.pyt

[issue24076] sum() several times slower on Python 3

2017-04-11 Thread Louie Lu
Changes by Louie Lu <m...@louie.lu>: -- versions: +Python 3.7 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue24076> ___ __

[issue25828] PyCode_Optimize() (peephole optimizer) doesn't handle KeyboardInterrupt correctly

2017-04-11 Thread Louie Lu
Changes by Louie Lu <m...@louie.lu>: -- pull_requests: +1221 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25828> ___ __

[issue25828] PyCode_Optimize() (peephole optimizer) doesn't handle KeyboardInterrupt correctly

2017-04-11 Thread Louie Lu
Changes by Louie Lu <m...@louie.lu>: -- versions: +Python 3.7 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25828> ___ __

[issue30013] Compiler warning in Modules/posixmodule.c

2017-04-07 Thread Louie Lu
Changes by Louie Lu <m...@louie.lu>: -- pull_requests: +1184 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30013> ___ __

[issue30013] Compiler warning in Modules/posixmodule.c

2017-04-07 Thread Louie Lu
Changes by Louie Lu <m...@louie.lu>: -- title: Compiling warning in Modules/posixmodule.c -> Compiler warning in Modules/posixmodule.c ___ Python tracker <rep...@bugs.python.org> <http://bugs.pyt

[issue30013] Compiling warning in Modules/posixmodule.c

2017-04-07 Thread Louie Lu
New submission from Louie Lu: Using gcc-6.3.1 20170306 on Linux 4.10.1, it gave the warning: gcc -pthread -c -Wno-unused-result -Wsign-compare -g -Og -Wall -Wstrict-prototypes-std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit

[issue29446] Improve tkinter 'import *' situation

2017-04-04 Thread Louie Lu
Changes by Louie Lu <m...@louie.lu>: -- nosy: +louielu ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29446> ___ ___ Python

[issue29981] Update Index for set, dict, and generator 'comprehensions'

2017-04-04 Thread Louie Lu
Changes by Louie Lu <m...@louie.lu>: -- pull_requests: +1170 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29981> ___ __

[issue29981] Update Index for set, dict, and generator 'comprehensions'

2017-04-04 Thread Louie Lu
Changes by Louie Lu <m...@louie.lu>: -- nosy: +louielu ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29981> ___ ___ Python

[issue29946] compiler warning "sqrtpi defined but not used"

2017-03-30 Thread Louie Lu
Changes by Louie Lu <m...@louie.lu>: -- pull_requests: +808 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29946> ___ __

[issue29946] compiler warning "sqrtpi defined but not used"

2017-03-30 Thread Louie Lu
Louie Lu added the comment: I can reproduce on ArchLinux 4.10.1-1, GCC 6.3.1: /home/louielu/Python/cpython/Modules/mathmodule.c:74:21: warning: ‘sqrtpi’ defined but not used [-Wunused-const-variable=] static const double sqrtpi = 1.772453850905516027298167483341145182798; Is used

[issue26440] tarfile._FileInFile.seekable is broken in stream mode

2017-03-29 Thread Louie Lu
Louie Lu added the comment: Actually, _Stream does provide seek method, should the seekable just return True? -- nosy: +louielu ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue28415] PyUnicode_FromFormat integer format handling different from printf about zeropad

2017-03-29 Thread Louie Lu
Louie Lu added the comment: Add a note block under Py*_FromFormat in unicode.rst and bytes.rst. Could Xiang or Terry help to review? Thanks. -- nosy: +louielu ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue28415] PyUnicode_FromFormat integer format handling different from printf about zeropad

2017-03-29 Thread Louie Lu
Changes by Louie Lu <m...@louie.lu>: -- pull_requests: +787 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28415> ___ __

[issue24821] The optimization of string search can cause pessimization

2017-03-29 Thread Louie Lu
Louie Lu added the comment: I can now only test on Python3.6, providing much meaningful sentence, still trying to use perf on cpython master branch. --- $ python -m perf timeit -s 's="一件乒乓事事亏, 不乏串連产業, 万丈一争今为举, 其乎哀哉"*1000' --

[issue29927] Unnecessary code in the c-api/exceptions.c

2017-03-28 Thread Louie Lu
Changes by Louie Lu <m...@louie.lu>: -- pull_requests: +767 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29927> ___ __

[issue29927] Unnecessary code in the c-api/exceptions.c

2017-03-28 Thread Louie Lu
Louie Lu added the comment: It seems somehow the patch at #3295 make the mistake, commit faa54a39295 at 2007-08-19 add the PRE_INIT(BufferError) and POST_INIT(BufferError), but in #3295 `buffererror.patch` didn't saw it. -- nosy: +louielu

[issue29890] Constructor of ipaddress.IPv*Interface does not follow documentation

2017-03-25 Thread Louie Lu
Louie Lu added the comment: Add unittest. Since IPv6 do not support prefix netmask (':ff00::'), it have only test like this: >>> a = ipaddress.ip_interface(('dead:beaf::', '32')) >>> b = ipaddress.ip_interface('dead:beaf::/32') &

[issue29890] Constructor of ipaddress.IPv*Interface does not follow documentation

2017-03-25 Thread Louie Lu
Louie Lu added the comment: Eric: I made the patch, reference to which IPv*Network dealing with tuple. Should I also add the unittest for it? Also, can you help me code review this, thanks. -- ___ Python tracker <rep...@bugs.python.org>

[issue29890] Constructor of ipaddress.IPv*Interface does not follow documentation

2017-03-25 Thread Louie Lu
Changes by Louie Lu <m...@louie.lu>: -- pull_requests: +722 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29890> ___ __

[issue29890] Constructor of ipaddress.IPv*Interface does not follow documentation

2017-03-24 Thread Louie Lu
Louie Lu added the comment: The document here says: https://docs.python.org/3/library/ipaddress.html#interface-objects ""IPv4Interface is a subclass of IPv4Address"" trying with: >>> ipaddress.IPv4Address(('192.168.128.0', '255.255.255.0')) Traceback (most recen

[issue23578] struct.pack error messages do not indicate which argument was invalid

2017-02-25 Thread Louie Lu
Louie Lu added the comment: > 1. Using global variable doesn't look good to me. That's true, but I'm not sure if there have other methods to do this. If not using global variable, we will need to change a bunch of the function arguments. Since the arguments didn't contain the information ab

[issue23578] struct.pack error messages do not indicate which argument was invalid

2017-02-25 Thread Louie Lu
Louie Lu added the comment: Adding PyErr_SetString and PyErr_Format wrapper, with a global offset variable to handle this. struct.pack('!h', 0x8) Traceback (most recent call last): File "tests.py", line 5, in struct.pack('!h', 0x8) struct.error: Raise at offset 1,

[issue23578] struct.pack error messages do not indicate which argument was invalid

2017-02-25 Thread Louie Lu
Changes by Louie Lu <m...@louie.lu>: -- pull_requests: +262 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23578> ___ __

[issue29649] struct.pack_into check boundary error message didn't respect offset

2017-02-25 Thread Louie Lu
New submission from Louie Lu: For this situation, check boundary error message didn't correctly show out. >>> import struct >>> import ctypes >>> byte_list = ctypes.create_string_buffer(1) >>> struct.pack_into('b', byte_list, 5, 1) Traceback (most

[issue29645] webbrowser module import has heavy side effects

2017-02-25 Thread Louie Lu
Louie Lu added the comment: What is the different of Cold start and Hot start? It that CPU speed or something else. In Linux 4.9.11 with i7-2k, I can't reproduce the significant real time you gave: # CPU gov powersave $ time ./python -c 'import webbrowser' 0.16s user 0.02s system 93% cpu

[issue9285] Add a profile decorator to profile and cProfile

2017-02-24 Thread Louie Lu
Changes by Louie Lu <m...@louie.lu>: -- pull_requests: +257 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue9285> ___ __

[issue9285] Add a profile decorator to profile and cProfile

2017-02-24 Thread Louie Lu
Louie Lu added the comment: giampaolo: it seems that contextmanager will somehow make a bad return in `trace_dispatch_return`: $ ./python tests.py # logging.fatal('%r %r' % (frame.f_code.co_name, self.cur[-3])) CRITICAL:root:'runblock' '' ('profile', 0, '') CRITICAL:root:'__enter__

[issue9285] Add a profile decorator to profile and cProfile

2017-02-24 Thread Louie Lu
Louie Lu added the comment: Ping. Is there any reason why this patch doesn't accept? -- nosy: +louielu ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/

[issue29634] Reduce deque repeat execution when maxlen exist and size is not 1

2017-02-23 Thread Louie Lu
Louie Lu added the comment: Raymond: comment has changed, pushed on to GitHub. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue29634] Reduce deque repeat execution when maxlen exist and size is not 1

2017-02-23 Thread Louie Lu
Louie Lu added the comment: Serhiy: yes, your advice is better than checking inside the loop. I have updated this to the commit, thanks! -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue29634] Reduce deque repeat execution when maxlen exist and size is not 1

2017-02-23 Thread Louie Lu
Changes by Louie Lu <m...@louie.lu>: -- pull_requests: +223 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29634> ___ __

[issue29634] Reduce deque repeat execution when maxlen exist and size is not 1

2017-02-23 Thread Louie Lu
New submission from Louie Lu: There is a XXX in v3.5.0 shows that need to dealing with deque maxlen setting case in deque_repeat. Although there have common case for deque size 1 with maxlen, other size of deque with maxlen still using for-loop to extend the deque, without any detection

[issue28121] If module starts with comment or empty line then frame.f_code.co_firstlineno is inconsistent with inspect.findsource

2017-02-23 Thread Louie Lu
Louie Lu added the comment: Sorry, but I can't reproduce at 3.7, 3.5, or 2.7. the result shows me that inspect does respect comment line. ➜ cpython git:(350) ✗ ./python /tmp/main.py 2 (['# First line\n', 'import inspect\n', 'frame = inspect.currentframe()\n', 'print

[issue29630] REPL tab-completion triggers code execution

2017-02-23 Thread Louie Lu
Louie Lu added the comment: Could it be the problem from readline? Using python 2 with readline trigger same behavior. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue29630] REPL tab-completion triggers code execution

2017-02-23 Thread Louie Lu
Louie Lu added the comment: I can reproduce the problem in Python 3.7. -- nosy: +louielu ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

<    1   2   3   4   >