[issue27746] ResourceWarnings in test_asyncio

2016-08-18 Thread Xiang Zhang
Xiang Zhang added the comment: >From my observations, this is due to transport is forgotten to close in >test_connect_accepted_socket. Upload a patch to add the close function. -- keywords: +patch nosy: +xiang.zhang Added file: http://bugs.python.org/file44139/issue27746

[issue27792] bool % int has inconsistent return type.

2016-08-18 Thread Xiang Zhang
Changes by Xiang Zhang : -- nosy: +xiang.zhang ___ Python tracker <http://bugs.python.org/issue27792> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue27558] SystemError with bare `raise` in threading or multiprocessing

2016-08-18 Thread Xiang Zhang
Xiang Zhang added the comment: Thanks for your work too! ;) I agree to close. -- ___ Python tracker <http://bugs.python.org/issue27558> ___ ___ Python-bugs-list m

[issue27794] setattr a read-only property; the AttributeError should show the attribute that failed

2016-08-18 Thread Xiang Zhang
Changes by Xiang Zhang : -- nosy: +xiang.zhang ___ Python tracker <http://bugs.python.org/issue27794> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue2466] os.path.ismount doesn't work for mounts the user doesn't have permission to see

2016-08-18 Thread Xiang Zhang
Xiang Zhang added the comment: David, issue2466_ismount_py2.7_port.patch does the py2.7 port. I also back port other ismount test cases not existing in py2.7. -- nosy: +xiang.zhang Added file: http://bugs.python.org/file44145/issue2466_ismount_py2.7_port.patch

[issue27662] Check against PY_SSIZE_T_MAX instead of PY_SIZE_MAX in List_New

2016-08-19 Thread Xiang Zhang
Xiang Zhang added the comment: Thanks for your reply Mark. But I don't understand your message about the assertion. There is now no assertion in PyList_New. The changed assertion statement is in list_ass_subscript. If this confuses you I am quite sorry to bring in a somewhat unrelated c

[issue27662] Check against PY_SSIZE_T_MAX instead of PY_SIZE_MAX in List_New

2016-08-19 Thread Xiang Zhang
Xiang Zhang added the comment: Just remove it. Regenerate the patch. As for list_resize, I have already fired another issue27660. -- Added file: http://bugs.python.org/file44147/List_New_Calloc_v2.patch ___ Python tracker <http://bugs.python.

[issue27801] test_update_lines_cols from test.test_curses.MiscTests fails on Ubuntu 14.04 LTS

2016-08-19 Thread Xiang Zhang
Xiang Zhang added the comment: Yes. update_lines_cols is not always available. We can just treat it like other methods like resize_term. Upload a trivial patch to fix this. -- keywords: +patch nosy: +xiang.zhang Added file: http://bugs.python.org/file44155/issue27801.patch

[issue27740] Fix doc of Py_CompileStringExFlags

2016-08-19 Thread Xiang Zhang
Xiang Zhang added the comment: Ping. -- ___ Python tracker <http://bugs.python.org/issue27740> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue27740] Fix doc of Py_CompileStringExFlags

2016-08-19 Thread Xiang Zhang
Xiang Zhang added the comment: > filename is going to be decoded inside of Py_CompileStringExFlags Actually all I want to express is this, *filename* will be decoded inside. But now the wording looks to me is that *filename* is already a decoded string when passed. I don't want to

[issue27713] Spurious "platform dependent libraries" warnings when running make

2016-08-19 Thread Xiang Zhang
Xiang Zhang added the comment: This is the design of getpath.c, when no exec/exec_prefix can be found it will emit warning and use the default one. Fortunately it gives use the ability to suppress the warnings. :) Simply set Py_FrozenFlag in _freeze_importlib.c can solve this problem. Upload

[issue25746] test_unittest failure in leaks searching mode

2016-08-20 Thread Xiang Zhang
Xiang Zhang added the comment: Simple reproduction: >>> pickle.dumps(unittest.loader._make_skipped_test('hello', RuntimeError, >>> unittest.suite.TestSuite)) Traceback (most recent call last): File "", line 1, in _pickle.PicklingError: Can't

[issue27692] Clean serveral unnecessary NULL checks in exceptions.c

2016-08-20 Thread Xiang Zhang
Xiang Zhang added the comment: Ping. :) -- ___ Python tracker <http://bugs.python.org/issue27692> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue27780] memory leaks in pgen build step abort build with address sanitizer enabled

