Xiang Zhang added the comment:
It's BaseHTTPRequestHandler, not BaseHTTPServer.
--
___
Python tracker
<http://bugs.python.org/issue26585>
___
___
Pytho
New submission from Xiang Zhang:
BaseHTTPRequestHandler in http.server supports HTTP/0.9. But the response for
HTTP/0.9 request is implemented wrong.
Response of HTTP/0.9 request returns message body directly without status line
and headers. But if you inherit BaseHTTPRequestHandler and set
Xiang Zhang added the comment:
OK. You left the comment preferring using ascii or utf-8 to encode the filename
in test. But actually the response SimpeHTTPRequestHandler send is explicitly
encoded in filesystemdefaultencoding. So in such a case, am I doing right
Xiang Zhang added the comment:
Oops. You have already left new comment. No notify either. :(
I like the idea that extract the actual encoding from response header. I will
update my patch then.
--
___
Python tracker
<http://bugs.python.
Xiang Zhang added the comment:
At first I also want to use html.escape(..., quote=False) since the spec only
asks to escape quote signs in attribute. But after some search on Google, there
are articles recommends escaping quote in content too:
https://www.owasp.org/index.php/XSS_
Xiang Zhang added the comment:
The uploaded patch is updated. Hope you have time to review.
--
Added file: http://bugs.python.org/file42218/_quote_html_to_html_escape_v4.patch
___
Python tracker
<http://bugs.python.org/issue26
New submission from Xiang Zhang:
This patch propose several simple enhancement to BaseHTTPRequestHandler. It
removes some redundant code and add handler for too many headers.
--
components: Library (Lib)
files: simple_enhancement.patch
keywords: patch
messages: 261946
nosy: xiang.zhang
Xiang Zhang added the comment:
make some change to test for html escape in SimpleHTTPRequestHandler
--
Added file: http://bugs.python.org/file42205/_quote_html_to_html_escape_v3.patch
___
Python tracker
<http://bugs.python.org/issue26
Xiang Zhang added the comment:
Thanks for your review. I have made some changes according to it.
Status code 431 is returned when the header line is too long or there are too
many headers. And I think the short message is OK and we can provide the
exception message in the content message.
As
Xiang Zhang added the comment:
can should be can not.
And not only HTTPConnection, support for HTTP/0.9 seems to have been totally
abandoned since Python3.4 in http.client.
--
___
Python tracker
<http://bugs.python.org/issue26
Xiang Zhang added the comment:
I think you are right. Simply run http.server.test() and then telnet to send
"GET /", the client hangs. Or add a timeout to BaseHTTPRequestHandler, you can
see the timeout error on server output.
--
___
Pyth
Xiang Zhang added the comment:
Thanks for the reviews. I have updated the patch.
--
Added file: http://bugs.python.org/file42220/_quote_html_to_html_escape_v5.patch
___
Python tracker
<http://bugs.python.org/issue26
Xiang Zhang added the comment:
Ping.
--
___
Python tracker
<http://bugs.python.org/issue26586>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Xiang Zhang:
When requesting a resource from an origin server, the request-target in request
line should always starts with a back slash. But in SimpleHTTPServerTestCase in
test_httpservers.py, almost all the requests are sent without the back slash
though the handler
New submission from Xiang Zhang:
WRAPPER_ASSIGNMENTS now contains __qualname__ but the documentation doesn't
mention it.
--
assignee: docs@python
components: Documentation
files: functools_doc.patch
keywords: patch
messages: 262237
nosy: docs@python, xiang.zhang
priority: n
Changes by Xiang Zhang :
--
nosy: +xiang.zhang
___
Python tracker
<http://bugs.python.org/issue26617>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Xiang Zhang:
In reprlib.recursive_repr, it seems __qualname__ is forgotten. Giving the
example in reprlib document, it gives a strange result
'recursive_repr..decorating_function..wrapper' of
Mylist.__repr__.__qualname__.
I simply add the assignment of __qualnam
Xiang Zhang added the comment:
Hi, Raymond, I've added the test to test the assigned attributes.
I use WRAPPER_ASSIGNMENTS in functools so we can keep them consistent. I don't
know how to get the original func from the already decorated methods in this
case so I define a new con
Xiang Zhang added the comment:
The C version bisect_right can only accept number as hi, which conflicts with
the python version using None as the default value.
--
nosy: +xiang.zhang
___
Python tracker
<http://bugs.python.org/issue26
Changes by Xiang Zhang :
--
nosy: +xiang.zhang
___
Python tracker
<http://bugs.python.org/issue26657>
___
___
Python-bugs-list mailing list
Unsubscribe:
Xiang Zhang added the comment:
Url handling in http.server is not perfect and there have already been some
issues talking about it, i.e, issue5714, issue14567.
--
___
Python tracker
<http://bugs.python.org/issue26
Xiang Zhang added the comment:
Get the slash prefixed path in Setup() is a good idea. I change the patch. I
retain self.tempdir_name so we can use it in a test for no leading slash. The
case creating index.html is OK with self.tempdir_name since we have changed our
working directory to
Xiang Zhang added the comment:
Happy to see it works. Thanks for your reviews too. :)
--
___
Python tracker
<http://bugs.python.org/issue26585>
___
___
Python-bug
New submission from Xiang Zhang:
Though the documentation tells when disassembling a class, it disassembles all
methods for dis.dis, but staticmethod and classmethod are ignored. I don't know
whether this is intended.
I write to patch to add staticmethod and classmethod. But unfortun
Changes by Xiang Zhang :
--
components: +Library (Lib)
type: -> behavior
versions: +Python 3.6
___
Python tracker
<http://bugs.python.org/issue26733>
___
_
Xiang Zhang added the comment:
Though don't know why but simply replace %-4d with %3d in dis_bug708901 can fix
the test. I updated the patch so all the tests pass and then I'll spend some
time figuring out why.
--
Added file:
http://bugs.python.org
Xiang Zhang added the comment:
After researching the code, I think changing ' %-4d' to '%3d' in dis_bug708901
is right. Since I added some some lines and the lineno of test_bug708901 has
arrived at 100+ and the leading space should not be there. According to the
code o
Xiang Zhang added the comment:
I update the documentation. Learning from devguide, the change of whatsnew is
the committer's work. ;)
--
Added file:
http://bugs.python.org/file42439/add_staticmethod_and_classmethod_when_dis.dis_a_class_v4.
Xiang Zhang added the comment:
Thanks for your comments Serhiy. I update the patch according to your comments.
Actually I don't think this is a new feature. Maybe staticmethod and
classmethod are just forgotten.
As for separate tests for staticmethod and classmethod, I think they ar
New submission from Xiang Zhang:
It seems some code in _PyObject_GenericSetAttrWithDict is not necessary. There
is no need to check data descriptor again using PyDescr_IsData. And the second
if (f != NULL) {} will never function.
--
components: Interpreter Core
files
Changes by Xiang Zhang :
--
nosy: +benjamin.peterson, pitrou
___
Python tracker
<http://bugs.python.org/issue26745>
___
___
Python-bugs-list mailing list
Unsub
Xiang Zhang added the comment:
It's a better work. And the code looks simpler now. I test it with the test
suite and none fails (though some tests are skipped due to platform).
--
___
Python tracker
<http://bugs.python.org/is
Changes by Xiang Zhang :
--
nosy: +pitrou, xiang.zhang
___
Python tracker
<http://bugs.python.org/issue26793>
___
___
Python-bugs-list mailing list
Unsubscribe:
Xiang Zhang added the comment:
It seems a matter of lib uuid. The comments in uuid.py tells that the module is
not thread-safe. I try to comment out the code using ctypes and rerun your
sample, it works well.
In uuid's documentation it does not mention the non-thread-safe character
Xiang Zhang added the comment:
Sorry. I forgot to take that into consideration. I think now the problem
appears because of ctypes. Simply import ctypes instead of uuid can also lead
to your problem.
--
nosy: +amaury.forgeotdarc, belopolsky, meador.inge
Xiang Zhang added the comment:
I am not sure what the real problem is. What I can see now it that it seems
ctypes affects process fork. If you create the thread after fork, for example,
in wait, your example works well. But if the thread participates in process
fork, it fails
Xiang Zhang added the comment:
I write a simple example which behaviour is like Steven's example.
import os
import sys
import threading
import ctypes
import time
def test():
while True:
print(time.time())
_thread = threading.Thread(target=test)
pid = os.fork()
if pi
Xiang Zhang added the comment:
I should not make more noise after realizing it's matter of thread and process.
Sorry. :-( Except this one. :-)
--
___
Python tracker
<http://bugs.python.org/is
Xiang Zhang added the comment:
hg bisect tells me changeset 95830:661cdbd617b8 introduces this behaviour.
--
nosy: +xiang.zhang
type: crash ->
___
Python tracker
<http://bugs.python.org/issu
New submission from Xiang Zhang:
The documentation tells that concurrent.futures.Executor is an abstract class.
Also PEP3148 tells so and says concurrent.futures.Executor.submit is an
abstract method and must be implemented by Executor subclasses. I think using
abc.ABCMeta here is a good
Xiang Zhang added the comment:
Update the patch to remove more unnecessary base object.
--
Added file:
http://bugs.python.org/file42553/make_concurrent_futures_Executor_an_abc_v2.patch
___
Python tracker
<http://bugs.python.org/issue26
Changes by Xiang Zhang :
--
type: -> enhancement
versions: +Python 3.5, Python 3.6
___
Python tracker
<http://bugs.python.org/issue26816>
___
___
Python-
Xiang Zhang added the comment:
This makes sense. It makes the C version and Python version consistent.
--
nosy: +xiang.zhang
___
Python tracker
<http://bugs.python.org/issue26
Xiang Zhang added the comment:
With the current patch, a simple test gives the traceback:
Traceback (most recent call last):
File "", line 1, in
File "", line 2, in test
File "", line 2, in test
File "", line 2, in test
[Previous message
New submission from Xiang Zhang:
According to PEP3123, all accesses to ob_refcnt and ob_type MUST cast the
object pointer to PyObject* (unless the pointer is already known to have that
type), and SHOULD use the respective accessor macros.
I find that there are still some macros in Python use
Changes by Xiang Zhang :
--
type: -> enhancement
versions: +Python 3.6
___
Python tracker
<http://bugs.python.org/issue26824>
___
___
Python-bugs-list mai
Xiang Zhang added the comment:
No, actually I don't mean to change all the (obj)->ob_type in Python repo. I
know there are more (obj)->ob_type in it, but they are compliant with PEP3123
since obj is of type PyObject*. You don't have the need to change them. What I
propose i
Xiang Zhang added the comment:
I also inspect Py_REFCNT and Py_SIZE. I don't think there is need to replace
(obj)->ob_refcnt since they are legal.
So my intention is only several macros need to be altered and won't make too
mu
Xiang Zhang added the comment:
Good point. I don't think about that.
--
___
Python tracker
<http://bugs.python.org/issue26824>
___
___
Python-bugs-list m
Xiang Zhang added the comment:
My intention of the patch is that it helps reduce the possible errors described
in PEP3123. I agree with Serhiy and Martin's opinion but I think the error
passing a weird type argument to the macro is easier to find and debug than the
undefined beha
Xiang Zhang added the comment:
This seems to a behaviour change. In 2.7, return ans compiles to LOAD_NAME so
it can find ans. But in 3.x, it compiles to LOAD_GLOBAL which searches ans from
global scope. I don't know when this change is introduced.
--
components: +Interpreter
Xiang Zhang added the comment:
The current code is OK. But if the macro are used with arguments not of
PyObject* in the future, the bugs described in PEP3123 can possibly be
introduced.
The new PyObject_HEAD alone can not fix the problem. It just makes the
exception happen:
Standard C has
Xiang Zhang added the comment:
Noo!! What I am afraid most seems to happen, a lot of noice due
to misunderstanding! If that is true I am quite sorry. :-( But before I admit I
have to figure it out myself.
--
___
Python tracker
Xiang Zhang added the comment:
With a careful rereading of PEP3123, I think you are right. Actually the title
of the PEP tells what you mean. I do misunderstand. I am quite sorry and feel
shamed of making noice here and wasting time of the participants. I will think
more seriously from now on
Xiang Zhang added the comment:
No, urllib.request does not handle the no_proxy environment in case-sensitive
way. It first checks if any environment_variable.lower() ends with "_proxy",
and then checks if there is any environment_variable ends with "_proxy". So it
works a
Xiang Zhang added the comment:
Ohh, it's my fault to misunderstand. I think your thinking is reasonable. Curl
handles the suffix check insensitively.
--
components: +Library (Lib) -Documentation
nosy: -docs@python
type: enhancement ->
Xiang Zhang added the comment:
I write a patch to fix this.
It seems on Windows and MacOS the behaviour is right. On MacOS it leaves the
matching to fnmatch. On Windows it uses case insensitive regular matching.
--
keywords: +patch
Added file: http://bugs.python.org/file42621
Xiang Zhang added the comment:
The code has changed recently. I update the patch to reveal the change.
--
Added file: http://bugs.python.org/file42622/issue26864_v2.patch
___
Python tracker
<http://bugs.python.org/issue26
Changes by Xiang Zhang :
--
nosy: xiang.zhang
priority: normal
severity: normal
status: open
title: test_ssl test_options fails on ubuntu 16.04
___
Python tracker
<http://bugs.python.org/issue26
New submission from Xiang Zhang:
test_options in test_ssl fails on Ubuntu 16.04. I don't know this is due to the
newest ubuntu or a recent code change. But I checkout revision 9 and then
rebuild and test, test_option still fails.
The traceback is:
FAIL: test_op
Xiang Zhang added the comment:
Yes, you are right. I don't notice that. I will try to fix it.
--
___
Python tracker
<http://bugs.python.org/issue26864>
___
___
Xiang Zhang added the comment:
I update the patch to use regular expression to handle both case and suffix.
This regular expression has the function of curl's check_noproxy. And I think a
separate test case is better here.
--
Added file: http://bugs.python.org/file42624/issue268
Xiang Zhang added the comment:
Update to improve the test case.
--
Added file: http://bugs.python.org/file42625/issue26864_v4.patch
___
Python tracker
<http://bugs.python.org/issue26
Xiang Zhang added the comment:
Thanks for your comment martin. Using re.escape is really a good advise.
--
Added file: http://bugs.python.org/file42627/issue26864_v5.patch
___
Python tracker
<http://bugs.python.org/issue26
Xiang Zhang added the comment:
The patch introduced by issue26348 should be reverted. The __VENV_PROMPT__ is
meant to be a placeholder. For example, when you create a virtual environment
named venv-test, the __VENV_PROPMT__ will be replace by (venv-test). If the
patch is applied, it will be
Xiang Zhang added the comment:
The original behaviour is right. __VENV_PROMPT__ is meant to be a placeholder,
not a variable interpreted by shell. I think this patch should be reverted.
Related issue is #26664.
--
nosy: +xiang.zhang
___
Python
Xiang Zhang added the comment:
After some test, I think the reason causing this error is due to
SSL_CTX_clear_options.
With OPENSSL_VERSION_NUMBER 268443775, SSL_CTX_clear_options(self->ctx,
2248147967) returns 33554432, where SSL_CTX_get_options returns 2248147967.
From the manpage
Xiang Zhang added the comment:
>From the source code (get from apt-get source) of openssl-1.0.2g, I find
SSL_CTX_clear_options(ctx, op):
op &= ~SSL_OP_NO_SSLv3
return (ctx->options &= ~op)
SSL_CTX_set_options(ctx, op):
op |= SSL_OP_NO_SSLv3
return (ctx->options |= o
Xiang Zhang added the comment:
Simply add one line to make the function theoretically more robust.
--
nosy: +xiang.zhang
Added file: http://bugs.python.org/file42637/issue24114.patch
___
Python tracker
<http://bugs.python.org/issue24
Changes by Xiang Zhang :
--
nosy: +xiang.zhang
___
Python tracker
<http://bugs.python.org/issue26358>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Xiang Zhang :
--
nosy: +xiang.zhang
___
Python tracker
<http://bugs.python.org/issue24434>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Xiang Zhang:
The code given in mmap doc
import mmap
with mmap.mmap(-1, 13) as mm:
mm.write("Hello world!")
should be
mm.write(b"Hello world!")
The *b* is left out and then causes exception.
--
assignee: docs@python
components:
Xiang Zhang added the comment:
I tried to write a patch to make mmap behave like bytearray more. Making
iteration returns int is easy. But I am trapped in the contains operation. To
support operation like b'aa' in b'aabbcc', we have to do a str in str search. I
don
Xiang Zhang added the comment:
Ho, I'm really curious to see the resolution. ;-)
--
___
Python tracker
<http://bugs.python.org/issue26358>
___
___
Pytho
Xiang Zhang added the comment:
Although Serhiy thinks we need a separate class for this but I still want to
upload my patch first. Maybe some of it can be helpful later, or garbage.
I add a mmap_contains to fix the in operator's behaviour (I don't find the
separate issue). I use th
Xiang Zhang added the comment:
Caleb's resolution looks good, just like the C version does, at least seems
correct.
Serhiy, the corner case is interesting. math.nan == math.nan should return
false so I think (1, math.nan) in ItemsView({1: math.nan} is a right behaviour.
But the C ve
Xiang Zhang added the comment:
After reading issue4296, I agree with Serhiy's point on the second issue. Right
now, (1, math.nan) in ItemsView({1: math.nan}) returns false which seems not
acceptable.
--
___
Python tracker
<http://bugs.py
Changes by Xiang Zhang :
--
nosy: +xiang.zhang
___
Python tracker
<http://bugs.python.org/issue26893>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Xiang Zhang:
__contains__ operation in ItemsView, ValuesView and Sequence in collections.abc
simply test equality with ==. This introduces inconsistent behaviour with
built-in containers when encountering objects like NaN, which does not equal to
itself. I asked something
Changes by Xiang Zhang :
--
keywords: +patch
Added file: http://bugs.python.org/file42687/issue26915.patch
___
Python tracker
<http://bugs.python.org/issue26
Xiang Zhang added the comment:
Add issue number to test method name.
--
Added file: http://bugs.python.org/file42688/issue26915_v2.patch
___
Python tracker
<http://bugs.python.org/issue26
Changes by Xiang Zhang :
--
nosy: +xiang.zhang
___
Python tracker
<http://bugs.python.org/issue26537>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Xiang Zhang :
--
nosy: +xiang.zhang
___
Python tracker
<http://bugs.python.org/issue26696>
___
___
Python-bugs-list mailing list
Unsubscribe:
Xiang Zhang added the comment:
I agree with you josh. Actually that's what I want to know, consistency. But I
don't mention it in my post, so Guido only gives what to do in this case. In
this thread, it means does Python code have to keep the invariant mentioned in
Xiang Zhang added the comment:
Add collections.abc.ByteString's document.
--
keywords: +patch
Added file: http://bugs.python.org/file42711/ByteString_doc.patch
___
Python tracker
<http://bugs.python.org/is
Xiang Zhang added the comment:
I think the original is OK. Adding "not" means the opposite.
--
nosy: +xiang.zhang
___
Python tracker
<http://bugs.python.o
Xiang Zhang added the comment:
Hmm, it's not suitable to report such problems here. You'd better google for
it. At least you have to apt-get install python-dev or yum install python-devel.
--
nosy: +xiang.zhang
___
Python trac
Changes by Xiang Zhang :
--
nosy: +xiang.zhang
___
Python tracker
<http://bugs.python.org/issue26952>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Xiang Zhang :
--
nosy: +xiang.zhang
___
Python tracker
<http://bugs.python.org/issue26951>
___
___
Python-bugs-list mailing list
Unsubscribe:
Xiang Zhang added the comment:
This error occurs due to there is no action belong to the mutexGroup, the code
requires at least one. You can simply add
mutexGroup.add_argument('--foo', action='store_true')
and you'll see the error disappears. I have no id
Changes by Xiang Zhang :
--
nosy: +bethard
___
Python tracker
<http://bugs.python.org/issue26952>
___
___
Python-bugs-list mailing list
Unsubscribe:
Xiang Zhang added the comment:
I agree with Berker. Even without any exceptions, the help message given is not
what add_argument_group and add_mutually_exclusive_group intend.
You can see
usage: argparse_test.py [-h] [--foo] -u URL -p PROJECT [--dump] --mergeInput
Xiang Zhang added the comment:
Ubuntu 16.04 has came out and test_ssl fails. I already opened a issue about
it. See issue26867.
--
nosy: +xiang.zhang
___
Python tracker
<http://bugs.python.org/issue25
Xiang Zhang added the comment:
As a non-native speaker, actually I prefer the original one. But both versions
lead to no confusion for me.
--
___
Python tracker
<http://bugs.python.org/issue26
Xiang Zhang added the comment:
In my opinion it's not worth. If there is such an operator in stdlib, I would
expect more, exposing PyObject_RichCompareBool in Python level, providing a new
operator like `===`.
--
___
Python tracker
Xiang Zhang added the comment:
Oops, I forgot about them. I think they should. Raymond mentioned count in
msg75735. Attach patch to take them in.
--
Added file: http://bugs.python.org/file42734/issue26915_s2.patch
___
Python tracker
<h
Changes by Xiang Zhang :
--
nosy: +xiang.zhang
___
Python tracker
<http://bugs.python.org/issue26967>
___
___
Python-bugs-list mailing list
Unsubscribe:
Xiang Zhang added the comment:
This is a side effect introduced by 99302634d756. You have to set allow_abbrev
to True to make such match succeed. I think this is a bug.
--
___
Python tracker
<http://bugs.python.org/issue26
Xiang Zhang added the comment:
After some research I suggest to document this behaviour that
allow_abbrev=False will suspend option prefix matching. Simply fixing the count
action behaviour is not enough since it also prevents you from creating custom
actions that want to use option prefix
Xiang Zhang added the comment:
I write a patch to add sectionxform. It wraps necessary section name operation
I think. Hope to have some feedback.
--
keywords: +patch
Added file: http://bugs.python.org/file42752/add_sectionxform.patch
___
Python
1201 - 1300 of 1629 matches
Mail list logo