[issue18799] Resurrect and fix test_404 in Lib/test/test_xmlrpc.py

2018-12-15 Thread Vajrasky Kok
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> ___ ___

[issue35519] Can not run test without test module for tests which import random module

2018-12-17 Thread Vajrasky Kok
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

[issue35519] [2.7] Can not run test without test module for tests which import random module

2018-12-17 Thread Vajrasky Kok
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

[issue18799] Resurrect and fix test_404 in Lib/test/test_xmlrpc.py

2018-12-17 Thread Vajrasky Kok
Change by Vajrasky Kok : -- pull_requests: +10435 ___ Python tracker <https://bugs.python.org/issue18799> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue19974] tarfile doesn't overwrite symlink by directory

2018-12-17 Thread Vajrasky Kok
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

[issue19974] tarfile doesn't overwrite symlink by directory

2019-01-06 Thread Vajrasky Kok
Change by Vajrasky Kok : -- pull_requests: +10895 stage: needs patch -> patch review ___ Python tracker <https://bugs.python.org/issue19974> ___ ___ Python-

[issue19974] tarfile doesn't overwrite symlink by directory

2019-01-06 Thread Vajrasky Kok
Change by Vajrasky Kok : -- pull_requests: +10895, 10896, 10898 stage: needs patch -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue19974] tarfile doesn't overwrite symlink by directory

2019-01-06 Thread Vajrasky Kok
Change by Vajrasky Kok : -- pull_requests: +10895, 10896 stage: needs patch -> patch review ___ Python tracker <https://bugs.python.org/issue19974> ___ ___ Py

[issue19974] tarfile doesn't overwrite symlink by directory

2019-01-06 Thread Vajrasky Kok
Change by Vajrasky Kok : -- pull_requests: +10895, 10896, 10897, 10898 stage: needs patch -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue19974] tarfile doesn't overwrite symlink by directory

2019-01-06 Thread Vajrasky Kok
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

[issue19974] tarfile doesn't overwrite symlink by directory

2019-01-06 Thread Vajrasky Kok
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

[issue19974] tarfile doesn't overwrite symlink by directory

2019-01-06 Thread Vajrasky Kok
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

[issue19974] tarfile doesn't overwrite symlink by directory

2019-01-06 Thread Vajrasky Kok
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

[issue19974] tarfile doesn't overwrite symlink by directory

2019-01-06 Thread Vajrasky Kok
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

[issue19974] tarfile doesn't overwrite symlink by directory

2019-01-06 Thread Vajrasky Kok
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

[issue19974] tarfile doesn't overwrite symlink by directory

2019-01-06 Thread Vajrasky Kok
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

[issue19791] test_pathlib should use can_symlink or skip_unless_symlink from test.support

2017-03-26 Thread Vajrasky Kok
Vajrasky Kok added the comment: Okay, Serhiy. I'll create a pull request. -- ___ Python tracker <http://bugs.python.org/issue19791> ___ ___ Python-bugs-list m

[issue19791] test_pathlib should use can_symlink or skip_unless_symlink from test.support

2017-03-26 Thread Vajrasky Kok
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

[issue18106] There are unused variables in Lib/test/test_collections.py

2013-05-31 Thread Vajrasky Kok
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

[issue18106] There are unused variables in Lib/test/test_collections.py

2013-05-31 Thread Vajrasky Kok
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

[issue18106] There are unused variables in Lib/test/test_collections.py

2013-05-31 Thread Vajrasky Kok
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

[issue18106] There are unused variables in Lib/test/test_collections.py

2013-06-01 Thread Vajrasky Kok
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

[issue18116] getpass.getpass() triggers ResourceWarning

2013-06-01 Thread Vajrasky Kok
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

[issue18116] getpass.getpass() triggers ResourceWarning

2013-06-02 Thread Vajrasky Kok
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

[issue18116] getpass.getpass() triggers ResourceWarning

2013-06-02 Thread Vajrasky Kok
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

[issue18116] getpass.getpass() triggers ResourceWarning

2013-06-02 Thread Vajrasky Kok
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

[issue18116] getpass.getpass() triggers ResourceWarning

2013-06-04 Thread Vajrasky Kok
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

[issue18116] getpass.getpass() triggers ResourceWarning

2013-06-06 Thread Vajrasky Kok
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

[issue18116] getpass.getpass() triggers ResourceWarning

2013-06-06 Thread Vajrasky Kok
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

[issue18150] Duplicate test inside TestSingleDispatch

2013-06-06 Thread Vajrasky Kok
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

[issue18150] Duplicate test inside TestSingleDispatch

