[issue38608] Undocumented behavior that IsolatedAsyncioTestCase would enable event loop debug mode

2019-11-05 Thread Wei-Cheng Pan
Wei-Cheng Pan added the comment: I cannot import asyncio.task, so I did this instead: import asyncio.tasks asyncio.tasks.Task = asyncio.tasks._PyTask Then it changed to this: Executing wait_for= created at /.../lib/python3.8/unittest/async_case.py:118> took 0.187 seconds I supp

[issue38608] Undocumented behavior that IsolatedAsyncioTestCase would enable event loop debug mode

2019-11-05 Thread Wei-Cheng Pan
Wei-Cheng Pan added the comment: Executing () created at /.../lib/python3.8/asyncio/queues.py:70> took 0.104 seconds Executing () created at /.../lib/python3.8/asyncio/queues.py:70> took 0.121 seconds I was expecting it can display the stack of the awa

[issue38608] Undocumented behavior that IsolatedAsyncioTestCase would enable event loop debug mode

2019-10-28 Thread Wei-Cheng Pan
Wei-Cheng Pan added the comment: > Usually, it is a sign of a problem in user code, e.g. something should be > pushed into executor. Sometimes also happens on low-end CI machines. And the message is somewhat unclear to me. I have to grep cpython sources to understand that it is comin

[issue38608] Undocumented behavior that IsolatedAsyncioTestCase would enable event loop debug mode

2019-10-27 Thread Wei-Cheng Pan
New submission from Wei-Cheng Pan : In bpo-32972 we enabled debug mode in IsolatedAsyncioTestCase._setupAsyncioLoop, which may print some warnings that are not that important to tests. (e.g. Executing took 0.110 seconds) I personally don't really like it being turn on by default

[issue30698] asyncio sslproto do not shutdown ssl layer cleanly

2018-10-15 Thread Wei-Cheng Pan
Wei-Cheng Pan added the comment: The SSL connection still cannot close cleanly in 3.7.0. It will keep throwing read error during shutdown, so shutdown callback will never be called. I've been test this PR for a while, and at least it fixes my problem. Hope this PR can be included in 3.7.1

[issue30378] SysLogHandler does not support IPv6 destinations

2017-05-16 Thread Calvin Cheng
Changes by Calvin Cheng <calvin.cheng...@gmail.com>: -- nosy: +calcheng -Calvin Cheng ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue30378] SysLogHandler does not support IPv6 destinations

2017-05-16 Thread Calvin Cheng
Changes by Calvin Cheng <calvin.cheng...@gmail.com>: -- nosy: +Calvin Cheng -calcheng ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue30378] SysLogHandler does not support IPv6 destinations

2017-05-16 Thread Calvin Cheng
New submission from Calvin Cheng: The attached test script works fine with IPv4 syslog: $ python test_syslog.py 192.168.1.4 (no errors reported) When running the attached script with python 3.5.2 on Ubuntu 16.04, received the following error: $ python3 test_syslog.py ::1 --- Logging error

[issue27413] Add an option to json.tool to bypass non-ASCII characters.

2016-08-28 Thread Wei-Cheng Pan
Wei-Cheng Pan added the comment: 1. Replaced non-ASCII literals to \u 2. Removed failed assertion Test passed with LC_ALL=en_US and LC_ALL=en_US.UTF-8 . I've tried to use locale.getdefaultlocale(), but seems the output string will vary in different locales. -- Added file: https

[issue27413] Add an option to json.tool to bypass non-ASCII characters.

2016-08-28 Thread Wei-Cheng Pan
Changes by Wei-Cheng Pan <legnale...@gmail.com>: Removed file: https://bugs.python.org/file44243/json-add-an-option-to-bypass-non-ascii-characters-v3.patch ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue27413] Add an option to json.tool to bypass non-ASCII characters.

2016-08-27 Thread Wei-Cheng Pan
Changes by Wei-Cheng Pan <legnale...@gmail.com>: Removed file: https://bugs.python.org/file43596/json-add-an-option-to-bypass-non-ascii-characters.patch ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue27413] Add an option to json.tool to bypass non-ASCII characters.

2016-08-27 Thread Wei-Cheng Pan
Wei-Cheng Pan added the comment: Added doc and test. -- Added file: https://bugs.python.org/file44243/json-add-an-option-to-bypass-non-ascii-characters-v3.patch ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/i

[issue27413] Add an option to json.tool to bypass non-ASCII characters.

2016-07-01 Thread Wei-Cheng Pan
Wei-Cheng Pan added the comment: > The patch needs tests and documentation. Ok, I'll update it later. >> +parser.add_argument('--no-ensure-ascii', action='store_true', >> default=False, >I'd go with ``action='store_false', default=True``. If I'm not misre

[issue27413] Add an option to json.tool to bypass non-ASCII characters.

2016-06-30 Thread Wei-Cheng Pan
Wei-Cheng Pan added the comment: Use "--no-ensure-ascii" instead. -- Added file: http://bugs.python.org/file43596/json-add-an-option-to-bypass-non-ascii-characters.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.py

[issue27413] Add an option to json.tool to bypass non-ASCII characters.

