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
Changes by Louie Lu <m...@louie.lu>:
--
pull_requests: +1474
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26143>
___
__
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
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
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
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
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
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
Changes by Louie Lu <m...@louie.lu>:
--
pull_requests: +1449
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24263>
___
__
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
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?
-
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
Changes by Louie Lu <m...@louie.lu>:
--
pull_requests: +1399
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28698>
___
__
Changes by Louie Lu <m...@louie.lu>:
--
pull_requests: +1398
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28698>
___
__
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
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
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
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
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"
"""
--
__
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
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
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
Changes by Louie Lu <m...@louie.lu>:
--
type: -> behavior
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30163>
___
___
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
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
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
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
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
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
Changes by Louie Lu <m...@louie.lu>:
--
pull_requests: +1368
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30113>
___
__
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
Changes by Louie Lu <m...@louie.lu>:
--
pull_requests: +1367
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue18576>
___
__
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
Changes by Louie Lu <m...@louie.lu>:
--
pull_requests: +1350
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30118>
___
__
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>
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
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
Changes by Louie Lu <m...@louie.lu>:
--
pull_requests: +1335
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue9285>
___
__
Changes by Louie Lu <m...@louie.lu>:
--
pull_requests: +1334
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30113>
___
__
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
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,
Changes by Louie Lu <m...@louie.lu>:
--
pull_requests: +1332
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue21150>
___
__
Changes by Louie Lu <m...@louie.lu>:
--
nosy: +louielu
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue21150>
___
___
Python
Changes by Louie Lu <m...@louie.lu>:
--
pull_requests: +1306
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30078>
___
__
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
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
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
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
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?
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
Changes by Louie Lu <m...@louie.lu>:
--
pull_requests: +1300
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue14102>
___
__
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.
Changes by Louie Lu <m...@louie.lu>:
--
components: +Build -Interpreter Core
type: compile error ->
___
Python tracker <rep...@bugs.python.org>
<http://bugs.pyt
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
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.
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
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
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
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
Changes by Louie Lu <m...@louie.lu>:
--
pull_requests: +1289
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28698>
___
__
Changes by Louie Lu <m...@louie.lu>:
--
pull_requests: +1288
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue19184>
___
__
Changes by Louie Lu <m...@louie.lu>:
--
nosy: +louielu
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25794>
___
___
Python
Changes by Louie Lu <m...@louie.lu>:
--
nosy: +louielu
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29881>
___
___
Python
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
Changes by Louie Lu <m...@louie.lu>:
--
versions: +Python 3.7
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24076>
___
__
Changes by Louie Lu <m...@louie.lu>:
--
pull_requests: +1221
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25828>
___
__
Changes by Louie Lu <m...@louie.lu>:
--
versions: +Python 3.7
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25828>
___
__
Changes by Louie Lu <m...@louie.lu>:
--
pull_requests: +1184
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30013>
___
__
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
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
Changes by Louie Lu <m...@louie.lu>:
--
nosy: +louielu
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29446>
___
___
Python
Changes by Louie Lu <m...@louie.lu>:
--
pull_requests: +1170
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29981>
___
__
Changes by Louie Lu <m...@louie.lu>:
--
nosy: +louielu
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29981>
___
___
Python
Changes by Louie Lu <m...@louie.lu>:
--
pull_requests: +808
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29946>
___
__
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
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
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
Changes by Louie Lu <m...@louie.lu>:
--
pull_requests: +787
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28415>
___
__
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' --
Changes by Louie Lu <m...@louie.lu>:
--
pull_requests: +767
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29927>
___
__
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
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')
&
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>
Changes by Louie Lu <m...@louie.lu>:
--
pull_requests: +722
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29890>
___
__
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
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
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,
Changes by Louie Lu <m...@louie.lu>:
--
pull_requests: +262
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue23578>
___
__
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
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
Changes by Louie Lu <m...@louie.lu>:
--
pull_requests: +257
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue9285>
___
__
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__
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/
Louie Lu added the comment:
Raymond: comment has changed, pushed on to GitHub.
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
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
Changes by Louie Lu <m...@louie.lu>:
--
pull_requests: +223
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29634>
___
__
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
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
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
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
201 - 300 of 301 matches
Mail list logo