2016-08-20 Thread Xiang Zhang
Xiang Zhang added the comment: Valgrind can also complain: valgrind --leak-check=yes --suppressions=Misc/valgrind-python.supp Parser/pgen ./Grammar/Grammar Include/graminit.h Python/graminit.c ==6836== Memcheck, a memory error detector ==6836== Copyright (C) 2002-2015, and GNU GPL'd, by J

[issue16764] Make zlib accept keyword-arguments

2016-08-21 Thread Xiang Zhang
Xiang Zhang added the comment: I think it's okay to close now. -- ___ Python tracker <http://bugs.python.org/issue16764> ___ ___ Python-bugs-list m

[issue27782] Multi-phase extension module initialization, inconsistent exceptions and conflicts between code and PEP

2016-08-21 Thread Xiang Zhang
Xiang Zhang added the comment: Thanks for your work too, Nick! :) Active reply from the core devs always gives me more motivation to open source. -- ___ Python tracker <http://bugs.python.org/issue27

[issue27746] ResourceWarnings in test_asyncio

2016-08-21 Thread Xiang Zhang
Xiang Zhang added the comment: The patch I submitted is about to solve the resource leak in the test suite. Paul, your problem seems to need other triage. -- ___ Python tracker <http://bugs.python.org/issue27

[issue27823] Change bare AttributeError messages to be more informative

2016-08-21 Thread Xiang Zhang
Changes by Xiang Zhang : -- nosy: +rhettinger ___ Python tracker <http://bugs.python.org/issue27823> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue27823] Change bare AttributeError messages to be more informative

2016-08-21 Thread Xiang Zhang
Xiang Zhang added the comment: -1. I don't think this is equal to issue27794. I don't hope when I use `raise AttributeError`, Python hides some magic and sets a message I totally don't want. If you do want a good message, why not passing the messa

[issue27792] bool % int has inconsistent return type.

2016-08-21 Thread Xiang Zhang
Xiang Zhang added the comment: issue27792.patch tries to fix this. BTW, Mark, do you think the fast path in long_mod is really needed? Actually the same fast path has already existed in l_divmod. -- keywords: +patch Added file: http://bugs.python.org/file44185/issue27792.patch

[issue27792] bool % int has inconsistent return type.

2016-08-22 Thread Xiang Zhang
Xiang Zhang added the comment: Oh, sorry. I forgot about long_long. Actually I did think for a while to search for a good function here. :( v2 uses long_long now. > I agree that the fast paths need looking at; it seems there's a fair bit of > redundancy there. But not in this is

[issue27792] bool % int has inconsistent return type.

2016-08-22 Thread Xiang Zhang
Xiang Zhang added the comment: Thanks for your work too. ;) You does the most important change. -- ___ Python tracker <http://bugs.python.org/issue27792> ___ ___

[issue27660] Replace size_t with Py_ssize_t as the type of local variable in list_resize

2016-08-22 Thread Xiang Zhang
Xiang Zhang added the comment: Ping. -- ___ Python tracker <http://bugs.python.org/issue27660> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue26331] PEP 515: Tokenizer: allow underscores for grouping in numeric literals

2016-08-22 Thread Xiang Zhang
Xiang Zhang added the comment: Hi Georg, I left several comments on Rietveld. Hope it helps. -- nosy: +xiang.zhang ___ Python tracker <http://bugs.python.org/issue26

[issue27794] setattr a read-only property; the AttributeError should show the attribute that failed

2016-08-22 Thread Xiang Zhang
Xiang Zhang added the comment: One solution I can think of is alter the constructor of property() and add an optional name attribute to it. If users really care about the exception message, they can set the attribute to the property's name. If they don't care, everything remains t

[issue27660] Replace size_t with Py_ssize_t as the type of local variable in list_resize

2016-08-22 Thread Xiang Zhang
Xiang Zhang added the comment: v3 applies haypo's suggestion. -- Added file: http://bugs.python.org/file44192/list_resize_v3.patch ___ Python tracker <http://bugs.python.org/is

[issue27683] ipaddress subnet slicing iterator malfunction

2016-08-23 Thread Xiang Zhang
Xiang Zhang added the comment: issue27683.patch tries to fix this. It alters the doc and refactors the constructor, so there is no difference between different arguments As for IPv6Network, it has the same problem. -- nosy: +xiang.zhang Added file: http://bugs.python.org/file44193

[issue27833] Process is locked when try to execute Queue.put() inside

2016-08-23 Thread Xiang Zhang
Changes by Xiang Zhang : -- components: +Library (Lib) nosy: +davin type: -> behavior ___ Python tracker <http://bugs.python.org/issue27833> ___ ___ Python-

[issue2466] os.path.ismount doesn't work for mounts the user doesn't have permission to see

