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
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
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
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
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
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
Changes by Xiang Zhang <18518281...@126.com>:
--
nosy: +xiang.zhang
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25390>
___
_
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
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
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
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
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>
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
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,
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
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
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
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 <
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>
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
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
Changes by Xiang Zhang <18518281...@126.com>:
--
type: -> behavior
versions: +Python 3.6
___
Python tracker <rep...@bugs.python.org>
<http://bugs.pyt
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
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.
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
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
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
Changes by Xiang Zhang <18518281...@126.com>:
--
nosy: +xiang.zhang
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25659>
___
_
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
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>
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
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
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
Xiang Zhang added the comment:
So maybe remove the docstring entirely?
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26985>
___
__
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 <
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
Changes by Xiang Zhang <angwe...@126.com>:
--
nosy: +xiang.zhang
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27235>
___
__
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
Changes by Xiang Zhang <angwe...@126.com>:
--
nosy: +alexandre.vassalotti, serhiy.storchaka
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python
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
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
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
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
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
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
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
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
Changes by Xiang Zhang <angwe...@126.com>:
--
resolution: -> wont fix
status: open -> closed
___
Python tracker <rep...@bugs.python.org>
<http://bugs.
Changes by Xiang Zhang <angwe...@126.com>:
--
nosy: +martin.panter
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27130>
___
_
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
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.
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
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
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
Changes by Xiang Zhang <angwe...@126.com>:
--
nosy: +xiang.zhang
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue7769>
___
__
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
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
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
Changes by Xiang Zhang <angwe...@126.com>:
--
nosy: +xiang.zhang
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27137>
___
__
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
>
Changes by Xiang Zhang <angwe...@126.com>:
--
nosy: +steven.daprano
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27181>
___
_
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
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
Changes by Xiang Zhang <angwe...@126.com>:
--
nosy: +xiang.zhang
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue5996>
___
__
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
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
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
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
Changes by Xiang Zhang <angwe...@126.com>:
--
nosy: +xiang.zhang
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27164>
___
__
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
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
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 <
Changes by Xiang Zhang <angwe...@126.com>:
--
nosy: +loewis, serhiy.storchaka
___
Python tracker <rep...@bugs.python.org>
<http://bugs.pytho
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
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>
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
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
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
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
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
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
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
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
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
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
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
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(
Xiang Zhang added the comment:
ping
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26537>
___
___
Python-bugs-list mailing list
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
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 <
Changes by Xiang Zhang <angwe...@126.com>:
--
nosy: +larry
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27401>
___
__
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
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
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
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
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
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
Changes by Xiang Zhang <18518281...@126.com>:
--
nosy: +xiang.zhang
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26255>
___
_
Changes by Xiang Zhang <18518281...@126.com>:
--
nosy: +xiang.zhang
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26457>
___
_
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 - 100 of 1625 matches
Mail list logo