2013-06-06 Thread Vajrasky Kok
Changes by Vajrasky Kok : Removed file: http://bugs.python.org/file30484/duplicate_test_for_testsingledispatch.diff ___ Python tracker <http://bugs.python.org/issue18

[issue18150] Duplicate test inside TestSingleDispatch

2013-06-06 Thread Vajrasky Kok
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

[issue18155] csv.Sniffer.has_header doesn't escape characters used in regex

2013-06-07 Thread Vajrasky Kok
Changes by Vajrasky Kok : Removed file: http://bugs.python.org/file30498/csv_has_header.diff ___ Python tracker <http://bugs.python.org/issue18155> ___ ___ Python-bug

[issue18155] csv.Sniffer.has_header doesn't escape characters used in regex

2013-06-07 Thread Vajrasky Kok
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

[issue18155] csv.Sniffer.has_header doesn't escape characters used in regex

2013-06-07 Thread Vajrasky Kok
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

[issue18155] csv.Sniffer.has_header doesn't escape characters used in regex

2013-06-07 Thread Vajrasky Kok
Changes by Vajrasky Kok : Removed file: http://bugs.python.org/file30499/csv_has_header.diff ___ Python tracker <http://bugs.python.org/issue18155> ___ ___ Python-bug

[issue18155] csv.Sniffer.has_header doesn't escape characters used in regex

2013-06-07 Thread Vajrasky Kok
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

[issue18106] There are unused variables in Lib/test/test_collections.py

2013-06-09 Thread Vajrasky Kok
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

[issue17324] SimpleHTTPServer serves files even if the URL has a trailing slash

2013-07-08 Thread Vajrasky Kok
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

[issue18352] collections.Counter with added attributes are not deepcopied properly.

2013-07-10 Thread Vajrasky Kok
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. >>

[issue18324] set_payload does not handle binary payloads correctly

2013-07-10 Thread Vajrasky Kok
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.

[issue18324] set_payload does not handle binary payloads correctly

2013-07-10 Thread Vajrasky Kok
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

[issue18437] Typo in comment inside class Charset about output_charset

2013-07-12 Thread Vajrasky Kok
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

[issue18438] Obsolete url in comment inside decimal module

2013-07-12 Thread Vajrasky Kok
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

[issue11874] argparse assertion failure with brackets in metavars