2016-08-23 Thread Xiang Zhang
Xiang Zhang added the comment: Oh, sorry. Upload bot_failure_fix.patch to fix this. -- Added file: http://bugs.python.org/file44207/bot_failure_fix.patch ___ Python tracker <http://bugs.python.org/issue2

[issue27833] Process is locked when try to execute Queue.put() inside

2016-08-24 Thread Xiang Zhang
Changes by Xiang Zhang : -- nosy: +xiang.zhang ___ Python tracker <http://bugs.python.org/issue27833> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue27414] http.server.BaseHTTPRequestHandler inconsistence with Content-Length value

2016-08-24 Thread Xiang Zhang
Xiang Zhang added the comment: Ping. :) -- ___ Python tracker <https://bugs.python.org/issue27414> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue27414] http.server.BaseHTTPRequestHandler inconsistence with Content-Length value

2016-08-24 Thread Xiang Zhang
Xiang Zhang added the comment: Thanks for the reply berker. It's nice to know this helper. :) But I'd like to keep it as now since I don't see any real advantage to use it and swap_attr will set the attribute even when it's absent

[issue27833] Process is locked when try to execute Queue.put() inside

2016-08-25 Thread Xiang Zhang
Xiang Zhang added the comment: Guni, the behaviour is not consistent since your code is not that 'right'. You can not expect a not 'right' snippet to behave correctly. You can do what the programming guide says: [1] consuming all items before join [2] call q.cancel_join_th

[issue27860] Improvements to ipaddress module

2016-08-25 Thread Xiang Zhang
Changes by Xiang Zhang : -- nosy: +xiang.zhang ___ Python tracker <https://bugs.python.org/issue27860> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue27861] sqlite3 type confusion and multiple frees

2016-08-25 Thread Xiang Zhang
Xiang Zhang added the comment: For the first issue, the doc says: The cursor method accepts a single optional parameter cursorClass. If supplied, this must be a custom cursor class that extends sqlite3.Cursor. So I think we should check the type and then raise TypeError. For the second issue

[issue27863] multiple issues in _elementtree module

2016-08-25 Thread Xiang Zhang
Changes by Xiang Zhang : -- nosy: +xiang.zhang ___ Python tracker <https://bugs.python.org/issue27863> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue27861] sqlite3 type confusion and multiple frees

2016-08-26 Thread Xiang Zhang
Xiang Zhang added the comment: I considered that but don't why decide to preserve it. But now that you mention it, I'll do that later. -- ___ Python tracker <https://bugs.python.o

[issue27861] sqlite3 type confusion and multiple frees

2016-08-26 Thread Xiang Zhang
Xiang Zhang added the comment: issue27861_conn_cursor.patch tries to solve the first issue. -- Added file: https://bugs.python.org/file44228/issue27861_conn_cursor.patch ___ Python tracker <https://bugs.python.org/issue27

[issue27861] sqlite3 type confusion and multiple frees

2016-08-26 Thread Xiang Zhang
Xiang Zhang added the comment: issue27861_conn_isolation_level.patch now adds argument type and value check along with eliminating the potential sf. -- Added file: https://bugs.python.org/file44234/issue27861_conn_isolation_level.patch ___ Python

[issue27506] make bytes/bytearray translate's delete a keyword argument

2016-08-27 Thread Xiang Zhang
Xiang Zhang added the comment: Yay, thanks for your work, Martin. -- ___ Python tracker <https://bugs.python.org/issue27506> ___ ___ Python-bugs-list mailin

[issue27861] sqlite3 type confusion and multiple frees

2016-08-27 Thread Xiang Zhang
Xiang Zhang added the comment: Thanks for the comments, Serhiy and palaviv. I left some questions in reply to them. -- ___ Python tracker <https://bugs.python.org/issue27

[issue27861] sqlite3 type confusion and multiple frees

2016-08-27 Thread Xiang Zhang
Xiang Zhang added the comment: If decide to follow the behaviour of code rather than doc, it's a different story. issue27861_conn_cursor_v2.patch tries to solve the first issue. It now preserve the previous behaviour treating factory as a callable not a cursor type. -- Added

[issue27881] Fix possible bugs when setting sqlite3.Connection.isolation_level

2016-08-27 Thread Xiang Zhang
New submission from Xiang Zhang: This is a follow up of issue27861 and means to fix the second issue mentioned in it. pysqlite_connection_set_isolation_level now does not check allowed values and when any part fails, it leaves the Connection object in an inconsistent state. I'll wr

[issue27414] http.server.BaseHTTPRequestHandler inconsistence with Content-Length value

