[issue24073] sys.stdin.mode can not give the right mode and os.fdopen does not check argument

2015-04-29 Thread Xiang Zhang
Xiang Zhang added the comment: Thanks for your reply Ned and it does solve my puzzle. It's my fault to misunderstand the attribute and make noise here. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24073

[issue24073] sys.stdin.mode can not give the right mode and os.fdopen does not check argument

2015-04-28 Thread Xiang Zhang
New submission from Xiang Zhang: The problem is what the title tells and can be produced by the snippet below. import sys import os sys.stdout.write(%s\n % sys.stdin.mode) sys.stdout.flush() f = os.fdopen(sys.stdin.fileno(), r) f.write() f.flush() f.read() f.close() When running

[issue25363] x=[1,2,3].append([1,2,3]) bug

2015-10-10 Thread Xiang Zhang
Xiang Zhang added the comment: This is the right behaviour. x=[1, 2, 3].append([1, 2, 3]) acts as: x=([1, 2, 3].append([1, 2, 3]) Since append is a in-place operation it return None. Then x is None. -- nosy: +xiang.zhang ___ Python tracker

[issue25381] Use old description of raise in Python3

2015-10-12 Thread Xiang Zhang
New submission from Xiang Zhang: In the first paragraph of https://docs.python.org/3/extending/extending.html#intermezzo-errors-and-exceptions, it is wrong to use the sentence "the second argument to raise" since the raise syntax has been changed in Python3. -- assignee: d

[issue25381] Doc: Use of old description of raise in Python3

2015-10-12 Thread Xiang Zhang
Xiang Zhang added the comment: With this sentence A second global variable stores the “associated value” of the exception (the second argument to raise). I think the phrase inside the parentheses is to explain the "associated value", which is usually a string passed to the except

[issue25381] Doc: Use of old description of raise in Python3

2015-10-12 Thread Xiang Zhang
Xiang Zhang added the comment: Oops, I misunderstand sys.exc_info all the time, sad :( Now, both versions of doc are not correct. Please make them fixed. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue25390] Can't define a typing.Union containing a typing.re.Pattern

2015-10-13 Thread Xiang Zhang
Changes by Xiang Zhang <18518281...@126.com>: -- nosy: +xiang.zhang ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25390> ___ _

[issue25381] Doc: Use of old description of raise in Python3

2015-10-13 Thread Xiang Zhang
Xiang Zhang added the comment: Actually what I intend is that the exception object passed to raise is the exception instance raise finally throws (what is stored in the second variable). So it seems wise not to do any more for me. A single sentence has lead to confusion, not to mention more

[issue25328] ValueError in smtpd.py __init__() is not raised

2015-10-09 Thread Xiang Zhang
Xiang Zhang added the comment: I think this is a typo. The raise is left out. In test_smtpd.py, it only tests the raise condition in SMTPServer but not STMPChannel. I add the raise and a corresponding test in SMTPDChannelTest. -- keywords: +patch nosy: +xiang.zhang Added file: http

[issue25341] File mode wb+ appears as rb+

2015-10-10 Thread Xiang Zhang
Xiang Zhang added the comment: I think Mark is right. Since wb+ and rb+ have different behaviours they should be treat separately. But this behaviour treating wb+ and rb+ as the same is well tested and seems to intended to do so. -- nosy: +xiang.zhang

[issue25341] File mode wb+ appears as rb+

2015-10-10 Thread Xiang Zhang
Changes by Xiang Zhang <18518281...@126.com>: -- keywords: +patch Added file: http://bugs.python.org/file40739/file_mode.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue25341] File mode wb+ appears as rb+

2015-10-10 Thread Xiang Zhang
Xiang Zhang added the comment: I make a patch which now identifies the difference between wb+ and rb+, and modifies the corresponding tests. Though I don't know whether this need to be fixed. -- ___ Python tracker <rep...@bugs.python.org>

[issue24402] input() uses sys.__stdout__ instead of sys.stdout for prompt

2015-10-09 Thread Xiang Zhang
Xiang Zhang added the comment: It's my fault. I forget to recompile. Now it works. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue24402] input() uses sys.__stdout__ instead of sys.stdout for prompt

2015-10-09 Thread Xiang Zhang
Xiang Zhang added the comment: This test also fails on Ubuntu. [1/1] test_builtin test test_builtin failed -- Traceback (most recent call last): File "/home/angwer/my-cpython/Lib/test/test_builtin.py", line 1588, in test_input_no_stdout_fileno self.assertEqual(status,

[issue25381] Doc: Use of old description of raise in Python3

2015-10-12 Thread Xiang Zhang
Xiang Zhang added the comment: I fix my patch with David's comment. -- Added file: http://bugs.python.org/file40766/doc_extending2.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue25381] Doc: Use of old description of raise in Python3

2015-10-12 Thread Xiang Zhang
Xiang Zhang added the comment: Yes, you are right martin. It seems the whole chapter needs more updates, not only the bits I mentioned. I won't provide a new patch since I am not an English native and I am not sure I can provide an accurate and right description. Hope someone else may help

[issue25258] HtmlParser doesn't handle void element tags correctly

2015-09-28 Thread Xiang Zhang
Xiang Zhang added the comment: >From the specification, void element has no end tag, so I think this behaviour can not be called incorrect. For void element, only handle_starttag is called. And for start tag ends with '/>', actually HTMLParser calls handle_startendtag, which i

[issue25288] readline.py file in current directory caused unexpected code execution.

2015-10-01 Thread Xiang Zhang
Xiang Zhang added the comment: I can reproduce this action on Ubuntu. The forged readline.py in python's execution directory can steal the permission of python and do something dangerous. -- nosy: +xiang.zhang ___ Python tracker <

[issue24657] CGIHTTPServer module discard continuous '/' letters from params given by GET method.

2015-10-02 Thread Xiang Zhang
Xiang Zhang added the comment: Yes, there seems to still exist some defects not conforming to the specification. I would like to investigate it. Maybe I can propose a patch for it. -- ___ Python tracker <rep...@bugs.python.org>

[issue25253] AttributeError: 'Weather' object has no attribute 'dom'

2015-09-28 Thread Xiang Zhang
Xiang Zhang added the comment: I don't think this is a bug of Python. You should check your own application to make sure you are parsing the right XML. I run your code with the old uri and get the same traceback. The cause is you are using xml parser to parse a html document which is error

[issue25232] CGIRequestHandler behave incorrectly with query component consisting mutliple ?

2015-09-25 Thread Xiang Zhang
New submission from Xiang Zhang: According to rfc3986, section 3.4: The query component is indicated by the first question mark ("?") character and terminated by a number sign ("#") character or by the end of the URI. The characters slash ("/") and question

[issue25232] CGIRequestHandler behave incorrectly with query component consisting mutliple ?

2015-09-25 Thread Xiang Zhang
Changes by Xiang Zhang <18518281...@126.com>: -- type: -> behavior versions: +Python 3.6 ___ Python tracker <rep...@bugs.python.org> <http://bugs.pyt

[issue24657] CGIHTTPServer module discard continuous '/' letters from params given by GET method.

2015-09-25 Thread Xiang Zhang
Xiang Zhang added the comment: The path with query component are unquoted entirely and then pass into _url_collapse_path. I think this behaviour is wrong and according to rfc3875 query component should be left encoded in QUERY_STRING. This patch seems to solve the problem. It passes the tests

[issue25232] CGIRequestHandler behave incorrectly with query component consisting mutliple ?

2015-09-25 Thread Xiang Zhang
Xiang Zhang added the comment: I add a testcase but I worry it's not in the right format. Please review it. Partition is a good choice here. -- Added file: http://bugs.python.org/file40584/multiple?.patch ___ Python tracker <rep...@bugs.python.

[issue24657] CGIHTTPServer module discard continuous '/' letters from params given by GET method.

2015-09-25 Thread Xiang Zhang
Xiang Zhang added the comment: Add the testcase and use str.partition. -- Added file: http://bugs.python.org/file40585/cgihander.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue24657] CGIHTTPServer module discard continuous '/' letters from params given by GET method.

2015-09-23 Thread Xiang Zhang
Xiang Zhang added the comment: I think this is a bug. According to the rfcs, "/" is a reserved character in query component and continuous "/" in query component may be invalid and how to deal with it depends on the server. But encoded "/", %2F, acts as

[issue25652] collections.UserString.__rmod__() raises NameError

2015-11-17 Thread Xiang Zhang
Xiang Zhang added the comment: Quite sorry for making some mistakes. unicodeobject does get a __radd__ method. It is added by addoperators though I cannot see it in PyNumberMethods. Now I think just fixing the typo is enough. -- Added file: http://bugs.python.org/file41066

[issue25659] ctypes.Array.from_buffer segmentation fault when trying to create from array.array

2015-11-18 Thread Xiang Zhang
Changes by Xiang Zhang <18518281...@126.com>: -- nosy: +xiang.zhang ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25659> ___ _

[issue25652] collections.UserString.__rmod__() raises NameError

2015-11-17 Thread Xiang Zhang
Xiang Zhang added the comment: It seems this is a typo. The args should be self.data. And since unicodeobject doesn't support __rmod__, at least I think we should str(format) or remove __rmod__ totally. I attach a patch. -- nosy: +xiang.zhang Added file: http://bugs.python.org

[issue26915] Test identity first in membership operation of ItemsView, ValuesView and Sequence in collections.abc

2016-06-03 Thread Xiang Zhang
Xiang Zhang added the comment: Serhiy, actually the patch(issue26915_s2.patch) I uploaded early has tried to make Sequence.index and Sequence.count consistent. Maybe the issue stage is not right. -- ___ Python tracker <rep...@bugs.python.org>

[issue27130] zlib: OverflowError while trying to compress 2^32 bytes or more

2016-06-02 Thread Xiang Zhang
Xiang Zhang added the comment: I'd like to help but it'll need some time. And I'd like to start after issue27164 is solved. zdict now also checks for 4GB limit. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue27164] zlib can't decompress DEFLATE using shared dictionary

2016-06-05 Thread Xiang Zhang
Xiang Zhang added the comment: It looks good. I don't think that is a matter since usually I will do a search before change. But of course extracting them to a subroutine helps. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.p

[issue27225] Potential refleak in type_new when setting __new__ fails

2016-06-04 Thread Xiang Zhang
New submission from Xiang Zhang: As the title, there seems to be a potential refleak in type_new when setting __new__ fails. -- files: refleak_in_type_new.patch keywords: patch messages: 267382 nosy: xiang.zhang priority: normal severity: normal status: open title: Potential refleak

[issue26985] Information about CodeType in inspect documentation is outdated

2016-06-09 Thread Xiang Zhang
Xiang Zhang added the comment: So maybe remove the docstring entirely? -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26985> ___ __

[issue27247] telnetlib AttributeError: 'error' object has no attribute 'errno' (handling of select.error)

2016-06-07 Thread Xiang Zhang
Xiang Zhang added the comment: In py2, select.error is a stand alone exception while in py3 it's an alias of OSError. This difference seems not noticed when introduced in 872afada51b0. -- nosy: +gregory.p.smith, xiang.zhang ___ Python tracker <

[issue27248] Possible refleaks in PyType_Ready in error condition

2016-06-07 Thread Xiang Zhang
New submission from Xiang Zhang: As the title, in add_* used in PyType_Ready, the reference counts are not decreased when adding them to dict fails. -- files: refleak_in_pytype_ready.patch keywords: patch messages: 267607 nosy: serhiy.storchaka, xiang.zhang priority: normal severity

[issue27235] Heap overflow occurred due to the int overflow (Python-2.7.11/Modules/posixmodule.c)

2016-06-06 Thread Xiang Zhang
Changes by Xiang Zhang <angwe...@126.com>: -- nosy: +xiang.zhang ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27235> ___ __

[issue27235] Heap overflow occurred due to the int overflow (Python-2.7.11/Modules/posixmodule.c)

2016-06-06 Thread Xiang Zhang
Xiang Zhang added the comment: I am confused why this could happen. On x86 platform, you can not even create a string of size 0x. On x64 platform, I don't think strlen(s) + 3 can lead to overflow where s is of size Py_ssize_t. -- ___ Python

[issue27261] io.BytesIO.truncate does not work as advertised

2016-06-07 Thread Xiang Zhang
Changes by Xiang Zhang <angwe...@126.com>: -- nosy: +alexandre.vassalotti, serhiy.storchaka ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue27261] io.BytesIO.truncate does not work as advertised

2016-06-07 Thread Xiang Zhang
Xiang Zhang added the comment: Is this a bug or a documentation matter? Inspecting BytesIO.truncate's code, it does resizing similar to list, this seems to be a designed feature, which conflicts with the documented behaviour. -- nosy: +xiang.zhang

[issue27275] KeyError thrown by optimised collections.OrderedDict.popitem()

2016-06-10 Thread Xiang Zhang
Xiang Zhang added the comment: Raymond, In single threaded case popitem may still fail. I want to correct my last message that popitem does not fail in this case because it calls __getitem__ but instead it calls __contains__[1]. In __contains__ it deletes the item since it expires

[issue26915] Test identity first in membership operation of ItemsView, ValuesView and Sequence in collections.abc

2016-06-04 Thread Xiang Zhang
Xiang Zhang added the comment: Thanks for review Serhiy and nice thoughts. I make the class inherited directly from Sequence. So if the methods in Sequence are OK, the test class is OK. -- Added file: http://bugs.python.org/file43189/issue26915_v3.patch

[issue26915] Test identity first in membership operation of ItemsView, ValuesView and Sequence in collections.abc

2016-06-04 Thread Xiang Zhang
Xiang Zhang added the comment: Oh, sorry. Make the __len__ signature wrong. Change it. -- Added file: http://bugs.python.org/file43190/issue26915_v4.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue27215] Docstrings of Sequence and MutableSequence seems not right

2016-06-04 Thread Xiang Zhang
New submission from Xiang Zhang: Docstrings of Sequence and MutableSequence in collections.abc says "Concrete subclasses must provide __new__ and __init__". This seems not the truth. Not providing __new__ and __init__ is also OK. -- messages: 267249 nosy: rhettinger, x

[issue27118] Several Py_XDECREFs in typeobject.c are not necessary

2016-05-25 Thread Xiang Zhang
Changes by Xiang Zhang <angwe...@126.com>: -- title: Several Py_XDECREFs are not necessary -> Several Py_XDECREFs in typeobject.c are not necessary type: -> enhancement versions: +Python 3.6 ___ Python tracker <rep...@bugs.py

[issue27118] Several Py_XDECREFs are not necessary

2016-05-25 Thread Xiang Zhang
New submission from Xiang Zhang: Several Py_XDECREFs are not necessary since the pointers they handle cannot be NULL. -- files: Py_XDECREF_in_typeobject.diff keywords: patch messages: 266307 nosy: xiang.zhang priority: normal severity: normal status: open title: Several Py_XDECREFs

[issue27118] Several Py_XDE/INCREFs in typeobject.c are not necessary

2016-05-25 Thread Xiang Zhang
Changes by Xiang Zhang <angwe...@126.com>: -- title: Several Py_XDECREFs in typeobject.c are not necessary -> Several Py_XDE/INCREFs in typeobject.c are not necessary ___ Python tracker <rep...@bugs.python.org> <http://bugs.pyt

[issue26816] Make concurrent.futures.Executor an abc

2016-05-26 Thread Xiang Zhang
Changes by Xiang Zhang <angwe...@126.com>: -- resolution: -> wont fix status: open -> closed ___ Python tracker <rep...@bugs.python.org> <http://bugs.

[issue27130] zlib: OverflowError while trying to compress 2^32 bytes or more

2016-05-26 Thread Xiang Zhang
Changes by Xiang Zhang <angwe...@126.com>: -- nosy: +martin.panter ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27130> ___ _

[issue27275] KeyError thrown by optimised collections.OrderedDict.popitem()

2016-06-10 Thread Xiang Zhang
Xiang Zhang added the comment: I think your expiringdict seems not work with the C version OrderedDict, you may need to change your implementation or clarify that :(. The C version's OrderedDict.popitem may call your __getitem__ which then does deletion and emit KeyError when expires. I think

[issue27299] urllib does not splitport while putrequest realhost to HTTP headers

2016-06-11 Thread Xiang Zhang
Xiang Zhang added the comment: The standard[1] says the Host header is OK to include port. Why not use 'https://www.github.com'? [1] https://tools.ietf.org/html/rfc7230#section-5.4 -- nosy: +xiang.zhang ___ Python tracker <rep...@bugs.python.

[issue27299] urllib does not splitport while putrequest realhost to HTTP headers

2016-06-12 Thread Xiang Zhang
Xiang Zhang added the comment: It's server side behaviour. Asking here may not get results. I think it's normal for the server to return error if it thinks the header is invalid. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.p

[issue27130] zlib: OverflowError while trying to compress 2^32 bytes or more

2016-06-14 Thread Xiang Zhang
Xiang Zhang added the comment: Hello Martin. I've finished a patch to add 64bit support to zlib. I think it solves the 9 problems you mentioned and let the input and output both be larger than UINT_MAX. Hope you are willing to review and we can move this forward. :) -- keywords

[issue27177] re match.group should support __index__

2016-06-15 Thread Xiang Zhang
Xiang Zhang added the comment: Attach a patch to add this feature to Py3.6. -- nosy: +xiang.zhang Added file: http://bugs.python.org/file43396/issue27177.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue7769] SimpleXMLRPCServer.SimpleXMLRPCServer.register_function as decorator

2016-06-15 Thread Xiang Zhang
Changes by Xiang Zhang <angwe...@126.com>: -- nosy: +xiang.zhang ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue7769> ___ __

[issue7769] SimpleXMLRPCServer.SimpleXMLRPCServer.register_function as decorator

2016-06-15 Thread Xiang Zhang
Xiang Zhang added the comment: Hi, I've written a patch to accomplish this in Py3.6. This patch is much cleaner but has one drawback, when used as decorator factory, you have to specify name as a keyword argument. But considering the codes that have to been imported to check arguments, I

[issue26867] test_ssl test_options fails on ubuntu 16.04

2016-06-05 Thread Xiang Zhang
Xiang Zhang added the comment: @skip_if_broken_ubuntu_ssl doesn't work in this case. `hasattr(ssl, 'PROTOCOL_SSLv2')` returns False. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue5996] abstract class instantiable when subclassing dict

2016-05-30 Thread Xiang Zhang
Xiang Zhang added the comment: I think subclassing builtin types and making it abstract is rare. And when there is a need, we can mimic this in application level (this may also apply to types having custom __new__): In [2]: class CustomDict(dict, metaclass=abc.ABCMeta): ...: def

[issue27137] functools.partial: Inconsistency between Python and C implementations

2016-05-27 Thread Xiang Zhang
Changes by Xiang Zhang <angwe...@126.com>: -- nosy: +xiang.zhang ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27137> ___ __

[issue27164] zlib can't decompress DEFLATE using shared dictionary

2016-06-01 Thread Xiang Zhang
Xiang Zhang added the comment: Thanks for your review, Martin. :) I have replied with after thinking and try. Yes, this is more like a feature request. But for the end user, this behaviour is quite like a bug. > If we were to add full support of inflateSetDictionary() for raw deflate >

[issue27181] Add geometric mean to `statistics` module

2016-06-02 Thread Xiang Zhang
Changes by Xiang Zhang <angwe...@126.com>: -- nosy: +steven.daprano ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27181> ___ _

[issue27130] zlib: OverflowError while trying to compress 2^32 bytes or more

2016-05-26 Thread Xiang Zhang
Xiang Zhang added the comment: Quick and careless scanning at night lead me to a wrong result, Sorry. > You would need to compress just under 4 GiB of data that requires 5 MB or > more when compressed (i.e. not all the same bytes, or maybe try level=0). With enough memory, compr

[issue27130] zlib: OverflowError while trying to compress 2^32 bytes or more

2016-05-26 Thread Xiang Zhang
Xiang Zhang added the comment: This behaviour seems to have been fixed in issue25626. But you can only get that feature with Python3.5+. -- nosy: +xiang.zhang ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue5996] abstract class instantiable when subclassing dict

