[issue26747] types.InstanceType only for old style class only in 2.7

2016-04-13 Thread Nan Wu
New submission from Nan Wu: >>> import types >>> a = 1 >>> isinstance(a, types.InstanceType) False >>> class A: ... pass ... >>> a = A() >>> isinstance(a, types.InstanceType) True >>> class A(object): ... pass ... >

[issue25755] Test test_property failed if run twice

2015-12-03 Thread Nan Wu
Nan Wu added the comment: Thanks for catching this failure. In the patch, property doc is restore after write operation. -- nosy: +Nan Wu Added file: http://bugs.python.org/file41233/fix_test_property_doc_writable_patch ___ Python tracker <h

[issue25783] test_traceback.test_walk_stack() fails when run directly (without regrtest)

2015-12-03 Thread Nan Wu
Nan Wu added the comment: Put in a fix. Let me know if it looks ok. -- nosy: +Nan Wu Added file: http://bugs.python.org/file41232/fix_test_walk_stack_failed_as_script_patch ___ Python tracker <http://bugs.python.org/issue25

[issue25651] Confusing output for TestCase.subTest(0)

2015-11-21 Thread Nan Wu
Nan Wu added the comment: Made it check against None explicitly. My concern is if [] is passed in, if will show [[]]. But this case should be rare. -- keywords: +patch nosy: +Nan Wu Added file: http://bugs.python.org/file41115/subtest_msg_check_against_None.patch

[issue25609] Add a ContextManager ABC and type

2015-11-12 Thread Nan Wu
Nan Wu added the comment: Hi Brett, I'd like work on this feature. Your description here is clear. Besides that, could you give a use case of this context manager? -- nosy: +Nan Wu ___ Python tracker <http://bugs.python.org/is

[issue25567] shlex.quote doesn't work on bytestrings

2015-11-09 Thread Nan Wu
Nan Wu added the comment: Added a patch for support this in `quote` method. What is a good example or a group of examples to demonstrate the usage in the document? -- keywords: +patch nosy: +Nan Wu Added file: http://bugs.python.org/file40992/shlex_quote_bytes_support.patch

[issue25439] Add type checks to urllib.request.Request

2015-10-31 Thread Nan Wu
Nan Wu added the comment: Martin: Sorry for missing that line. Under https, byte iterable seems has not been supported: >>> r = Request('https://www.python.org', {b'post': 'data'}, >>> {'Content-Length':10}) >>> urlopen(r) ..

[issue25439] Add type checks to urllib.request.Request

2015-10-27 Thread Nan Wu
Nan Wu added the comment: Will fix the other two issues. Thanks. -- ___ Python tracker <http://bugs.python.org/issue25439> ___ ___ Python-bugs-list mailin

[issue25439] Add type checks to urllib.request.Request

2015-10-27 Thread Nan Wu
Nan Wu added the comment: The do_request_() method which is defined in AbstractHTTPHandler seems not cover the check at least for the first case Ezio brought up. `unknown_open` has been called and gives out a relatively confusing message

[issue25439] Add type checks to urllib.request.Request

2015-10-25 Thread Nan Wu
Changes by Nan Wu : Added file: http://bugs.python.org/file40850/urllib_request_param_type_check_3.patch ___ Python tracker <http://bugs.python.org/issue25439> ___ ___

[issue25017] htmllib deprecated: Which library to use? Missing sane default in docs

2015-10-21 Thread Nan Wu
Nan Wu added the comment: Updated the patch. The typo was fixed too. Thanks for the catching. -- Added file: http://bugs.python.org/file40831/htmllib_deprecation_warning_2.patch ___ Python tracker <http://bugs.python.org/issue25

[issue25439] Add type checks to urllib.request.Request

2015-10-20 Thread Nan Wu
Nan Wu added the comment: I see. Empty dict is considered as iterable of bytes makes good sense. I just left the old tests there. And explicitly give warnings when data field is of type str or type dict with non-bytes key. -- Added file: http://bugs.python.org/file40830

[issue25439] Add type checks to urllib.request.Request

2015-10-20 Thread Nan Wu
Nan Wu added the comment: Uploaded a patch. Also update the test. Seems there are at least two old test cases using empty dict as data param. has dict been supported before? -- keywords: +patch nosy: +Nan Wu Added file: http://bugs.python.org/file40819

[issue25017] htmllib deprecated: Which library to use? Missing sane default in docs

2015-10-16 Thread Nan Wu
Nan Wu added the comment: Added a small patched for this change. -- keywords: +patch nosy: +Nan Wu Added file: http://bugs.python.org/file40796/htmllib_deprecation_warning.patch ___ Python tracker <http://bugs.python.org/issue25

[issue25322] contextlib.suppress not tested for nested usage

2015-10-07 Thread Nan Wu
Nan Wu added the comment: Added a patch with Martina's idea. Isn't ignored better set as false instead ? Since interpreter did not ignore it. -- keywords: +patch nosy: +Nan Wu Added file: http://bugs.python.org/file40713/fix_reentrant_cm_

[issue25311] Add f-string support to tokenize.py

2015-10-07 Thread Nan Wu
Nan Wu added the comment: Added 'f'/'F' to the StringPrefix regex and also update the quote dictionary. -- keywords: +patch nosy: +Nan Wu Added file: http://bugs.python.org/file40712/tokenize.patch ___ Python tracker <

[issue24479] Support LMMS project files in mimetypes.guess_type

2015-07-22 Thread Nan Wu
Nan Wu added the comment: Added a small patch. Pls let me know if anything missed. -- nosy: +bytesflow Added file: http://bugs.python.org/file39989/issue24479_support_mmp_and_mmpz_suffix_in_guess_type ___ Python tracker <http://bugs.python.