2016-08-27 Thread Xiang Zhang
Xiang Zhang added the comment: Delete by other test cases without restoring? Which is rather impossible to happen. But I'd like it to stay like now. It is not complex and straight when reading. I don't want to change it to swap_attr. --

[issue27740] Fix doc of Py_CompileStringExFlags

2016-08-27 Thread Xiang Zhang
Xiang Zhang added the comment: I am not a native speaker so I decide not to trap in the minor part. Could you just fix the first point if there is no doubt? I'm okay with the second part staying as now. -- Added file: https://bugs.python.org/file44242/issue27740.

[issue27861] sqlite3 type confusion and multiple frees

2016-08-27 Thread Xiang Zhang
Xiang Zhang added the comment: Thanks for the comments Serhiy. v3 now fixs all that. -- Added file: https://bugs.python.org/file44245/issue27861_conn_cursor_v3.patch ___ Python tracker <https://bugs.python.org/issue27

[issue27861] sqlite3 type confusion and multiple frees

2016-08-28 Thread Xiang Zhang
Xiang Zhang added the comment: It's a trivial personal style choice I think. Do what you want if you'd like to merge it. -- ___ Python tracker <https://bugs.python.o

[issue27881] Fix possible bugs when setting sqlite3.Connection.isolation_level

2016-08-28 Thread Xiang Zhang
Xiang Zhang added the comment: issue27881.patch tires to solve this. Hope to get feedback. -- keywords: +patch Added file: https://bugs.python.org/file44247/issue27881.patch ___ Python tracker <https://bugs.python.org/issue27

[issue27881] Fix possible bugs when setting sqlite3.Connection.isolation_level

2016-08-30 Thread Xiang Zhang
Xiang Zhang added the comment: Serhiy, I've updated the patch. Looking forward to your feedback. -- Added file: https://bugs.python.org/file44265/issue27881_v2.patch ___ Python tracker <https://bugs.python.org/is

[issue27881] Fix possible bugs when setting sqlite3.Connection.isolation_level

2016-08-30 Thread Xiang Zhang
Xiang Zhang added the comment: Leave replies and make a trival change in v3. I don't change the other two just as I state in the replies. But please do what you like. -- Added file: https://bugs.python.org/file44266/issue27881_v3.patch ___ P

[issue27897] Avoid possible crash in pysqlite_connection_create_collation

2016-08-30 Thread Xiang Zhang
New submission from Xiang Zhang: When supplied a custom string with upper returning a non-string, pysqlite_connection_create_collation will fail assertion and crash. Serhiy, I think we can use the same way in set_isolation_level to avoid this. -- components: Library (Lib) files