2016-05-26 Thread Xiang Zhang
Changes by Xiang Zhang <angwe...@126.com>: -- nosy: +xiang.zhang ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue5996> ___ __

[issue27130] zlib: OverflowError while trying to compress 2^32 bytes or more

2016-06-01 Thread Xiang Zhang
Xiang Zhang added the comment: Yes. It's compression object not compress. I find more. The overflow checking is introduced to solve problem in issue8650. It seems the explicit overflow checking is introduced to keep compatibility with py2 (py2 raises the overflowerror in pyargparse). I

[issue27164] zlib can't decompress DEFLATE using shared dictionary

2016-06-01 Thread Xiang Zhang
Xiang Zhang added the comment: I think my conclusion in last message is right. A similar bug in CPAN can be found in https://rt.cpan.org/Public/Bug/Display.html?id=36046. And I can find in zlib's changelog inflateSetDictionary starts to support raw inflate from 1.2.2.1. Patch attached now

[issue27164] zlib can't decompress DEFLATE using shared dictionary

2016-06-01 Thread Xiang Zhang
Xiang Zhang added the comment: This seems related with the difference between zlib format and raw format. When you do raw inflate, you have to inflateSetDictionary before any inflate. You cannot rely on the first inflate to return Z_NEED_DICT and then do inflateSetDictionary. Although I have