2016-06-30 Thread Wei-Cheng Pan
Changes by Wei-Cheng Pan <legnale...@gmail.com>: Removed file: http://bugs.python.org/file43578/json-add-an-option-to-bypass-non-ascii-characters.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue27413] Add an option to json.tool to bypass non-ASCII characters.

2016-06-29 Thread Wei-Cheng Pan
Wei-Cheng Pan added the comment: If the arguments should be aligned with those in dump/load, then maybe "--no-ensure-ascii" is an option? -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.py

[issue27413] Add an option to json.tool to bypass non-ASCII characters.

2016-06-29 Thread Wei-Cheng Pan
New submission from Wei-Cheng Pan: This patch adds a command line option "--no-escape" that allows json.tool to display non-ASCII characters. e.g.: $ echo '"測試"' | python -m json.tool "\u6e2c\u8a66" $ echo '"測試"' | python -m json.tool --no-escape &

[issue17678] DeprecationWarning fix on cookiejar module since Python 3.3

2013-04-09 Thread Wei-Cheng Pan
Changes by Wei-Cheng Pan legnale...@gmail.com: -- components: Library (Lib) files: cookiejar_fix_deprecated_method_calls.patch keywords: patch nosy: Wei-Cheng.Pan priority: normal severity: normal status: open title: DeprecationWarning fix on cookiejar module since Python 3.3 versions

[issue17678] DeprecationWarning fix on cookiejar module since Python 3.3

2013-04-09 Thread Wei-Cheng Pan
New submission from Wei-Cheng Pan: Please ignore previous typo patch. This is the correct version -- Added file: http://bugs.python.org/file29753/cookiejar_fix_deprecated_method_calls.patch ___ Python tracker rep...@bugs.python.org http

[issue17678] DeprecationWarning fix on cookiejar module since Python 3.3

2013-04-09 Thread Wei-Cheng Pan
Changes by Wei-Cheng Pan legnale...@gmail.com: Removed file: http://bugs.python.org/file29752/cookiejar_fix_deprecated_method_calls.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17678

Re: A difficulty with lists

2012-08-20 Thread Cheng
On Monday, August 6, 2012 12:50:13 PM UTC-7, Mok-Kong Shen wrote: I ran the following code: def xx(nlist): print(begin: ,nlist) nlist+=[999] print(middle:,nlist) nlist=nlist[:-1] print(final: ,nlist) u=[1,2,3,4] print(u) xx(u) print(u)

when to use import statements in the header, when to use import statements in the blocks where they are used?

2012-02-07 Thread Lei Cheng
Hi all, In a py file, when to use import statements in the header, when to use import statements in the blocks where they are used? What are the best practices? Thanks! Pat -- http://mail.python.org/mailman/listinfo/python-list

[issue4625] IDLE won't open anymore, .idlerc unaccessible

2011-12-14 Thread Sophia K. Cheng
Sophia K. Cheng sophia.ch...@gmail.com added the comment: Hi Ned, Thanks for the patch, I appreciate it. Sadly, I've since upgraded my laptop to Win 7, and don't seem to be having the problem anymore :-/ , so I can't verify. But thank you for writing a patch. Sincerely, Sophia On Wed, Dec

Re:Re: Where can I find a lexical spec of python?

2011-09-21 Thread Shaofei Cheng
Yes, I'm using this document now but I was wondering if there is a formal spec for lexical grammar? It looks like some part of the doc http://docs.python.org/py3k/reference/grammar.html; is missing. We can find some replacement in lexical_analysis.html but it seems this document is write for

[issue10817] urllib.request.urlretrieve never raises ContentTooShortError if no reporthook

2011-01-03 Thread Robert Cheng
New submission from Robert Cheng robert.h.ch...@gmail.com: When reporthook is None, size variable is not computed and defaulted to -1. Thus, without reporthook, ContentTooShortError is not raised even when Content-Length header is supplied and download size is less than expected amount

Unable to decode file written by C++ wostringstream

2010-12-23 Thread Yan Cheng CHEOK
Cheng CHEOK -- http://mail.python.org/mailman/listinfo/python-list

Re: Bit fields in python?

2010-09-08 Thread Kwan Lai Cheng
Thanks everyone for all the suggestions! New to python, so reading up on the struct module Construct library now, hope to get my problem fixed soon. - Original Message - Bitfields are most commonly used for extreme space optimization - i.e. shoving several variables and flags with

Re: Bit fields in python?

2010-09-07 Thread Kwan Lai Cheng
- Original Message - From: Stefan Behnel To: python-list@python.org Sent: Tuesday, September 07, 2010 2:55 PM Subject: Re: Bit fields in python? If you can tell us what these structs are being used for in the original C code, we might be able to point you to a suitable way to

Bit fields in python?

2010-09-06 Thread Kwan Lai Cheng
Hi, I'm trying to rewrite a c program in python encountered several problems. I have some data structures in my c program like below: typedef struct { unsigned short size; unsigned short reserved:8; unsigned short var_a1:2; unsigned short var_a2:2; unsigned short var_a3:2;

[issue7075] Bug while put a set on a dict