[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 data

[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
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 <http://bugs.python.org/issue25232> ___ ___ P

[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 <http://bugs.py

[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 <http://bugs.python.org/issue24

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

2015-09-27 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

[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_startendta

[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 <http://bugs.python.org/issue24

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

2015-10-08 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

[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,

[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 <http://bugs.python.org/issue24402> ___ ___ Pytho

[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 <http://bugs.python.org/i

[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 <http://bugs.python.org/is

[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 <http://bugs.python.org/issue25

[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 <http://bugs.python.org/is

[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

[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 <http://bugs.python.org/issue25390> ___ ___ Python-bugs-list

[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

[issue25534] SimpleHTTPServer throwed an exception due to negtive st_mtime attr in file

2015-11-04 Thread Xiang Zhang
Xiang Zhang added the comment: I'm afraid we can't say negative epoch is handled successfully on Linux. Use $ touch -d "1 Jan 1900" test as a test, time.gmtime(os.fstat(f.fileno()).st_mtime) gives time.struct_time(tm_year=1899, tm_mon=12, tm_mday=31, tm_hour=15, tm_min=54

[issue25534] SimpleHTTPServer throwed an exception due to negtive st_mtime attr in file

2015-11-04 Thread Xiang Zhang
Xiang Zhang added the comment: You're right. Actually I do think of timezone when I do the experiment. But I think different timezone will only affect the hour. It turns out I should learn more about time. -- ___ Python tracker

[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.pytho

[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 <http://bugs.python.org/issue25659> ___ ___ Python-bugs-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, the

[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 trac

[issue26187] sqlite3 trace callback prints duplicate line

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

[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 <http://bugs.python.org/issue26

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

2016-01-26 Thread Xiang Zhang
Xiang Zhang added the comment: After reading Issue26210, I can get the AssertionError when there is a self.reset() in handle_endtag. I don't think it's proper to use reset in the process of parsing. From the samples I find on Web, reset is commonly used to set extra attributes on

[issue26210] `HTMLParser.handle_data` may be invoked although `HTMLParser.reset` was invoked

2016-01-26 Thread Xiang Zhang
Xiang Zhang added the comment: reset just set some attributes to the initial states and it does not control the parsing process. So reading the gohead function, even if reset is called in handle_endtag and all data are discarded, it is still possible for the process to move forward

[issue26210] `HTMLParser.handle_data` may be invoked although `HTMLParser.reset` was invoked

2016-01-27 Thread Xiang Zhang
Xiang Zhang added the comment: Actually it does move forward since in goahead, it first store a "copy" of the initial self.rawdata and use it to control the flow. If you make some change to self.rawdata when parsing, for example call reset, goahead can not feel it. But methods parse

[issue26210] `HTMLParser.handle_data` may be invoked although `HTMLParser.reset` was invoked

2016-01-27 Thread Xiang Zhang
Xiang Zhang added the comment: Hmm, I don't know whether I am right or not. Let's wait for a core member to clarify. If I am wrong, I am quite sorry. I don't think invoking reset when parsing should raise an error(and I don't know how to achieve that). When to in

[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 <http://bugs.python.org/issue26255> ___ ___ Python-bugs-list

[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 <http://bugs.python.org/issue26457> ___ ___ Python-bugs-list

[issue26457] Error in ipaddress.address_exclude function

2016-02-29 Thread Xiang Zhang
Xiang Zhang added the comment: In old ipaddr.py, IPv4Network('192.0.2.0/31').subnet() returns [IPv4Network('192.0.2.0/32'), IPv4Network('192.0.2.1/32')], but ipaddress returns only [IPv4Network('192.0.2.0/32')]. It seems simply change end to end+1 in

[issue26457] Error in ipaddress.address_exclude function

2016-02-29 Thread Xiang Zhang
Xiang Zhang added the comment: I propose a patch simply add one to end so that the broadcast address network will appear in the result, which behaves the same as ipaddr.py. Corresponding tests are added. All tests are passed but I am afraid some logic may break. -- keywords: +patch

[issue26478] dict views don't implement subtraction correctly

2016-03-03 Thread Xiang Zhang
Changes by Xiang Zhang <18518281...@126.com>: -- nosy: +xiang.zhang ___ Python tracker <http://bugs.python.org/issue26478> ___ ___ Python-bugs-list

[issue18156] Add an 'attr' attribute to AttributeError

2016-03-07 Thread Xiang Zhang
Xiang Zhang added the comment: I'd like to ping this channel. I post a question on https://groups.google.com/forum/#!topic/comp.lang.python/y8yDAAJJ9Sc to ask if it is possible to directly get the attribute from AttributeError, which leads me here. -- nosy: +xiang.

[issue18156] Add an 'attr' attribute to AttributeError

2016-03-08 Thread Xiang Zhang
Xiang Zhang added the comment: The concerns mentioned by haypo seems to have existed in PEP473. -- ___ Python tracker <http://bugs.python.org/issue18156> ___ ___

[issue26578] Bad BaseHTTPRequestHandler response when using HTTP/0.9

2016-03-18 Thread Xiang Zhang
Changes by Xiang Zhang : -- type: -> behavior ___ Python tracker <http://bugs.python.org/issue26578> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue26585] Use html.escape to replace _quote_html in http.server

2016-03-18 Thread Xiang Zhang
Xiang Zhang added the comment: Thanks for your review. Set quote to False when html.escape is OK to me. But except for the usage in BaseHTTPRequestHandler, I think we should also set quote to False for the usage in SimpleHTTPRequestHandler since they do not appear in attribute either. And I

[issue26578] Bad BaseHTTPRequestHandler response when using HTTP/0.9

2016-03-18 Thread Xiang Zhang
Changes by Xiang Zhang : -- nosy: +gregory.p.smith, martin.panter ___ Python tracker <http://bugs.python.org/issue26578> ___ ___ Python-bugs-list mailin

[issue26585] Use html.escape to replace _quote_html in http.server

2016-03-19 Thread Xiang Zhang
Xiang Zhang added the comment: I add two tests for html escaping. One for the error message and the other for display name in SimpleHTTPRequesthandler. -- Added file: http://bugs.python.org/file42204/_quote_html_to_html_escape_v2.patch ___ Python

[issue26585] Use html.escape to replace _quote_html in http.server

2016-03-19 Thread Xiang Zhang
New submission from Xiang Zhang: In http.server, _quote_html is used to escape content for BaseHTTPServer. The function has already been implemented by html.escape. -- components: Library (Lib) files: _quote_html_to_html_escape.patch keywords: patch messages: 261943 nosy: xiang.zhang

<    7   8   9   10   11   12   13   14   15   16   >