Vajrasky Kok added the comment:
Serhiy, okay, I'll create a pull request soon (in 2-3 days).
--
___
Python tracker
<https://bugs.python.org/issue18799>
___
___
New submission from Vajrasky Kok :
$ git clone g...@github.com:python/cpython.git cpython2
$ cd cpython2
$ ./configure --with-pydebug
$ make -j
$ ./python Lib/test/test_xmlrpc.py
Traceback (most recent call last):
File "Lib/test/test_xmlrpc.py", line 8, in
import xmlrpc
Vajrasky Kok added the comment:
Okay, thanks, Victor. Your suggestion to rename Lib/test/bisect.py to
Lib/test/bisect_cmd.py works. My question is why you fixed in 2.7 branch only?
This problem persists in master (3.8).
Ah, I think because I use cpython2 directory name, you thought I used
Change by Vajrasky Kok :
--
pull_requests: +10435
___
Python tracker
<https://bugs.python.org/issue18799>
___
___
Python-bugs-list mailing list
Unsubscribe:
Vajrasky Kok added the comment:
Martin Panter, thank you for reviewing my patch. Let me rework it. It has been
a while (4 years!!!).
--
___
Python tracker
<https://bugs.python.org/issue19
Change by Vajrasky Kok :
--
pull_requests: +10895
stage: needs patch -> patch review
___
Python tracker
<https://bugs.python.org/issue19974>
___
___
Python-
Change by Vajrasky Kok :
--
pull_requests: +10895, 10896, 10898
stage: needs patch -> patch review
___
Python tracker
<https://bugs.python.org/issu
Change by Vajrasky Kok :
--
pull_requests: +10895, 10896
stage: needs patch -> patch review
___
Python tracker
<https://bugs.python.org/issue19974>
___
___
Py
Change by Vajrasky Kok :
--
pull_requests: +10895, 10896, 10897, 10898
stage: needs patch -> patch review
___
Python tracker
<https://bugs.python.org/issu
Vajrasky Kok added the comment:
Martin Panter,
I have modernized the patch.
About your suggestion:
1. "import errno" -> Yes, this is unnecessary. I have removed it.
2. Use os.path.lexists instead of os.path.islink for broken symlink -> The
thing is os.path.islink retur
Vajrasky Kok added the comment:
"I could not find a case where these methods return different result." -> This
is wrong. My mistake. os.lexists returns True for non symbolic link file while
os.islink returns False.
--
___
Python tr
Vajrasky Kok added the comment:
Sorry, Martin. I just understood what you suggested. I thought you were saying
lexists to replace islink, but it is to replace the complex if condition. Let
me work on it.
--
___
Python tracker
<ht
Vajrasky Kok added the comment:
After experimenting with lexists, I don't think I can simplify it with lexists.
--
___
Python tracker
<https://bugs.python.org/is
Vajrasky Kok added the comment:
I have added test case for broken symlinks. I am not sure whether this is
necessary or not. But anyway I have added it.
--
___
Python tracker
<https://bugs.python.org/issue19
Vajrasky Kok added the comment:
Martin, thank you for your advice. I have added additional two test cases for
broken symlink case.
1. broken symlink overwrites ordinary file,
2. ordinary file overwrites broken symlink.
I hope that is enough. Let me know if you have another concern
Vajrasky Kok added the comment:
Correction:
1. broken symlink overwrites valid symlink,
2. ordinary file overwrites broken symlink.
--
___
Python tracker
<https://bugs.python.org/issue19
Vajrasky Kok added the comment:
Okay, Serhiy. I'll create a pull request.
--
___
Python tracker
<http://bugs.python.org/issue19791>
___
___
Python-bugs-list m
Vajrasky Kok added the comment:
Okay, this is the pull request: https://github.com/python/cpython/pull/822
--
___
Python tracker
<http://bugs.python.org/issue19
New submission from Vajrasky Kok:
In two "test_copying" methods in Lib/test/test_collections.py, variable i is
never used. My guess is the original test writer forgot to utilize the variable
i.
For example, in test_copying method in TestOrderedDict class:
def test_co
Vajrasky Kok added the comment:
According to R. David Murray in Python core-mentorship mailing list addressing
me:
"It could be that the bug is that the i is not used...it may have been
intended to be used in an extended error message in the asserts, so that
it would be clear which
Vajrasky Kok added the comment:
Anyway to make it complete, I upload the patch according to Storchaka's advice
too.
May the best patch wins!
--
Added file: http://bugs.python.org/file30434/test_copying_with_def.patch
___
Python tracker
Vajrasky Kok added the comment:
I redo the test as Terry J. Reedy suggested. I use label in loop, utilize
subTest receiving label parameter, and pass messages to only necessary asserts.
So roughly if the test fails, we would get something like this
Vajrasky Kok added the comment:
This bug happens in Python 3.4 as well.
[sky@localhost cpython]$ ./python --version
Python 3.4.0a0
[sky@localhost cpython]$ ./python /tmp/bugme.py
/home/sky/Code/python/programming_language/cpython/Lib/os.py:1025:
ResourceWarning: unclosed file <_io.FileIO n
Vajrasky Kok added the comment:
I isolate the bug. It happens in these lines:
# Always try reading and writing directly on the tty first.
fd = os.open('/dev/tty', os.O_RDWR|os.O_NOCTTY)
tty = os.fdopen(fd, 'w+', 1)
So to produce the bug more speci
Vajrasky Kok added the comment:
I have investigated this problem and come up with the patch to fix the problem.
This patch does the job. Caution: only for Python 3.4. But translating this
patch to Python 3.3 should be straightforward.
I hope this patch could be the foundation for better
Vajrasky Kok added the comment:
Sorry,
My previous patch breaks the test. This one should pass the test and fix the
bug.
Still, there are ugly code in the patch that I hope better programmers could
fix.
--
Added file:
http://bugs.python.org/file30445
Vajrasky Kok added the comment:
Based on the input from Benjamin Peterson, I grab encoding from the os module
in the getpass module.
I put some test as well.
Until the whole function is rewritten, I hope this patch will suffice and do
the job properly.
--
Added file: http
Vajrasky Kok added the comment:
So the correct fix should be:
1. Make sure we can open /dev/tty in non-binary mode,
2. We can write string to /dev/tty,
3. Close the leak if we can not open /dev/tty.
Is it?
--
___
Python tracker
<h
Vajrasky Kok added the comment:
Fixing IO leak resource would fix this bug but leave another bug opened which I
try to fix as well.
These statements with Python3 under Linux will always fail because we need to
open /dev/tty file in binary mode (for whatever reason).
fd = os.open('/de
New submission from Vajrasky Kok:
There is a duplicate test inside TestSingleDispatch in file
Lib/test/test_functools.py.
The method test_mro and test_classic_classes are not different at all.
--
components: Tests
files: duplicate_test_for_testsingledispatch.diff
keywords: patch
Changes by Vajrasky Kok :
Removed file:
http://bugs.python.org/file30484/duplicate_test_for_testsingledispatch.diff
___
Python tracker
<http://bugs.python.org/issue18
Vajrasky Kok added the comment:
I think to test the mro case, we have to test the multiple inheritance with the
same ancestor case.
Attached my guess of the correct test should be.
--
Added file: http://bugs.python.org/file30491/test_mro.diff
Changes by Vajrasky Kok :
Removed file: http://bugs.python.org/file30498/csv_has_header.diff
___
Python tracker
<http://bugs.python.org/issue18155>
___
___
Python-bug
Vajrasky Kok added the comment:
Attached the patch to fix the problem.
--
keywords: +patch
nosy: +vajrasky
Added file: http://bugs.python.org/file30498/csv_has_header.diff
___
Python tracker
<http://bugs.python.org/issue18
Vajrasky Kok added the comment:
Sorry. This one is correct. Attached the patch to fix the problem.
--
Added file: http://bugs.python.org/file30499/csv_has_header.diff
___
Python tracker
<http://bugs.python.org/issue18
Changes by Vajrasky Kok :
Removed file: http://bugs.python.org/file30499/csv_has_header.diff
___
Python tracker
<http://bugs.python.org/issue18155>
___
___
Python-bug
Vajrasky Kok added the comment:
Added test to sniffer double quote.
--
Added file: http://bugs.python.org/file30501/csv_has_header.diff
___
Python tracker
<http://bugs.python.org/issue18
Vajrasky Kok added the comment:
Fixed the test based on Ezio Melotti's advice.
However, Ezio did not comment specifically about whether we should cut or keep
this line.
self.assertEqual(list(dup.items()), list(od.items()))
After studying the OrderedDict source code, I came to conclusion
Vajrasky Kok added the comment:
Attached the fix and the unit test for this problem.
--
nosy: +vajrasky
Added file:
http://bugs.python.org/file30863/patch_for_fixing_the_server_serving_the_url_with_trailing_slash.txt
___
Python tracker
<h
Vajrasky Kok added the comment:
The question is whether we should give the freedom to user to add dynamic
attribute to Counter object.
Is this freedom has any practicality? Why do we want to add dynamic attributes
to Counter object?
Decimal object does not have this freedom.
>>
Vajrasky Kok added the comment:
Here is the preliminary patch for email module to pass the test.
--
nosy: +vajrasky
Added file:
http://bugs.python.org/file30884/set_payload_handles_binary_correctly.txt
___
Python tracker
<http://bugs.python.
Vajrasky Kok added the comment:
I see. Thanks for the explanation. I'll do this patch if nobody is interested.
--
___
Python tracker
<http://bugs.python.org/is
New submission from Vajrasky Kok:
Python 3.4, line 197:
output_charset: Some character sets must be converted before the can be
It is supposed to be:
output_charset: Some character sets must be converted before they can be
--
assignee: docs@python
components: Documentation
New submission from Vajrasky Kok:
Python 3.4, file Lib/decimal.py, line 24:
www.cs.berkeley.edu/~ejr/projects/754/private/drafts/854-1987/dir.html
If you go to the website, you'll encounter this error:
The server has encountered a problem because the resource was not found.
I could not
Vajrasky Kok added the comment:
Attached the unit test.
Here is the simpler script to product the bug:
import argparse
parser = argparse.ArgumentParser(prog='PROG')
parser.add_argument ('--a', metavar='a'*76)
parser.add_argument ('
Vajrasky Kok added the comment:
Sorry, got typo in last unit test.
--
Added file:
http://bugs.python.org/file30911/unit_test_for_inner_bracket_metavar.txt
___
Python tracker
<http://bugs.python.org/issue11
Changes by Vajrasky Kok :
Removed file:
http://bugs.python.org/file30910/unit_test_for_inner_bracket_metavar.txt
___
Python tracker
<http://bugs.python.org/issue11
Vajrasky Kok added the comment:
Tidied up the unit test. Mixed with arguments without metavar.
--
Added file: http://bugs.python.org/file30913/unit_test_argparse.txt
___
Python tracker
<http://bugs.python.org/issue11
Vajrasky Kok added the comment:
Attached the preliminary fix and the unit test for this ticket.
--
Added file:
http://bugs.python.org/file30915/fix_and_unit_test_for_argparse_inner_bracket_bug.txt
___
Python tracker
<http://bugs.python.
New submission from Vajrasky Kok:
Attached the menial fix to unit test in test_xmlrpc.py.
--
components: Tests
files: fix_DateTimeTestCase.txt
messages: 193059
nosy: vajrasky
priority: normal
severity: normal
status: open
title: There are unused variables inside DateTimeTestCase class
Vajrasky Kok added the comment:
Okay, instead of using computer timer, I use mock object instead.
--
Added file:
http://bugs.python.org/file30920/fix_DateTimeTestCase_using_mock_object.txt
___
Python tracker
<http://bugs.python.org/issue18
New submission from Vajrasky Kok:
There is a typo in the name of function in test__encoded_words.py.
Python 3.4, Lib/test/test_email/test__encoded_words.py, line 78:
def test_q_escpaed_bytes_preserved(self):
It is supposed to be (I guess):
def test_q_escaped_bytes_preserved(self
Vajrasky Kok added the comment:
paul j3, thanks for reviewing my patch and giving me credit in your patch for
another ticket.
Yeah, as you could see, the reason I return arg_parts and text is because the
text still needs to undergo the cleanup process. You solved it by putting
cleaning up in
New submission from Vajrasky Kok:
The unit test file imports verbose from test.support, but it never used it.
The child2 variable inside testRemoveAttributeNode is not used.
The doc variable inside testHasChildNodes is not used.
Attached the menial fix for this unit test
New submission from Vajrasky Kok:
There is no unittest.main in Lib/test/test_email/test_inversion.py.
In other word, you can not execute the test by doing something like this:
[abcdef@localhost cpython]$ ./python Lib/test/test_email/test_inversion.py
Attached the menial fix
New submission from Vajrasky Kok:
In test_http2time_formats test function, they test many type of date & time
format, such as:
...
'Thu, 03 Feb 1994 00:00:00 GMT', # proposed new HTTP format
'Thursday, 03-Feb-94 00:00:00 GMT', # old rfc850 HTTP forma
New submission from Vajrasky Kok:
>From http.cookiejar module, we have http2time and iso2time functions.
We have unit test for http2time, but not for iso2time. That's not fair.
Attached the extended coverage test for iso2time function.
--
components: Tests
files: add_iso2time_
Vajrasky Kok added the comment:
The script for demonstrating bug can be simplified to:
---
import urllib.request
url =
"http://www.libon.it/ricerca/7817940/3499155443/dettaglio/3102314/Onkel-Oswald-und-der-Sudan-Käfer/
Vajrasky Kok added the comment:
I have no problem if this ticket is classified as "won't fix".
I am writing this for the confused souls who want to use urllib to access url
containing non-ascii characters:
import urllib.request
from urllib.parse import quote
url =
"
Vajrasky Kok added the comment:
Lars, I see.
For the uninitiated, the issue is the original url (containing only ascii
character) redirects to the url containing non-ascii characters which upsets
urllib.
To handle that situation, you can do something like this:
-
import
New submission from Vajrasky Kok:
In Lib/test/test_email/test_email.py, line 389, there is a unit test function:
def test_del_param_on_nonexistent_header(self):
msg = Message()
msg.del_param('filename', 'content-disposition')
There is no assertion her
Vajrasky Kok added the comment:
Anyway, I found another issue on line 393 on the same file:
def test_del_nonexistent_param(self):
msg = Message()
msg.add_header('Content-Type', 'text/plain', charset='utf-8')
existing_header = msg['C
New submission from Vajrasky Kok:
In Lib/test/test_email/test_email.py,
Part 1: line 4210 and 4217 have same function name, which is
test_encode_one_long_line. In fact, they have same function body!
def test_encode_one_long_line(self):
self._test_encode('x' * 100 +
Vajrasky Kok added the comment:
Fedora 18, this is the result after applying your patch and execute your unit
test:
[sky@localhost cpython]$ ./python Lib/test/test_resource.py
test_args (__main__.ResourceTest) ... ok
test_fsize_enforced (__main__.ResourceTest) ... ok
test_fsize_ismax
Vajrasky Kok added the comment:
I see.
Anyway, I am just curious. Why not doing try and catch?
def test_del_param_on_nonexistent_header(self):
msg = Message()
try:
msg.del_param('filename', 'content-disposition')
except:
Vajrasky Kok added the comment:
Another unused variable in line 2268 on function test_bad_multipart:
def test_bad_multipart(self):
eq = self.assertEqual
msg1 = Message()
msg1['Subject'] = 'subpart 1'
msg2 = Message()
msg2[
Vajrasky Kok added the comment:
Okay, next time I'll separate the problems into different tickets.
Here is the patch to clean up the test.
--
Added file: http://bugs.python.org/file30988/small_clean_up_to_test_email.txt
___
Python tracker
New submission from Vajrasky Kok:
[sky@localhost cpython]$ grep -n boudary Lib/email/generator.py
352:# _make_boudary = Generator._make_boundary
[sky@localhost cpython]$ grep -n fuzy Lib/email/architecture.rst
27:This division is intentionally a bit fuzy; the API described by this
Vajrasky Kok added the comment:
Sorry, my bad. The tuple pluralization is correct. I read it wrongly.
--
___
Python tracker
<http://bugs.python.org/issue18
Vajrasky Kok added the comment:
Here is the patch for this ticket.
David Murray, am I on the right path? If yes, I'll put more robust tests, such
as the ones with Asian encodings and unusual encodings.
--
Added file: http://bugs.python.org/file30997/set_payload_binar
Changes by Vajrasky Kok :
Removed file: http://bugs.python.org/file30997/set_payload_binary.txt
___
Python tracker
<http://bugs.python.org/issue18324>
___
___
Python-bug
Vajrasky Kok added the comment:
Sorry, got typo for the last patch.
--
Added file: http://bugs.python.org/file30998/set_payload_binary.txt
___
Python tracker
<http://bugs.python.org/issue18
Vajrasky Kok added the comment:
"It looks like you are still patching get_payload. This should be a really
simple patch against set_payload."
Okay, do I get it right at this time?
About your second point, I need more time to think about it.
--
Added file: http://bugs.
New submission from Vajrasky Kok:
Module colorsys has hsv_to_rgb, rgb_to_hsv, hls_to_rgb, rgb_to_hls, yiq_to_rgb,
rgb_to_yig public API functions. But only hsv_to_rgb, rgb_to_hsv, hls_to_rgb,
rgb_to_hls functions are being unit tested.
Attached the patch for adding unit test to cover the
Vajrasky Kok added the comment:
Here is the third version of the patch.
I am not sure what to do with the invalid data for base64 and uuencode. I
decided to raise exception instead of converting it to None silently.
--
Added file: http://bugs.python.org/file31049/set_payload_binary_v3
New submission from Vajrasky Kok:
There are two classes in Lib/test/test_abc.py, which are TestABC and
TestLegacyAPI.
Only TestABC is being unit tested.
Beside that TestLegacyAPI class has one duplicate test, which is
test_abstractmethod_integration with TestABC class.
--
components
Vajrasky Kok added the comment:
Something is not right if we use more than one space.
>>> textwrap.summarize('hello world!', width=12)
'hello world!'
>>> textwrap.summarize('hello world!', width=11)
'hello (...)'
>>>
Vajrasky Kok added the comment:
Beside of that, I notice the new lines are deleted silently.
>>> textwrap.summarize('republicans are red,\ndemocrats are blue,\nneither one
>>> of them,\ncares about you.', width=46)
'republ
New submission from Vajrasky Kok:
$ grep Inheirtable Lib/multiprocessing/*
Lib/multiprocessing/heap.py:# Inheirtable class which wraps an mmap, and from
which blocks can be allocated
--
assignee: docs@python
components: Documentation
messages: 193913
nosy: docs@python, vajrasky
Vajrasky Kok added the comment:
Monsieur Pitrou, thanks for the explanation. Actually, IMHO I prefer, 'hello
(...)' should be the minimum words we can use not '(...)' because '(...)' does
not make any sense. But, anyway, it's your call. :)
Vajrasky Kok added the comment:
Hi Catherine,
I saw your patch. It looks good, except you are trying to copy the directory
onto its subdirectory.
src_dir = tempfile.mkdtemp()
dst_dir = os.path.join(tempfile.mkdtemp(), 'destination')
I prefer it if you copy it to somewhere else. Thi
New submission from Vajrasky Kok:
Got typo in Modules/hashlib.h. See this patch for detail:
--- a/Modules/hashlib.h Wed Jul 31 20:48:26 2013 -0400
+++ b/Modules/hashlib.h Fri Aug 02 12:39:00 2013 +0800
@@ -2,7 +2,7 @@
/*
* Given a PyObject* obj, fill in the Py_buffer* viewp with the result
Vajrasky Kok added the comment:
"Is there a reason why there is no 'review' link? Could it be because the file
is uploaded as is rather than as a patch?"
I think I can answer this question. The answer is yes. You can have "review"
only if you use diff not
New submission from Vajrasky Kok:
This python is compiled with --with-pydebug option.
[sky@localhost cpython]$ cat /tmp/a.txt
manly man likes cute cat.
[sky@localhost cpython]$ ./python
Python 3.4.0a0 (default:e408e821d6c8, Jul 27 2013, 10:49:54)
[GCC 4.7.2 20121109 (Red Hat 4.7.2-8)] on linux
Vajrasky Kok added the comment:
Sorry, I forgot about stdin. Attached the patch to handle stdin gracefully.
--
Added file:
http://bugs.python.org/file31139/formatter_fix_resource_warning_v2.patch
___
Python tracker
<http://bugs.python.
Vajrasky Kok added the comment:
I guess I should not close stdin just in case people are using test function in
the script.
Attached the patch to only close the open files not stdin.
--
Added file:
http://bugs.python.org/file31140/formatter_fix_resource_warning_v3.patch
New submission from Vajrasky Kok:
Go to http://hg.python.org/cpython.
All ticket links (number preceded by #), such as #18567 refer to bugs in jython.
For example:
5 hours ago R David Murray Merge: #18657: remove duplicate entries from
Misc/ACKS.default tip
5 hours ago R David Murray
Vajrasky Kok added the comment:
Okay, it looks like it has been fixed. The format has changed as well.
Previously:
5 hours ago R David Murray Merge: #18657: remove duplicate entries from
Misc/ACKS.default tip
5 hours ago R David Murray #18657: remove duplicate entries from
Misc/ACKS
Vajrasky Kok added the comment:
Wait, something weird is happening in CPython commits log website,
http://hg.python.org/cpython .
These are the latest four commits.
age author description
45 hours agoJason R. Coombs Issue 18532: Added tests and
documentation to formally
New submission from Vajrasky Kok:
There is test_precision in Lib/test_format.py which is not being unit tested.
Also, there is a unused variable inside test_precision.
Attached the patch to fix these problems.
--
components: Tests
files: test_precision.patch
keywords: patch
messages
New submission from Vajrasky Kok:
I guess, there is a typo in Modules/grpmodule.c. See the patch below:
diff -r f4f81ebc3de9 Modules/grpmodule.c
--- a/Modules/grpmodule.c Sun Aug 04 15:50:08 2013 -0400
+++ b/Modules/grpmodule.c Mon Aug 05 17:40:33 2013 +0800
@@ -10,7 +10,7
Vajrasky Kok added the comment:
Let me help you to debug this issue.
ethan@amiau:~/Documents/code/python/cpython$ cat /tmp/a.py
import sys
INT_MAX = sys.maxsize
f = 1.2
format(f, ".%sf" % (INT_MAX + 1))
ethan@amiau:~/Documents/code/python/cpython$ ./python /tmp/a.py
Traceback (most r
Vajrasky Kok added the comment:
For now, instead of hardcoding INT_MAX to 2147483647 in test, maybe we can use
module:
>>> import IN
>>> IN.INT_MAX
2147483647
--
___
Python tracker
<http://bugs.
Vajrasky Kok added the comment:
For the passers-by who want to help:
The "precision too big" exception is raised in Python/formatter_unicode.c line
1168 and 1002.
The "Too many decimal digits..." exception is raised in
Python/formatter_unicode.c line 71.
So the quest
Vajrasky Kok added the comment:
Okay, I guess the fix for this ticket should be kept simple.
If we want to merge the exception message or touch the code base or do
something smarter than fixing the test, maybe we should create a separate
ticket.
So I used Serhiy Storchaka's suggestion t
Vajrasky Kok added the comment:
Attached the third patch. The importing _testcapi part was moved inside the
test. Added cpython support only decorator for this test.
--
Added file: http://bugs.python.org/file31169/test_precision_v3.patch
___
Python
New submission from Vajrasky Kok:
See the patch for details:
diff -r 438cdc97d8ee Include/frameobject.h
--- a/Include/frameobject.h Mon Aug 05 23:35:43 2013 +0200
+++ b/Include/frameobject.h Tue Aug 06 12:38:15 2013 +0800
@@ -36,7 +36,7 @@
non-generator frames. See the
New submission from Vajrasky Kok:
There is a unused variable in Lib/test/test_frame.py.
def test_clear_executing_generator(self):
# Attempting to clear an executing generator frame is forbidden.
endly = False
def g():
nonlocal endly
try
Vajrasky Kok added the comment:
Okay, attached the patch to fix the typo.
--
keywords: +patch
Added file: http://bugs.python.org/file31171/fix_typo_frame_object.patch
___
Python tracker
<http://bugs.python.org/issue18
New submission from Vajrasky Kok:
[sky@localhost cpython]$ cat /tmp/a.txt
x-application/mimea mimea
application/mimeb mimeb
[sky@localhost cpython]$ cat /tmp/a.py
import warnings
warnings.simplefilter('default')
import mimetypes
mimetypes.read_mime_types('/tmp/a.txt')
[s
1 - 100 of 574 matches
Mail list logo