[issue27164] zlib can't decompress DEFLATE using shared dictionary

2016-06-01 Thread Xiang Zhang
Xiang Zhang added the comment: Forget to add test. Upload a new one with test included. -- Added file: http://bugs.python.org/file43085/issue27164_with_test.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue27164] zlib can't decompress DEFLATE using shared dictionary

2016-05-31 Thread Xiang Zhang
Changes by Xiang Zhang <angwe...@126.com>: -- nosy: +xiang.zhang ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27164> ___ __

[issue27130] zlib: OverflowError while trying to compress 2^32 bytes or more

2016-06-16 Thread Xiang Zhang
Xiang Zhang added the comment: I'm willing to and thanks for your work too :) I have replied to your comments and adjusted my patch accordingly. But there are still several I am confused or want to negotiate more. I now upload the adjusted patch. -- Added file: http

[issue27130] zlib: OverflowError while trying to compress 2^32 bytes or more

2016-06-16 Thread Xiang Zhang
Xiang Zhang added the comment: Sorry, I suddenly find that I've misunderstood one of your comments. I changed according then. Please use the new version. -- Added file: http://bugs.python.org/file43408/64bit_support_for_zlib_v3.patch ___ Python

[issue27351] Unexpected ConfigParser.read() behavior when passed fileobject

