[issue18678] Wrong struct members name for spwd module

2013-08-07 Thread Vajrasky Kok
New submission from Vajrasky Kok: Both python2 and python3 have this behaviour. >>> import os; os.getuid() 0 >>> 'I am root' 'I am root' >>> import spwd >>> spwd.getspnam('bin') spwd.struct_spwd(sp_nam='bin',

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

2013-08-11 Thread Vajrasky Kok
Vajrasky Kok added the comment: Attached the second patch to use addCleanup rather than tear down method. Also, I added the non-existent file case. -- Added file: http://bugs.python.org/file31232/fix_resource_warning_read_mime_types_v2.patch

[issue18702] Report skipped tests as skipped

2013-08-11 Thread Vajrasky Kok
Vajrasky Kok added the comment: I read the patch. It looks good. Anyway, I have two questions: 1. I saw 3 variants of writing description for skipping test descriptor: requires os.mkfifo test needs socket.inet_pton() needs os.read Which one is the preferred way to go? "requires"

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

2013-08-12 Thread Vajrasky Kok
Vajrasky Kok added the comment: Thanks, Benjamin, for reviewing my patch. Attached the fourth patch to wrap the "business" part inside the try ... finally. -- Added file: http://bugs.python.org/file31237/formatter_fix_resource_warnin

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

2013-08-12 Thread Vajrasky Kok
Vajrasky Kok added the comment: Ah, sorry about that. Attached the fifth patch to only wrap "for loop" section inside the try... finally. -- Added file: http://bugs.python.org/file31238/formatter_fix_resource_warning_v5.patch ___ Pyth

[issue18394] cgi.FieldStorage triggers ResourceWarning sometimes

2013-08-12 Thread Vajrasky Kok
Vajrasky Kok added the comment: It happens because if the length of data is more than 1000: def __write(self, line): """line is always bytes, not string""" if self.__file is not None: if self.__file.tell() + len(line) >

[issue18700] test_cgi raises ResourceWarning

2013-08-12 Thread Vajrasky Kok
Vajrasky Kok added the comment: Superseded by bug #18394. Should we close this one by marking it as duplicate? -- nosy: +vajrasky ___ Python tracker <http://bugs.python.org/issue18

[issue18723] shorten function of textwrap module is susceptible to non-normalized whitespaces

2013-08-12 Thread Vajrasky Kok
New submission from Vajrasky Kok: In shorten function of textwrap module, the placeholder becomes a hole where we can inject non-normalized whitespaces to the text. >>> text = "Hello there, how are you this fine day? I'm glad to hear it!" >>> from textwrap im

[issue18723] shorten function of textwrap module is susceptible to non-normalized whitespaces

2013-08-12 Thread Vajrasky Kok
Vajrasky Kok added the comment: Okay, nevermind about non-normalized whitespaces in placeholder, but what about this case? >>> text = "Hello there, how are you this fine day? I'm glad to hear it!" >>> from textwrap import shorten >>> shorten(text, 10

[issue18723] shorten function of textwrap module is susceptible to non-normalized whitespaces

2013-08-13 Thread Vajrasky Kok
Vajrasky Kok added the comment: > Do you want to write a patch? My pleasure. Attached the second version of the patch to accomodate Pitrou's request. -- Added file: http://bugs.python.org/file31274/fix_for_non_normalized_whitespaces_in_placeholder_

[issue18723] shorten function of textwrap module is susceptible to non-normalized whitespaces

2013-08-13 Thread Vajrasky Kok
Vajrasky Kok added the comment: Attached more refined patch. Removed unnecessary test. Added more robust test. Added shorten in __all__. -- Added file: http://bugs.python.org/file31275/fix_for_non_normalized_whitespaces_in_placeholder_v3.patch

[issue18723] shorten function of textwrap module is susceptible to non-normalized whitespaces

2013-08-13 Thread Vajrasky Kok
Changes by Vajrasky Kok : Removed file: http://bugs.python.org/file31275/fix_for_non_normalized_whitespaces_in_placeholder_v3.patch ___ Python tracker <http://bugs.python.org/issue18

[issue18723] shorten function of textwrap module is susceptible to non-normalized whitespaces

2013-08-13 Thread Vajrasky Kok
Changes by Vajrasky Kok : Added file: http://bugs.python.org/file31276/fix_for_non_normalized_whitespaces_in_placeholder_v3.patch ___ Python tracker <http://bugs.python.org/issue18

[issue18725] Multiline shortening

2013-08-13 Thread Vajrasky Kok
Vajrasky Kok added the comment: What about newline keyword argument? Are we forcing the newline to be '\n'? Alternate newlines will be useful for Windows platform ('\r\n') and HTML platform (''). -- ___ Python tr

[issue18723] shorten function of textwrap module is susceptible to non-normalized whitespaces

2013-08-13 Thread Vajrasky Kok
Vajrasky Kok added the comment: I missed this case: >>> from textwrap import shorten >>> shorten('hell', 4) Traceback (most recent call last): File "", line 1, in File "/home/sky/Code/python/programming_language/cpython/Lib/textwrap.py",

[issue18723] shorten function of textwrap module is susceptible to non-normalized whitespaces

2013-08-13 Thread Vajrasky Kok
Vajrasky Kok added the comment: Okay, attached the fifth version not to care about the case where text is smaller than the placeholder. -- Added file: http://bugs.python.org/file31278/fix_for_non_normalized_whitespaces_in_placeholder_v5.patch

[issue18728] Increased test coverage for filecmp.py

2013-08-13 Thread Vajrasky Kok
Vajrasky Kok added the comment: Hi Alex. Typo in "#Speicify subdirectories to hide". I think you should not create WIN32 constant. Use this statement instead: @unittest.skipIf(sys.platform == "win32", "Not valid on Windows") I think you should use addCle

[issue18745] Test enum in test_json is ignorant of infinity value

2013-08-15 Thread Vajrasky Kok
New submission from Vajrasky Kok: Test enum json in Lib/test/test_json/test_enum.py is ignorant of infinity values. Also, NaN, but since NaN is a weirdo, let's not take that into account. The unit test should represent of what will work in every case. For example: def test_floats

[issue18768] Wrong documentation of RAND_egd function in ssl module

2013-08-17 Thread Vajrasky Kok
New submission from Vajrasky Kok: >>> import ssl >>> ssl.RAND_egd.__doc__ "RAND_egd(path) -> bytes\n\nQueries the entropy gather daemon (EGD) on the socket named by 'path'.\nReturns number of bytes read. Raises SSLError if connection to EGD\nfails or if

[issue18773] When a signal handler fails to write to the file descriptor registered with ``signal.set_wakeup_fd()``, an exception does not report the file descriptor

2013-08-17 Thread Vajrasky Kok
New submission from Vajrasky Kok: When a signal handler fails to write to the file descriptor registered with ``signal.set_wakeup_fd()``, an exception does not report which the file descriptor is the problematic one. Attached the patch to put the file descriptor in the aforementioned

[issue18773] When a signal handler fails to write to the file descriptor registered with ``signal.set_wakeup_fd()``, an exception does not report the file descriptor

2013-08-17 Thread Vajrasky Kok
Vajrasky Kok added the comment: Same patch, but more pep8 compliant. -- Added file: http://bugs.python.org/file31347/add_file_descriptor_to_exception_signal_set_wakeup_fd_v2.patch ___ Python tracker <http://bugs.python.org/issue18

[issue18773] When a signal handler fails to write to the file descriptor registered with ``signal.set_wakeup_fd()``, an exception does not report the file descriptor

2013-08-17 Thread Vajrasky Kok
Vajrasky Kok added the comment: Sorry, When I read "... wakeup fd:\n" my subconsciousness mind automatically translated it to "... wakeup fd: %d\n". Then you made me realized there is another error message below it. I closed this ticket as invalid. -- resolution

[issue18774] There is still last bit of GNU Pth code in signalmodule.c

2013-08-17 Thread Vajrasky Kok
New submission from Vajrasky Kok: I read this commit: http://hg.python.org/cpython/rev/1d5f644b9241 But I noticed there is still GNU Pth code lingering around in Modules/signalmodule.c. Beside of that the WITH_PTH code (in the same file) is expired already. If you configure python with this

[issue18678] Wrong struct members name for spwd module

2013-08-18 Thread Vajrasky Kok
Vajrasky Kok added the comment: Attached the patch to accommodate R. David Murray's request. Accessing invalid attributes such as sp_nam and sp_pwd from spwd tuple will generate deprecation warning message. Also, I added test function so we can run spwd module directly. This is u

[issue18779] Misleading documentations and comments in regular expression about alphanumerics and underscore

2013-08-19 Thread Vajrasky Kok
New submission from Vajrasky Kok: According to: http://oald8.oxfordlearnersdictionaries.com/dictionary/alphanumeric http://en.wikipedia.org/wiki/Alphanumeric Alphanumeric is defined as [A-Za-z0-9]. Underscore (_) is not one of them. One of the documentation in Python (Doc/tutorial/stdlib2.rst

[issue18779] Misleading documentations and comments in regular expression HOWTO

2013-08-19 Thread Vajrasky Kok
Vajrasky Kok added the comment: In Lib/re.py, starting from line 77 (Python 3.4): \w Matches any alphanumeric character; equivalent to [a-zA-Z0-9_] in bytes patterns or string patterns with the ASCII flag. In string patterns without the ASCII flag, it will

[issue18781] re.escape escapes underscore (Python 2.7)

2013-08-19 Thread Vajrasky Kok
New submission from Vajrasky Kok: $ ./python --version Python 2.7.5+ $ ./python Python 2.7.5+ (2.7:062533327ad2, Aug 19 2013, 22:44:52) [GCC 4.7.2 20121109 (Red Hat 4.7.2-8)] on linux2 Type "help", "copyright", "credits" or "license" for more

[issue18787] Misleading error from getspnam function of spwd module

2013-08-19 Thread Vajrasky Kok
New submission from Vajrasky Kok: As root: $ sudo python3 [sudo] password for ethan: Python 3.2.3 (default, Apr 10 2013, 05:07:54) [GCC 4.7.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import spwd &

[issue18787] Misleading error from getspnam function of spwd module

2013-08-20 Thread Vajrasky Kok
Vajrasky Kok added the comment: Attached the patch to accomodate Serhiy Storchaka's suggestion by using KeyError exception for backward compatibility. -- Added file: http://bugs.python.org/file31382/fix_error_message_getspnam_v2.patch ___ P

[issue10388] spwd returning different value depending on privileges

2013-08-20 Thread Vajrasky Kok
Vajrasky Kok added the comment: Attached the patch to raise OSError instead of returning empty list if a normal user uses getspall function of spwd module. I investigated about this issue. There exists situation where /etc/shadow file does not exist: https://bugs.kde.org/show_bug.cgi?id

[issue18787] Misleading error from getspnam function of spwd module

2013-08-20 Thread Vajrasky Kok
Vajrasky Kok added the comment: Sorry about that. Okay, so for now, we wait for other people's suggestion, which way we should use to handle this situation? -- ___ Python tracker <http://bugs.python.org/is

[issue18796] Wrong documentation of show_code function from dis module

2013-08-20 Thread Vajrasky Kok
New submission from Vajrasky Kok: $ ./python Python 3.4.0a1+ (default:afb1b4797419, Aug 21 2013, 09:54:46) [GCC 4.7.2] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import dis >>> import sys >&

[issue18798] Typo and unused variables in test fcntl

2013-08-21 Thread Vajrasky Kok
New submission from Vajrasky Kok: Typo in line 11: # Skip test if no fnctl module. Unused variables rv in test_fcntl_file_descriptor method. Attached the patch to clean up the test. -- components: Tests files: fix_typo_unused_variables_in_test_fcntl.patch keywords: patch messages

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

2013-08-21 Thread Vajrasky Kok
New submission from Vajrasky Kok: There is a dormant test in Lib/test/test_xmlrpc.py (line 579): # [ch] The test 404 is causing lots of false alarms. def XXXtest_404(self): # send POST with http.client, it should return 404 header and # 'Not Found' message.

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

2013-08-22 Thread Vajrasky Kok
Vajrasky Kok added the comment: Yes, I agree with you, R. David Murray. But there are some reasons why I try to resurrect this dormant test: 1. This test was disabled on 19 January 2008. http://hg.python.org/cpython/rev/859bf85a556a It has been more than 5 years. Many things happened. 2. In

[issue15204] Deprecate the 'U' open mode

2013-08-22 Thread Vajrasky Kok
Vajrasky Kok added the comment: http://bugs.python.org/review/15204/diff/9032/Tools/iobench/iobench.py Line 10 in New: import io But io module is never used. -- nosy: +vajrasky ___ Python tracker <http://bugs.python.org/issue15

[issue18747] Re-seed OpenSSL's PRNG after fork

2013-08-22 Thread Vajrasky Kok
Vajrasky Kok added the comment: Some typos on last commit "current time (miliseconds or seconds) and an uninitialized arry." should be "current time (miliseconds or seconds) and an uninitialized array." "instead of a child handler because fork() is suppose to be

[issue18817] Got resource warning when running Lib/aifc.py

2013-08-22 Thread Vajrasky Kok
New submission from Vajrasky Kok: The python is compiled with debug option. cpython$ ./python Lib/aifc.py Lib/test/sndhdrdata/sndhdr.aiff Reading Lib/test/sndhdrdata/sndhdr.aiff nchannels = 2 nframes = 5 sampwidth = 2 framerate = 44100 comptype = b'NONE' compname = b'not co

[issue18829] csv produces confusing error message when passed a non-string delimiter

2013-08-25 Thread Vajrasky Kok
Vajrasky Kok added the comment: This is the preliminary patch to fix the error message. -- keywords: +patch nosy: +vajrasky Added file: http://bugs.python.org/file31462/fix_error_message_reader_csv.patch ___ Python tracker <http://bugs.python.

[issue18829] csv produces confusing error message when passed a non-string delimiter

2013-08-25 Thread Vajrasky Kok
Vajrasky Kok added the comment: This is the second alternative of the patch to fix the error message using different approach. I am not sure which one is better. -- Added file: http://bugs.python.org/file31463/fix_error_message_reader_csv_alternative_1.patch

[issue18829] csv produces confusing error message when passed a non-string delimiter

2013-08-25 Thread Vajrasky Kok
Vajrasky Kok added the comment: I realized there was a test that was similar with my test. I merged them into one test. I think the alternative is better than the original patch so I updated the alternative patch only. -- Added file: http://bugs.python.org/file31467

[issue18829] csv produces confusing error message when passed a non-string delimiter

2013-08-26 Thread Vajrasky Kok
Vajrasky Kok added the comment: Apparently, other attributes of the csv dialect beside delimiter, such as escapechar and quotechar share the same problem. >>> import _csv >>> _csv.reader('foo', quotechar=b'"') Traceback (most recent call last): Fil

[issue18853] Got ResourceWarning unclosed file when running Lib/shlex.py demo

2013-08-27 Thread Vajrasky Kok
New submission from Vajrasky Kok: The python is compiled with --with-pydebug flag. [sky@localhost cpython]$ cat /tmp/quote.txt manly "man" likes 'cute "cat"' [sky@localhost cpython]$ ./python Lib/shlex.py /tmp/quote.txt Token: 'manly' Token: '&quo

[issue18830] Remove duplicates from a result of getclasstree()

2013-08-27 Thread Vajrasky Kok
Vajrasky Kok added the comment: What about if you extend the test coverage as well? Right now, we don't have test to test getclasstree method with unique parameter set to false. -- nosy: +vajrasky ___ Python tracker <http://bugs.py

[issue18904] Unnecessary test in file descriptor inheritance test

2013-09-01 Thread Vajrasky Kok
New submission from Vajrasky Kok: In Lib/test/test_os.py in class FDInheritanceTests, we have an unnecessary test, which is test_set_inheritable. What test_set_inheritable tests is already being covered by test_get_inheritable. Also, I think test_get_inheritable should be renamed to

[issue18745] Test enum in test_json is ignorant of infinity value

2013-09-01 Thread Vajrasky Kok
Vajrasky Kok added the comment: To test the infinity, negative infinity, and NaN (Not a Number), you named the test as test_weird_floats. So implicitely, you admitted that they are floats but just weird. Yet, you named the sample data test class as NotNum. Implicitely, you were saying they

[issue18829] csv produces confusing error message when passed a non-string delimiter

2013-09-05 Thread Vajrasky Kok
Vajrasky Kok added the comment: Attached the patch to accomodate Ezio Melotti's request. The patch now have two separate errors for "wrong type" and "right type, wrong length". Don't we break compatibility by changing the type of exception from TypeError to Valu

[issue18829] csv produces confusing error message when passed a non-string delimiter

2013-09-05 Thread Vajrasky Kok
Vajrasky Kok added the comment: Same as fix_error_message_reader_csv_alternative_1_v4.patch (by Serhiy), but I removed unused variables in the test. -- Added file: http://bugs.python.org/file31614/fix_error_message_reader_csv_alternative_1_v5.patch

[issue18953] Typo in NEWS about fixed format specifiers for Py_ssize_t in debugging output in the _sre module

2013-09-06 Thread Vajrasky Kok
New submission from Vajrasky Kok: File Misc/NEWS, line 65 & 66: - Issue #18672: Fixed format specifiers for Py_ssize_t in debugging output in the _sre moduel. "moduel" => "module" Related commit: http://hg.python.org/cpython/rev/c41c68a18bb6 -- assig

[issue18954] Grammatically incorrect sentences in Python/fileutils.c

2013-09-06 Thread Vajrasky Kok
New submission from Vajrasky Kok: In commit about "implementation of the PEP 446: file descriptors and file handles are now created non-inheritable", there are some grammatically incorrect sentences in Python/fileutils.c. Please see the patch for details. Related commit: http://hg.

[issue18955] Confusing documentation in Lib/importlib/util.py

2013-09-06 Thread Vajrasky Kok
New submission from Vajrasky Kok: In Lib/importlib/util.py, the documentation is confusing me. Line 42 & 43: If an exception is raised and the decorator created the module it is subsequently removed from sys.modules. Is it supposed to be: "If an exception is raise

[issue18957] PYTHONFAULTHANDLER enables faulthandler when the variable is empty

2013-09-07 Thread Vajrasky Kok
Vajrasky Kok added the comment: Do you mean something like *this*? this -> the patch, pythonfaulthandler_env_var.patch. -- keywords: +patch nosy: +vajrasky Added file: http://bugs.python.org/file31641/pythonfaulthandler_env_var.patch ___ Pyt

[issue18955] Confusing documentation in Lib/importlib/util.py

2013-09-07 Thread Vajrasky Kok
Vajrasky Kok added the comment: That would help. -- ___ Python tracker <http://bugs.python.org/issue18955> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue18829] csv produces confusing error message when passed a non-string delimiter

2013-09-07 Thread Vajrasky Kok
Vajrasky Kok added the comment: I noticed in CPython source code, when we print the type of the object, we use "%.200s" not "%s". For example, in Modules/posixmodule.c: "uid should be integer, not %.200s", So the newest path was created to conform with this tradi

[issue18958] Exception('No JSON object could be decoded') when parsing a valid JSON

2013-09-07 Thread Vajrasky Kok
Vajrasky Kok added the comment: >>> a = open('/tmp/input.json') >>> b = a.read() >>> b[0] '\ufeff' >>> import json >>> json.loads(b[1:]) loads just fine >>> json.loads(b) chokes. Whether python json module shoul

[issue18958] Exception('No JSON object could be decoded') when parsing a valid JSON

2013-09-07 Thread Vajrasky Kok
Vajrasky Kok added the comment: The U+FEFF character is related with Byte order mark. Reference: http://en.wikipedia.org/wiki/Byte_Order_Mark -- ___ Python tracker <http://bugs.python.org/issue18

[issue18829] csv produces confusing error message when passed a non-string delimiter

2013-09-08 Thread Vajrasky Kok
Vajrasky Kok added the comment: Well, what about None? $ python3 -c 'import csv; reader = csv.reader("foo", delimiter=None)' Traceback (most recent call last): File "", line 1, in TypeError: delimiter must be set English grammatically speaking, we should get

[issue18829] csv produces confusing error message when passed a non-string delimiter

2013-09-08 Thread Vajrasky Kok
Vajrasky Kok added the comment: David R. Murray said, '"delimiter must be a 1 character string" would cover it.' You mean $ ./python -c 'import csv; reader = csv.reader("foo", delimiter="")' should give this error '"delimiter"

[issue18829] csv produces confusing error message when passed a non-string delimiter

2013-09-08 Thread Vajrasky Kok
Vajrasky Kok added the comment: Sorry for typing your name wrongly. s/David R. Murray/R. David Murray/ -- ___ Python tracker <http://bugs.python.org/issue18

[issue18973] Use argparse in the calendar module

2013-09-08 Thread Vajrasky Kok
Vajrasky Kok added the comment: I don't see any patches. You forgot to upload the patch? -- nosy: +vajrasky ___ Python tracker <http://bugs.python.org/is

[issue18829] csv produces confusing error message when passed a non-string delimiter

2013-09-08 Thread Vajrasky Kok
Vajrasky Kok added the comment: After contemplating for a while, I am not sure that we should treat empty string for delimiter with error message: '"delimiter" must be an 1-character string'. The reason is to keep consistency with quotechar keyword. [sky@localhost c

[issue18985] Improve the documentation in fcntl module

2013-09-09 Thread Vajrasky Kok
New submission from Vajrasky Kok: The attached patch fixed typos and improved the documentation to improve the clarity in Modules/fcntlmodule.c. Please see the attached patch and feel free to disagree with the improvement. -- assignee: docs@python components: Documentation files

[issue18993] There is an overshadowed and invalid test in testmock.py

2013-09-09 Thread Vajrasky Kok
New submission from Vajrasky Kok: In Lib/unittest/test/testmock/testmock.py, there are two test_attribute_deletion. One of them is overshadowed (not executed) by the other. def test_attribute_deletion(self): # this behaviour isn't *useful*, but at least it's

[issue18994] Inside fcntl module, we does not check the return code of all_ins function

2013-09-10 Thread Vajrasky Kok
New submission from Vajrasky Kok: In Modules/fcntlmodule.c, there is a code to insert symbolic constants to the module. all_ins(m); But we don't check the return code of the function whether it is successful or not, unlike in posix module in which we check it. if (all_

[issue18995] Enum does not work with reversed

2013-09-10 Thread Vajrasky Kok
New submission from Vajrasky Kok: cutecat@amiau:~/cpython$ cat /tmp/innerplanets.py from enum import Enum class innerplanets(Enum): mercury = 1 venus = 2 earth = 3 mars = 4 for planet in innerplanets: print(planet) for planet in reversed(innerplanets): print(planet

[issue18995] Enum does not work with reversed

2013-09-11 Thread Vajrasky Kok
Vajrasky Kok added the comment: Simplified unit test. I reused enum Season in the test class. By the way, there is another way to add support for enum without implementing __reversed__ method, which is adding support indexing by number (in __getitem__ method), e.g. Season[1] => Season.SPR

[issue21058] tempfile.NamedTemporaryFile leaks file descriptor when fdopen fails

2014-03-25 Thread Vajrasky Kok
Vajrasky Kok added the comment: There is a typo. s/io.pen/io.open/ -- keywords: +patch nosy: +vajrasky Added file: http://bugs.python.org/file34617/fix_typo_21058.patch ___ Python tracker <http://bugs.python.org/issue21

[issue20668] Remove dependency on tests.txt when running test_asyncio suite

2014-03-31 Thread Vajrasky Kok
Vajrasky Kok added the comment: Thanks for committing my patch, Yury. But you forgot to remove Lib/test/test_asyncio/tests.txt. -- ___ Python tracker <http://bugs.python.org/issue20

[issue19925] Add unit test for spwd module

2014-05-25 Thread Vajrasky Kok
Vajrasky Kok added the comment: Thanks, Serhiy, for the review! Here is the updated patch. -- Added file: http://bugs.python.org/file35347/unittest_for_spwd_v3.patch ___ Python tracker <http://bugs.python.org/issue19

[issue20689] socket.AddressFamily is absent in html pydoc

2014-05-27 Thread Vajrasky Kok
Vajrasky Kok added the comment: I found the culprit. The AddressFamily is not registered in _socket module. I created a preliminary patch to show the culprit. -- keywords: +patch nosy: +vajrasky Added file: http://bugs.python.org/file35379/pydoc_display_AddressFamily.patch

[issue21599] Argument transport in attach and detach method in Server class in base_events file is not used

2014-05-28 Thread Vajrasky Kok
New submission from Vajrasky Kok: In Lib/asyncio/base_events.py, we have these lines of code: --- def attach(self, transport): assert self.sockets is not None self.active_count += 1 def detach(self, transport

[issue21592] Make statistics.median run in linear time

2014-05-28 Thread Vajrasky Kok
Vajrasky Kok added the comment: Yeah, I remember I tried to improve the performance of the median in the past using median-of-k algorithm. But too bad I could not beat sorted C function efficiency. Maybe you have a better luck! -- nosy: +vajrasky

[issue21601] Cancel method for Asyncio Task is not documented

2014-05-28 Thread Vajrasky Kok
New submission from Vajrasky Kok: https://docs.python.org/3.5/library/asyncio-task.html#task The cancel method is not documented although it is a part of public API. Here is the patch to fix the doc. -- assignee: docs@python components: Documentation files: fix_doc_asyncio_task.patch

[issue21476] Inconsitent behaviour between BytesParser.parse and Parser.parse

2014-05-30 Thread Vajrasky Kok
Vajrasky Kok added the comment: Here is the simple patch based on David Murray's thought. -- keywords: +patch nosy: +vajrasky Added file: http://bugs.python.org/file35413/bytes_parser_dont_close_file.patch ___ Python tracker <http://bugs.py

[issue21476] Inconsitent behaviour between BytesParser.parse and Parser.parse

2014-05-30 Thread Vajrasky Kok
Vajrasky Kok added the comment: Thank you, Serhiy, for the review! Here is the updated patch. -- Added file: http://bugs.python.org/file35418/bytes_parser_dont_close_file_v2.patch ___ Python tracker <http://bugs.python.org/issue21

[issue19145] Inconsistent behaviour in itertools.repeat when using negative times

2014-05-30 Thread Vajrasky Kok
Changes by Vajrasky Kok : -- versions: +Python 3.5 -Python 3.4 ___ Python tracker <http://bugs.python.org/issue19145> ___ ___ Python-bugs-list mailing list Unsub

[issue21476] Inconsitent behaviour between BytesParser.parse and Parser.parse

2014-05-31 Thread Vajrasky Kok
Vajrasky Kok added the comment: Serhiy, here is the latest patch incorporating your request. -- Added file: http://bugs.python.org/file35420/bytes_parser_dont_close_file_v3.patch ___ Python tracker <http://bugs.python.org/issue21

[issue21476] Inconsitent behaviour between BytesParser.parse and Parser.parse

2014-05-31 Thread Vajrasky Kok
Vajrasky Kok added the comment: The Parse class does not throw exception if given invalid message: Assume /tmp/a.txt contains garbage, such as: "&&&&&" With this code: with open("/tmp/a.txt", "r") as fp: msg = email.pa

[issue21476] Inconsitent behaviour between BytesParser.parse and Parser.parse

2014-05-31 Thread Vajrasky Kok
Vajrasky Kok added the comment: Ok, here is the updated patch based on R. David Murray's help. Thanks! -- Added file: http://bugs.python.org/file35424/bytes_parser_dont_close_file_v4.patch ___ Python tracker <http://bugs.python.org/is

[issue21476] Inconsitent behaviour between BytesParser.parse and Parser.parse

2014-06-08 Thread Vajrasky Kok
Vajrasky Kok added the comment: Here is the patch based on R. David Murray's nitpick. -- Added file: http://bugs.python.org/file35537/bytes_parser_dont_close_file_v5.patch ___ Python tracker <http://bugs.python.org/is

[issue21723] Float maxsize is treated as infinity in asyncio.Queue

2014-06-11 Thread Vajrasky Kok
New submission from Vajrasky Kok: import asyncio loop = asyncio.get_event_loop() q = asyncio.Queue(maxsize=1.2, loop=loop) q.put_nowait(1) q.put_nowait(1) q.put_nowait(1) q.put_nowait(1) q.put_nowait(1) and so on It seems counter intuitive for my innocent eyes. As comparison with the

[issue21723] Float maxsize is treated as infinity in asyncio.Queue

2014-06-12 Thread Vajrasky Kok
Vajrasky Kok added the comment: "It looks strange to use a float as maxsize." => It is. But the float could be coming programmatically. Float value interpreted as infinity could give a shock for some people. "maybe to cast maxsize parameter to an int."

[issue21758] Not so correct documentation about asyncio.subprocess_shell method

2014-06-14 Thread Vajrasky Kok
New submission from Vajrasky Kok: subprocess_shell in asyncio accepts cmd as a string or a bytes but the test unit, the documentation and the exception indicates that it only accepts a string. -- assignee: docs@python components: Documentation, asyncio files

[issue20069] Add unit test for os.chown

2014-06-18 Thread Vajrasky Kok
Vajrasky Kok added the comment: Here is the patch based on Claudiu's comment and Serhiy's commit (http://hg.python.org/cpython/rev/4b187f5aa960). Claudiu (Thanks!!!), I can not apply two of your suggestions: "You could use support.import_module here in order to skip the test i

[issue18993] There is an overshadowed and invalid test in testmock.py

2013-09-12 Thread Vajrasky Kok
Vajrasky Kok added the comment: The first test fails. I already tested it. I think they test the same thing, what happens to the attribute of mock instance if you delete it. -- ___ Python tracker <http://bugs.python.org/issue18

[issue18993] There is an overshadowed and invalid test in testmock.py

2013-09-13 Thread Vajrasky Kok
Vajrasky Kok added the comment: Okay, I found the difference. The second test case is to test the case on which we delete the attribute of the mock instance before being referenced by any variable. The we make sure the attribute is gone for good. The first test case is to test the case on

[issue18993] There is an overshadowed and invalid test in testmock.py

2013-09-14 Thread Vajrasky Kok
Vajrasky Kok added the comment: Michael, attached the patch to accommodate your request. Yeah, I think this is the best way because I have seen no possible solutions to make both tests work without altering them. Xavier, that's cool. I didn't know such tool exists. Usually I

[issue18994] Inside fcntl module, we does not check the return code of all_ins function

2013-09-15 Thread Vajrasky Kok
Vajrasky Kok added the comment: Charles-François Natali, sorry I just noticed Ezio's comment. The all_ins function return -1 on failure and 0 on success. I use this form: if (all_ins(m)) return NULL; because I follow the example in Modules/posixmodule.c. If this form:

[issue19025] Deleting attribute of Enum gives misleading error message

2013-09-15 Thread Vajrasky Kok
New submission from Vajrasky Kok: >>> from enum import Enum >>> class MyPet(Enum): ... CUTE_CAT = 1 ... VIGOROUS_DOG = 2 ... UGLY_BLOBFISH = 3 ... PROMISCUOUS_BONOBO = 4 ... def spam(cls): pass ... >>> del MyPet.CUTE_CAT Traceback (most recent call l

[issue19025] Deleting attribute of Enum gives misleading error message

2013-09-15 Thread Vajrasky Kok
Vajrasky Kok added the comment: Here is the patch containing unit test only to confirm existing behaviour. So people can learn what to expect when they delete Enum attributes. Even if we *decide* to change the behaviour of "del MyPet.CUTE_CAT" (assuming CUTE_CAT is an Enum member

[issue18985] Improve the documentation in fcntl module

2013-09-16 Thread Vajrasky Kok
Vajrasky Kok added the comment: Updated patch based on Ezio's review. I reverted back the changes to Nul and module documentation (since it is not so clear whether we should categorize flock as Unix routine or not). -- Added file: http://bugs.python.org/file

[issue13404] Add support for system.methodSignature() to XMLRPC Server

2013-09-23 Thread Vajrasky Kok
Vajrasky Kok added the comment: > How do you infer the data types for the parameters? I don't think we can, unless we force them to use function annotation. If they don't use that feature, then we say the signature is not supported. The problem is getting deeper if we are talking

[issue19082] Lib/xmlrpc/client.py demo code points to the dead server

2013-09-24 Thread Vajrasky Kok
New submission from Vajrasky Kok: Lib/xmlrpc/client.py tries to connect to http://time.xmlrpc.com/RPC2 which has been dead for a "while". I see there is no light in the end of tunnel. Since this code is meant to be a demo not a general purpose tool, I say why don't we direct

[issue19082] Lib/xmlrpc/client.py demo code points to the dead server

2013-09-24 Thread Vajrasky Kok
Changes by Vajrasky Kok : Removed file: http://bugs.python.org/file31856/xmlrpc_server_client_demo.patch ___ Python tracker <http://bugs.python.org/issue19082> ___ ___

[issue19082] Lib/xmlrpc/client.py demo code points to the dead server

2013-09-24 Thread Vajrasky Kok
Changes by Vajrasky Kok : Added file: http://bugs.python.org/file31857/xmlrpc_server_client_demo.patch ___ Python tracker <http://bugs.python.org/issue19082> ___ ___ Pytho

[issue19094] urljoin should raise a TypeError if URL is not a string

2013-09-26 Thread Vajrasky Kok
Vajrasky Kok added the comment: This is the preliminary patch to raise TypeError in that situation. -- keywords: +patch nosy: +vajrasky Added file: http://bugs.python.org/file31876/urljoin_throws_type_error.patch ___ Python tracker <h

[issue19082] Lib/xmlrpc/client.py demo code points to the dead server

2013-09-26 Thread Vajrasky Kok
Vajrasky Kok added the comment: What test_xmlrpc_net tests (especially the one with time.xmlrpc.com) have been tested in test_xmlrpc except for connecting to server with dotted_attribute feature and receiving datetime instance over the network. That test is not that hard to be migrated to

[issue19094] urljoin should raise a TypeError if URL is not a string

2013-09-26 Thread Vajrasky Kok
Vajrasky Kok added the comment: What about this one? >>> urljoin(['a'], []) ['a'] >>> urljoin(['a'], ['b']) . omitted .. AttributeError: 'list' object has no attribute 'decode' Is this

[issue19094] urljoin should raise a TypeError if URL is not a string

2013-09-28 Thread Vajrasky Kok
Vajrasky Kok added the comment: I modified the patch to handle the last case using your way as well. Anyway, I found out that urlsplit and urlparse got the same issue as well. >>> urlparse('python.org', b'http://') Traceback (most recent call last): File "

[issue19099] struct.pack fails first time with unicode fmt

2013-09-30 Thread Vajrasky Kok
Vajrasky Kok added the comment: Here's the preliminary patch. I am assuming that we should accept unicode argument not reject it straight away. Python3 does that. >>> import struct >>> struct.pack('b', 3) b'\x03' >>> struct.pack(b'b

<    1   2   3   4   5   6   >