2013-07-13 Thread Vajrasky Kok
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 ('

[issue11874] argparse assertion failure with brackets in metavars

2013-07-13 Thread Vajrasky Kok
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

[issue11874] argparse assertion failure with brackets in metavars

2013-07-13 Thread Vajrasky Kok
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

[issue11874] argparse assertion failure with brackets in metavars

2013-07-14 Thread Vajrasky Kok
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

[issue11874] argparse assertion failure with brackets in metavars

2013-07-14 Thread Vajrasky Kok
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.

[issue18453] There are unused variables inside DateTimeTestCase class in test_xmlrpc.py

2013-07-14 Thread Vajrasky Kok
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

[issue18453] There are unused variables inside DateTimeTestCase class in test_xmlrpc.py

2013-07-14 Thread Vajrasky Kok
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

[issue18464] Typo in the name of function in test__encoded_words.py

2013-07-15 Thread Vajrasky Kok
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

[issue11874] argparse assertion failure with brackets in metavars

2013-07-15 Thread Vajrasky Kok
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

[issue18465] There are unused variables and unused import in Lib/test/test_minidom.py

2013-07-15 Thread Vajrasky Kok
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

[issue18475] No unittest.main in Lib/test/test_email/test_inversion.py

2013-07-16 Thread Vajrasky Kok
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

[issue18483] Add hour-24 type of time to test_http2time_formats in test_http_cookiejar.py

2013-07-17 Thread Vajrasky Kok
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

[issue18484] No unit test for iso2time function from http.cookiejar module

2013-07-17 Thread Vajrasky Kok
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_

[issue17214] http.client.HTTPConnection.putrequest encode error

2013-07-18 Thread Vajrasky Kok
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/

[issue17214] http.client.HTTPConnection.putrequest encode error

2013-07-18 Thread Vajrasky Kok
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 = "

[issue17214] http.client.HTTPConnection.putrequest encode error

2013-07-18 Thread Vajrasky Kok
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

[issue18503] No assertion in test_del_param_on_nonexistent_header function

2013-07-19 Thread Vajrasky Kok
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

[issue18503] No assertion in test_del_param_on_nonexistent_header function

2013-07-19 Thread Vajrasky Kok
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

[issue18505] Duplicate function names in test_email.py

2013-07-19 Thread Vajrasky Kok
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 + 

[issue16595] Add resource.prlimit

2013-07-19 Thread Vajrasky Kok
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

[issue18503] No assertion in test_del_param_on_nonexistent_header function

2013-07-19 Thread Vajrasky Kok
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:

[issue18503] No assertion in test_del_param_on_nonexistent_header function and unused variables in some places in test_email.py

2013-07-19 Thread Vajrasky Kok
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[&#x

[issue18503] No assertion in test_del_param_on_nonexistent_header function and unused variables in some places in test_email.py

2013-07-19 Thread Vajrasky Kok
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

[issue18516] Typos in Lib/email/generator.py and Lib/email/architecture.rst

2013-07-20 Thread Vajrasky Kok
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

[issue18516] Typos in Lib/email/generator.py and Lib/email/architecture.rst

2013-07-21 Thread Vajrasky Kok
Vajrasky Kok added the comment: Sorry, my bad. The tuple pluralization is correct. I read it wrongly. -- ___ Python tracker <http://bugs.python.org/issue18

[issue18324] set_payload does not handle binary payloads correctly

2013-07-21 Thread Vajrasky Kok
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

[issue18324] set_payload does not handle binary payloads correctly

2013-07-21 Thread Vajrasky Kok
Changes by Vajrasky Kok : Removed file: http://bugs.python.org/file30997/set_payload_binary.txt ___ Python tracker <http://bugs.python.org/issue18324> ___ ___ Python-bug

[issue18324] set_payload does not handle binary payloads correctly

2013-07-21 Thread Vajrasky Kok
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

[issue18324] set_payload does not handle binary payloads correctly

2013-07-21 Thread Vajrasky Kok
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.

[issue18563] No unit test for yiq to rgb and rgb to yiq converting functions

2013-07-26 Thread Vajrasky Kok
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

[issue18324] set_payload does not handle binary payloads correctly

2013-07-26 Thread Vajrasky Kok
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

[issue18581] Duplicate test and missing class test in test_abc.py

2013-07-28 Thread Vajrasky Kok
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

[issue18585] Add a text truncation function

2013-07-29 Thread Vajrasky Kok
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 (...)' >>>

[issue18585] Add a text truncation function

2013-07-29 Thread Vajrasky Kok
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

[issue18593] Typo in Lib/multiprocessing/heap.py

2013-07-29 Thread Vajrasky Kok
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

[issue18585] Add a text truncation function

2013-07-30 Thread Vajrasky Kok
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. :)

[issue1666318] shutil.copytree doesn't give control over directory permissions

2013-07-31 Thread Vajrasky Kok
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

[issue18627] Typo in Modules/hashlib.h

2013-08-01 Thread Vajrasky Kok
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

[issue18606] Add statistics module to standard library

2013-08-03 Thread Vajrasky Kok
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

[issue18644] Got ResourceWarning: unclosed file when using test function from formatter module

2013-08-03 Thread Vajrasky Kok
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

[issue18644] Got ResourceWarning: unclosed file when using test function from formatter module

2013-08-03 Thread Vajrasky Kok
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.

[issue18644] Got ResourceWarning: unclosed file when using test function from formatter module

2013-08-03 Thread Vajrasky Kok
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

[issue18658] Mercurial CPython log ticket link is broken

2013-08-04 Thread Vajrasky Kok
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

[issue18658] Mercurial CPython log ticket link is broken

2013-08-04 Thread Vajrasky Kok
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

[issue18658] Mercurial CPython log ticket link is broken

2013-08-05 Thread Vajrasky Kok
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

[issue18659] test_precision in test_format.py is not executed and has unused variable

2013-08-05 Thread Vajrasky Kok
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

[issue18661] Typo in grpmodule.c

2013-08-05 Thread Vajrasky Kok
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

[issue18659] test_precision in test_format.py is not executed and has unused variable

2013-08-05 Thread Vajrasky Kok
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

[issue18659] test_precision in test_format.py is not executed and has unused variable

2013-08-05 Thread Vajrasky Kok
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.

[issue18659] test_precision in test_format.py is not executed and has unused variable

2013-08-05 Thread Vajrasky Kok
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

[issue18659] test_precision in test_format.py is not executed and has unused variable

2013-08-05 Thread Vajrasky Kok
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

[issue18659] test_precision in test_format.py is not executed and has unused variable

2013-08-05 Thread Vajrasky Kok
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

[issue18665] Typos in frame object related code

2013-08-05 Thread Vajrasky Kok
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

[issue18666] Unused variable in test_frame.py

2013-08-05 Thread Vajrasky Kok
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

[issue18665] Typos in frame object related code

2013-08-05 Thread Vajrasky Kok
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

[issue18670] Using read_mime_types function from mimetypes module gives resource warning

2013-08-06 Thread Vajrasky Kok
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   2   3   4   5   6   >