2016-06-18 Thread Xiang Zhang
Xiang Zhang added the comment: The doc tells ConfigParser.read accepts a filename or a list of filenames. Why do you pass it fileobject? If you want to use fileobject, why not read_file? -- nosy: +lukasz.langa, xiang.zhang ___ Python tracker <

[issue7769] SimpleXMLRPCServer.SimpleXMLRPCServer.register_function as decorator

2016-06-18 Thread Xiang Zhang
Changes by Xiang Zhang <angwe...@126.com>: -- nosy: +loewis, serhiy.storchaka ___ Python tracker <rep...@bugs.python.org> <http://bugs.pytho

[issue27130] zlib: OverflowError while trying to compress 2^32 bytes or more

2016-06-19 Thread Xiang Zhang
Xiang Zhang added the comment: Upload the near-final patch. This one adds large buffer tests on 64bit platforms. I have tested them on a server with enough memory. I don't add the @support.requires_resource('cpu') since large memory tests are born to be slow. And actually when I experiment

[issue27130] zlib: OverflowError while trying to compress 2^32 bytes or more

2016-06-18 Thread Xiang Zhang
Xiang Zhang added the comment: Upload the new patch to fix bugs and make improvements. I'll add tests later. -- Added file: http://bugs.python.org/file43450/64bit_support_for_zlib_v4.patch ___ Python tracker <rep...@bugs.python.org>