2009-10-06 Thread Chu-Cheng
New submission from Chu-Cheng chuch...@gmail.com: x={1:{1}} x[1] = (x.get(1).add(2)) x {1: None} But... x={1:{1}} o = x.get(1) o.add(2) o {1, 2} x[1] = o x {1: {1, 2}} -- components: None messages: 93674 nosy: chucheng severity: normal status: open title: Bug while put a set

[issue7075] Bug while put a set on a dict

2009-10-06 Thread Chu-Cheng
Chu-Cheng chuch...@gmail.com added the comment: my fault, I know what is the difference now :) sorry for bugging -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7075

[issue4625] IDLE won't open anymore, .idlerc unaccessible

2009-08-25 Thread Sophia K. Cheng
Sophia K. Cheng sophia.ch...@gmail.com added the comment: Thanks!! This worked perfectly! Finally got around to trying this out today. Sincerely, Sophia On 3/20/09 4:26 AM, Timothy Zhang rep...@bugs.python.org wrote: Timothy Zhang z...@live.cn added the comment: I meet the same

automatic multiprocessing

2009-07-07 Thread Cheng Soon Ong
: cur_out = function_handle(**kwargs) function_outputs.append(cur_out) Am I missing something here? I cannot seem to get map to pass on keyword arguments. Thanks in advance, Cheng Soon -- http://mail.python.org/mailman/listinfo/python-list

[issue4625] IDLE won't open anymore, .idlerc unaccessible

2008-12-10 Thread Sophia K. Cheng
New submission from Sophia K. Cheng [EMAIL PROTECTED]: Hello, I was able to run IDLE once or twice on my laptop. Then I downloaded kiki and tried to run it but had forgotten to install wxPython. After that, IDLE no longer opens although the command prompt does still work. I get the following

Getting Python to run Python Scripts in cygwin

2008-06-19 Thread Calvin Cheng
Hi guys, This may be a cygwin issue but I was hoping to get some answers here as well if someone has fixed this problem before. Basically, I am able to run python scriptname.py python files in command prompt. Unfortunately, I can't seem to get it to work in cygwin. I always get an error that

Docutils rst2html.py gives Error/3 Unknown Directive type toctree

2008-06-19 Thread Calvin Cheng
Hi, I am attempting to convert a bunch of .txt files into html using the docutils package. It works for most of the txt files except for the index.txt file which gives 2 errors: (1) Error/3 Unknown Directive type toctree (2) (ERROR/3) Unknown interpreted text role ref. Any idea how I can fix

need help of RE

2005-05-29 Thread cheng
hi all a string like (word1 (Word2|woRd3)) how can i use the re to split it to ['word1', 'word2', 'word3'] -- http://mail.python.org/mailman/listinfo/python-list

Re: need help of RE

2005-05-29 Thread cheng
im sorry, my engilsh is not vell well, the string not only contain '' and '|' and it can be anyting i just want to split out the whole word inside the string -- http://mail.python.org/mailman/listinfo/python-list

Re: need help of RE

2005-05-29 Thread cheng
i try query = query.lower() print re.split(r'\W+',theString) the reslut is : ['', 'word1', 'word2', 'word3', ''] how can i fix the statment to get ['word1', 'word2', 'word3'] -- http://mail.python.org/mailman/listinfo/python-list

Re: need help of RE

2005-05-29 Thread cheng
i try theString= theString.lower() print re.split(r'\W+',theString) the reslut is : ['', 'word1', 'word2', 'word3', ''] how can i fix the statment to get ['word1', 'word2', 'word3'] -- http://mail.python.org/mailman/listinfo/python-list

Re: need help of RE

2005-05-29 Thread cheng
thx for help..i got it now :) -- http://mail.python.org/mailman/listinfo/python-list

a re problem

2005-05-28 Thread cheng
hi,all, i try to replace every target word found in the text for target in splitText: if stopwords.find(target) = 0 : text = re.sub(r'\b%s\b','',text) target when i using the statment: text = re.sub(r'\b%s\b','',text) target get error : unsupported operand type(s) for :

a dict problem

2005-05-28 Thread cheng
hi all..it a problem about dict: print target, dict[target] get output: keyword {page3.html, page2.html, page1.html} is it some ways to change it to: keyword {page1.html, page2.html, page3.html} -- http://mail.python.org/mailman/listinfo/python-list

a html parse problem

2005-05-27 Thread cheng
hi,all if the html like: meta name = description content = a test page meta name = keywords content = keyword1 keyword2 if i use: def handle_starttag(self, tag, attrs): if tag == 'meta': self.attr = attrs self.headers += ['%s' % (self.attr)] self.attr =

a re problem

2005-05-20 Thread cheng
p.sub('','a\nbc') 'abc' p.sub('','%s') % a\nbc 'a\nbc' is it anyone got some idea why it happen? -- http://mail.python.org/mailman/listinfo/python-list

Re: a re problem

2005-05-20 Thread cheng
thx for help :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Web forum (made by python)

2004-12-19 Thread Choe, Cheng-Dae
-list -- Choe, Cheng-Dae() Blog: http://www.comdongin.com/ -- http://mail.python.org/mailman/listinfo/python-list