[issue26985] Information about CodeType in inspect documentation is outdated

2016-06-16 Thread Xiang Zhang
Xiang Zhang added the comment: Hmm, when I am going to delete the list in the docstring, I find other functions get lists too in inspect.py. So maybe we should open another issue to clean them after first merging this thread? -- ___ Python tracker

[issue27333] validate_step in rangeobject.c, incorrect code logic but right result

2016-06-16 Thread Xiang Zhang
New submission from Xiang Zhang: Here is a drawback in validate_step of rangeobject. PyNumber_AsSsize_t returns clipped value and won't set an exception when the argument *exc* is set NULL. So if step overflows, istep is always PY_SSIZE_MAX or PY_SSIZE_MIN. But the following code is to check

[issue27333] validate_step in rangeobject.c, incorrect code logic but right result

2016-06-16 Thread Xiang Zhang
Changes by Xiang Zhang <angwe...@126.com>: -- components: +Interpreter Core type: -> behavior versions: +Python 2.7, Python 3.5, Python 3.6 ___ Python tracker <rep...@bugs.python.org> <http://bugs.pyt

[issue27381] Typo in zipfile documentation

2016-06-24 Thread Xiang Zhang
New submission from Xiang Zhang: There is a redundant ')' in zipfile doc. Remove it. -- assignee: docs@python components: Documentation files: zipfile_doc.patch keywords: patch messages: 269166 nosy: docs@python, xiang.zhang priority: normal severity: normal status: open title: Typo

[issue22079] Ensure in PyType_Ready() that base class of static type is static

2016-06-24 Thread Xiang Zhang
Xiang Zhang added the comment: I think we can start from index 1 instead of 0. -- nosy: +xiang.zhang ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue27130] zlib: OverflowError while trying to compress 2^32 bytes or more

2016-06-18 Thread Xiang Zhang
Xiang Zhang added the comment: Attach patch to restore argument parsing support for __int__. -- Added file: http://bugs.python.org/file43460/64bit_support_for_zlib_v5.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.p

[issue27130] zlib: OverflowError while trying to compress 2^32 bytes or more

2016-06-18 Thread Xiang Zhang
Changes by Xiang Zhang <angwe...@126.com>: Added file: http://bugs.python.org/file43459/64bit_support_for_zlib_v4.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue27130] zlib: OverflowError while trying to compress 2^32 bytes or more

2016-06-18 Thread Xiang Zhang
Changes by Xiang Zhang <angwe...@126.com>: Removed file: http://bugs.python.org/file43450/64bit_support_for_zlib_v4.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue27342] Clean up some Py_XDECREFs in rangeobject.c and bltinmodule.c

2016-06-17 Thread Xiang Zhang
Xiang Zhang added the comment: Thanks for review. Eliminate the wrongs ones. -- Added file: http://bugs.python.org/file43440/cleanup_some_xdecrefs_v2.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue27130] zlib: OverflowError while trying to compress 2^32 bytes or more

2016-06-18 Thread Xiang Zhang
Changes by Xiang Zhang <angwe...@126.com>: Removed file: http://bugs.python.org/file43460/64bit_support_for_zlib_v5.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue27130] zlib: OverflowError while trying to compress 2^32 bytes or more

2016-06-18 Thread Xiang Zhang
Changes by Xiang Zhang <angwe...@126.com>: Added file: http://bugs.python.org/file43461/64bit_support_for_zlib_v5.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue27333] validate_step in rangeobject.c, incorrect code logic but right result

2016-06-17 Thread Xiang Zhang
Xiang Zhang added the comment: This looks fine. But maybe code like this looks more clear: if (step && _PyLong_Sign(step) == 0) { PyErr_SetString(PyExc_ValueError, "range() arg 3 must not be zero"); Py_CLEAR(step); } I think assert(PyLong_Check(

[issue26537] ConfigParser has optionxform, but not sectionxform

2016-06-23 Thread Xiang Zhang
Xiang Zhang added the comment: ping -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26537> ___ ___ Python-bugs-list mailing list

[issue26084] HTMLParser mishandles last attribute in self-closing tag

2016-01-15 Thread Xiang Zhang
Xiang Zhang added the comment: I don't think this is a bug. The HTML5 syntax spec tells: If an attribute using the unquoted attribute syntax is to be followed by another attribute or by the optional "/" (U+002F) character allowed in step 6 of the start tag syntax above, then

[issue26084] HTMLParser mishandles last attribute in self-closing tag

2016-01-15 Thread Xiang Zhang
Xiang Zhang added the comment: Hmm, can not say the behaviour is right. But since the HTML doesn't follows the official rule, HTMLParser's behaviour is understandable and can not be identified as incorrect. -- ___ Python tracker <

[issue27401] Wrong FTP links in 5.3.2 installer

2016-06-27 Thread Xiang Zhang
Changes by Xiang Zhang <angwe...@126.com>: -- nosy: +larry ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27401> ___ __

[issue27130] zlib: OverflowError while trying to compress 2^32 bytes or more

2016-06-25 Thread Xiang Zhang
Xiang Zhang added the comment: Add the newest version applying Martin's comments. -- Added file: http://bugs.python.org/file43538/64bit_support_for_zlib_v7.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue22079] Ensure in PyType_Ready() that base class of static type is static

2016-06-25 Thread Xiang Zhang
Xiang Zhang added the comment: Of course, I know it. But doesn't the local variable `bases` refer to mro[1]? [1] https://hg.python.org/cpython/file/tip/Objects/typeobject.c#l4900 -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.p

[issue22079] Ensure in PyType_Ready() that base class of static type is static

2016-06-26 Thread Xiang Zhang
Xiang Zhang added the comment: I thought that too at first. But if we use __bases__, can we still guarantee that 'all bases of statically allocated type should be statically allocated'? How about its grand bases? Is it possible that a statically allocated type inherit a dynamic type but does

[issue22079] Ensure in PyType_Ready() that base class of static type is static

2016-06-25 Thread Xiang Zhang
Xiang Zhang added the comment: In the mro list I think the first is always the type itself which has already been checked to be a statically allocated type if we can touch the loop. Starting from 0 checks it twice and it's not a base either. BTW, I don't receive an email from the tracker

[issue22079] Ensure in PyType_Ready() that base class of static type is static

2016-06-26 Thread Xiang Zhang
Xiang Zhang added the comment: Oh yes. The mro list can be customized so we can not even guarantee the type appears at index 0 and object at index n-1. It seems we should still keep what it is now, iterating the whole mro list. Sorry that my previous comments seem to be noise. But maybe we

[issue27342] Clean up some Py_XDECREFs in rangeobject.c and bltinmodule.c

2016-06-17 Thread Xiang Zhang
New submission from Xiang Zhang: Some Py_XDECREFs in rangeobject.c and bltinmodule.c are not necessary. Py_DECREF is enough. Clean up them. -- files: cleanup_some_xdecrefs.patch keywords: patch messages: 268711 nosy: xiang.zhang priority: normal severity: normal status: open title

[issue26255] symtable.Symbol.is_referenced() returns false for valid use

2016-02-01 Thread Xiang Zhang
Changes by Xiang Zhang <18518281...@126.com>: -- nosy: +xiang.zhang ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26255> ___ _

[issue26457] Error in ipaddress.address_exclude function

2016-02-28 Thread Xiang Zhang
Changes by Xiang Zhang <18518281...@126.com>: -- nosy: +xiang.zhang ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26457> ___ _

[issue26211] HTMLParser: “AssertionError: we should not get here!”

2016-01-26 Thread Xiang Zhang
Xiang Zhang added the comment: Test your html file and can not get the AssertionError. Seems everything works fine. Could you please provide more info? -- nosy: +xiang.zhang ___ Python tracker <rep...@bugs.python.org> <http://bugs.p

  1   2   3   4   5   6   7   8   9   10   >