[issue19717] resolve() fails when the path doesn't exist

2013-12-02 Thread Vajrasky Kok
Vajrasky Kok added the comment: Here is the preliminary patch. Only tested on Linux. Later I'll test it on Windows. -- keywords: +patch nosy: +vajrasky Added file: http://bugs.python.org/file32947/add_non_strict_resolve_pathlib.patch ___ Python

[issue19848] Misleading error on creating already existed symlink

2013-12-01 Thread Vajrasky Kok
New submission from Vajrasky Kok: Steps to reproduce the bug: 1. Download cute cat picture from internet. Name it CuteCat.jpg. import os os.listdir('.') ['CuteCat.jpg'] 2. Create symbolic link. os.symlink('CuteCat.jpg', 'Aaawww.lnk') os.listdir('.') ['Aaawww.lnk', 'CuteCat.jpg'] 3. Do

[issue19848] Misleading error on creating already existed symlink

2013-12-01 Thread Vajrasky Kok
Vajrasky Kok added the comment: Python 2.7 on Windows does not have symlink. Python 3.3 on Windows got the same symptom as Python 3.4. Do we need to fix it? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19848

[issue19848] Misleading error on creating already existed symlink

2013-12-01 Thread Vajrasky Kok
Vajrasky Kok added the comment: This is the patch for Python 3.3. -- Added file: http://bugs.python.org/file32925/fix_python_33_windows_create_existed_symlink.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19848

[issue19828] test_site fails with -S flag

2013-12-01 Thread Vajrasky Kok
Vajrasky Kok added the comment: Before patch: $ ./python -S Lib/test/test_site.py Traceback (most recent call last): File Lib/test/test_site.py, line 28, in module raise unittest.SkipTest(importation of site.py suppressed) unittest.case.SkipTest: importation of site.py suppressed After

[issue19775] Provide samefile() on Path objects

2013-12-01 Thread Vajrasky Kok
Vajrasky Kok added the comment: Updated grammar according to Arfrever's review. Thanks! Anyway, should samefile accepts only string? Or should it accept Path object as well? -- Added file: http://bugs.python.org/file32927/pathlib_samefile_v2.patch

[issue19852] Misplaced private API method in pathlib.py

2013-12-01 Thread Vajrasky Kok
New submission from Vajrasky Kok: In class Path, line 942, you have this comment: # Public API but down there, in line 1048, you have this private method: def _raw_open(self, flags, mode=0o777): Open the file pointed by this path and return a file descriptor

[issue16074] Bad error message in os.rename, os.link, and os.symlink

2013-12-01 Thread Vajrasky Kok
Changes by Vajrasky Kok sky@speaklikeaking.com: -- title: bad error message in os.rename - Bad error message in os.rename, os.link, and os.symlink ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16074

[issue16074] Bad error message in os.rename, os.link, and os.symlink

2013-12-01 Thread Vajrasky Kok
Vajrasky Kok added the comment: Here is the patch for Python 3.4. It removed file information for os.rename, os.link, and os.symlink. I agree with Ezio that giving extra information is better but since Python 3.4 is in beta maybe we can defer this to Python 3.5. There are couples

[issue16074] Bad error message in os.rename, os.link, and os.symlink

2013-12-01 Thread Vajrasky Kok
Vajrasky Kok added the comment: Patch for Python 3.3. It omitted file information for error messages in rename, symlink, and link. I'll create a separate ticket for adding extra file information to these error messages. -- Added file: http://bugs.python.org/file32935

[issue19775] Provide samefile() on Path objects

2013-11-30 Thread Vajrasky Kok
Vajrasky Kok added the comment: Here is the patch. -- keywords: +patch nosy: +vajrasky Added file: http://bugs.python.org/file32916/pathlib_samefile.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19775

[issue19828] test_site fails with -S flag

2013-11-29 Thread Vajrasky Kok
New submission from Vajrasky Kok: $ ./python -S Lib/test/test_site.py Traceback (most recent call last): File Lib/test/test_site.py, line 28, in module raise unittest.SkipTest(importation of site.py suppressed) unittest.case.SkipTest: importation of site.py suppressed This counts as fail

[issue19830] test_poplib emits resource warning

2013-11-29 Thread Vajrasky Kok
New submission from Vajrasky Kok: $ ./python Lib/test/test_poplib.py omitted test_uidl (__main__.TestPOP3_TLSClass) ... ok test_user (__main__.TestPOP3_TLSClass) ... ok -- Ran 62 tests in 4.994s OK /home/ethan/Documents

[issue19772] str serialization of Message object may mutate the payload and CTE.

2013-11-27 Thread Vajrasky Kok
Vajrasky Kok added the comment: I come out with two patches. The first patch using bytes generator to copy the message before mutating it in string generator, then restore it after printing the mutated message. -- keywords: +patch Added file: http://bugs.python.org/file32865

[issue19772] str serialization of Message object may mutate the payload and CTE.

2013-11-27 Thread Vajrasky Kok
Vajrasky Kok added the comment: The second patch copies the private variables of the message before mutating it in string generator, then restore the private variables after printing the mutated message. -- Added file: http://bugs.python.org/file32866

[issue19772] str serialization of Message object may mutate the payload and CTE.

2013-11-27 Thread Vajrasky Kok
Vajrasky Kok added the comment: I got another inspiration. The third patch uses copy.copy to copy the Message before mutating it in string generator, then restore it after printing the mutated message. -- Added file: http://bugs.python.org/file32867

[issue19815] ElementTree segmentation fault in expat_start_ns_handler

2013-11-27 Thread Vajrasky Kok
Vajrasky Kok added the comment: Here is the patch (by Christian Heimes) with unit test (by me). Apparently the namespace handlers (start-ns and end-ns) got problem with empty namespace. But they (start-ns and end-ns) must be combined together to create this problem. start-ns handler only

[issue19802] socket.SO_PRIORITY is missing

2013-11-26 Thread Vajrasky Kok
Vajrasky Kok added the comment: I agree. The test is not that meaningful. But hey, we have the test that tests this kind of constant. http://hg.python.org/cpython/rev/513da56d28de -- nosy: +vajrasky ___ Python tracker rep...@bugs.python.org http

[issue19792] pathlib does not support symlink in Windows XP

2013-11-26 Thread Vajrasky Kok
Vajrasky Kok added the comment: I agree we should not go extra mile to add feature for Windows XP, a 12 year old software and soon to be put down a couple months forward. But in this case, Antoine goes extra mile to prevent symbolic link support in Windows XP. And it's not just him that has

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

2013-11-26 Thread Vajrasky Kok
Vajrasky Kok added the comment: How about we defer this to Python 3.5, to make merging easier ? Sure. -- versions: +Python 3.5 -Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19791

[issue19768] Not so correct error message when giving incorrect type to maxlen in deque

2013-11-25 Thread Vajrasky Kok
New submission from Vajrasky Kok: from collections import deque deque('abc', maxlen='a') Traceback (most recent call last): File stdin, line 1, in module TypeError: an integer is required But it's a lie. You can give None to maxlen deque('abc', maxlen=None) deque(['a', 'b', 'c']) maxlen

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

2013-11-25 Thread Vajrasky Kok
New submission from Vajrasky Kok: Right now, Lib/test/test_pathlib.py uses custom checking symbolic link function. But in test.support, we have those functions already (can_symlink and skip_unless_symlink). The only feature that test.support checking symbolic link functions don't have

[issue19792] pathlib does not support symlink in Windows XP

2013-11-25 Thread Vajrasky Kok
New submission from Vajrasky Kok: In Lib/pathlib.py, we got this problematic code: if sys.getwindowsversion()[:2] = (6, 0): from nt import _getfinalpathname else: supports_symlinks = False _getfinalpathname = None This code means if the windows version

[issue19762] Incorrect function documentation of _get_object_traceback and _get_traces in _tracemalloc module

2013-11-24 Thread Vajrasky Kok
New submission from Vajrasky Kok: import _tracemalloc _tracemalloc._get_object_traceback.__doc__ 'get_object_traceback(obj)\n\nGet the traceback where the Python object obj was allocated.\nReturn a tuple of (filename: str, lineno: int) tuples.\n\nReturn None if the tracemalloc module

[issue18874] Add a new tracemalloc module to trace memory allocations

2013-11-24 Thread Vajrasky Kok
Vajrasky Kok added the comment: Here is the patch to tidy up the Lib/test_tracemalloc.py. It fixed the typo, and removed unused import and unused variables. -- nosy: +vajrasky Added file: http://bugs.python.org/file32828/minor_makeup_test_tracemalloc.patch

[issue19063] Python 3.3.3 encodes emails containing non-ascii data as 7bit

2013-11-23 Thread Vajrasky Kok
Vajrasky Kok added the comment: R. David Murray, your patch fails with this situation: from email.mime.nonmultipart import * from email.charset import * from email.message import Message from io import BytesIO from email.generator import BytesGenerator msg = Message() cs = Charset('utf-8

[issue19063] Python 3.3.3 encodes emails containing non-ascii data as 7bit

2013-11-23 Thread Vajrasky Kok
Vajrasky Kok added the comment: Simpler patch. -- Added file: http://bugs.python.org/file32802/support_8bit_charset_cte_v3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19063

[issue19063] Python 3.3.3 encodes emails containing non-ascii data as 7bit

2013-11-21 Thread Vajrasky Kok
Vajrasky Kok added the comment: No review link? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19063 ___ ___ Python-bugs-list mailing list

[issue19663] Not so correct error message when initializing defaultdict

2013-11-20 Thread Vajrasky Kok
New submission from Vajrasky Kok: from collections import defaultdict defaultdict('') Traceback (most recent call last): File stdin, line 1, in module TypeError: first argument must be callable defaultdict(None) defaultdict(None, {}) None() Traceback (most recent call last): File stdin

[issue19580] Got resource warning when running test_base_events (test_asyncio)

2013-11-14 Thread Vajrasky Kok
New submission from Vajrasky Kok: $ ./python Lib/test/test_asyncio/test_base_events.py ./home/ethan/Documents/code/python/cpython3.4/Lib/unittest/case.py:158: ResourceWarning: unclosed socket.socket fd=10, family=AddressFamily.AF_INET, type=SocketType.SOCK_STREAM

[issue19449] csv.DictWriter can't handle extra non-string fields

2013-11-12 Thread Vajrasky Kok
Vajrasky Kok added the comment: Here is the preliminary patch. -- nosy: +vajrasky Added file: http://bugs.python.org/file32582/fix_error_message_write_fields_not_in_fieldnames.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue19449] csv.DictWriter can't handle extra non-string fields

2013-11-12 Thread Vajrasky Kok
Changes by Vajrasky Kok sky@speaklikeaking.com: -- components: +Library (Lib) versions: +Python 3.3, Python 3.4 -Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19449

[issue19466] Clear state of threads earlier in Python shutdown

2013-11-12 Thread Vajrasky Kok
Vajrasky Kok added the comment: Typo: s/immediatly/immediately. I attached the patch. -- nosy: +vajrasky Added file: http://bugs.python.org/file32586/fix_typo_19466.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19466

[issue19532] compileall -f doesn't force to write bytecode files

2013-11-10 Thread Vajrasky Kok
Vajrasky Kok added the comment: Ah, I missed that. I made this assumption because when I executed other modules manually, they were there just for testing functionality (such as shlex and aifc). Added test. -- Added file: http://bugs.python.org/file32559/compileall_force_v2.patch

[issue19532] compileall -f doesn't force to write bytecode files

2013-11-10 Thread Vajrasky Kok
Vajrasky Kok added the comment: Tidied up the test. -- Added file: http://bugs.python.org/file32560/compileall_force_v3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19532

[issue19532] compileall -f doesn't force to write bytecode files

2013-11-09 Thread Vajrasky Kok
Vajrasky Kok added the comment: Attached the patch to fix the problem. I did not modify the unit test because the bug was located in the __main__ part of Lib/compileall. -- keywords: +patch nosy: +vajrasky Added file: http://bugs.python.org/file32553/compileall_force.patch

[issue19422] Neither DTLS nor error for SSLSocket.sendto() of UDP socket

2013-11-04 Thread Vajrasky Kok
Vajrasky Kok added the comment: Attached the patch to raise error when using sock dgram in wrap_socket. I am still unsure whether I should put the validation in C code (private function _wrap_socket) or not. -- keywords: +patch nosy: +vajrasky Added file: http://bugs.python.org

[issue19492] Report skipped distutils tests as skipped

2013-11-04 Thread Vajrasky Kok
Vajrasky Kok added the comment: You forgot to upload the proposed patch, Serhiy. -- nosy: +vajrasky ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19492

[issue19424] _warnings: patch to avoid conversions from/to UTF-8

2013-11-03 Thread Vajrasky Kok
Vajrasky Kok added the comment: Py_ssize_t is signed long. size_it is unsigned long. In this case, I suppose we should avoid unsigned as much as possible in comparison with signed. So I think Zachary's patch is reasonable. What do you think, Victor

[issue19085] Add tkinter basic options tests

2013-11-03 Thread Vajrasky Kok
Vajrasky Kok added the comment: Serhiy, In Python3.4, Windows Vista 32 bit, Release Mode, Tcl/Tk 8.5.15, I got a lot of errors. However, if I set _conv_pixels to round in Lib/tkinter/test/widget_tests.py, everything works fine. In Python 3.4, Fedora 18, Debug Mode, Tcl/Tk 8.5.13, I got a lot

[issue19485] Slightly incorrect doc for get_param method in Lib/email/message.py

2013-11-03 Thread Vajrasky Kok
New submission from Vajrasky Kok: Lib/email/message.py, line 665 666: param = msg.get_param('foo') param = email.utils.collapse_rfc2231_value(rawparam) Where does rawparam come from? On top of that, sending the result of get_param to collapse_rfc2231_value can make it chokes

[issue19485] Slightly incorrect doc for get_param method in Lib/email/message.py

2013-11-03 Thread Vajrasky Kok
Changes by Vajrasky Kok sky@speaklikeaking.com: -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19485 ___ ___ Python

[issue19486] Bump up version of Tcl/Tk in building Python in Windows platform

2013-11-03 Thread Vajrasky Kok
New submission from Vajrasky Kok: Right now, at November 3rd 2013, the latest minor version of Tcl/Tk 8.5 is 8.5.15. http://www.activestate.com/activetcl/downloads http://www.tcl.tk/ When building Python in Windows in release mode (not debug mode), I had to download the Tcl/Tk binary build

[issue4331] Add functools.partialmethod

2013-11-03 Thread Vajrasky Kok
Vajrasky Kok added the comment: Should we add partialmethod to __all__ for consistency? -- nosy: +vajrasky ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4331

[issue18985] Improve the documentation in fcntl module

2013-11-03 Thread Vajrasky Kok
Vajrasky Kok added the comment: Except for the typo noticed by Victor, your patch looks good. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18985

[issue18996] unittest: more helpful truncating long strings

2013-11-02 Thread Vajrasky Kok
Vajrasky Kok added the comment: Serhiy, you still left debugging code there. Lib/unittest/test/test_case.py, line 879 and line 880. #print() #print(str(cm.exception)) -- nosy: +vajrasky ___ Python tracker rep...@bugs.python.org http

[issue13637] binascii.a2b_* functions could accept unicode strings

2013-11-02 Thread Vajrasky Kok
Vajrasky Kok added the comment: Here is another patch to better the error message. Right now, the error message when wrong input sent to unhexlify is a little bit funny. import binascii binascii.unhexlify(3) Traceback (most recent call last): File stdin, line 1, in module TypeError

[issue19391] Fix PCbuild/readme.txt in 2.7 and 3.3

2013-11-02 Thread Vajrasky Kok
Vajrasky Kok added the comment: Zachary, perharps you could make a diff with mercurial so we can have Rietveld review link. I don't know whether git can do that or not. -- nosy: +vajrasky ___ Python tracker rep...@bugs.python.org http

[issue19063] Python 3.3.3 encodes emails containing non-ascii data as 7bit

2013-11-01 Thread Vajrasky Kok
Vajrasky Kok added the comment: Attached the *preliminary* patch to address R. David Murray's request. It does not address the case where we send raw utf-8 bytes to payload. Maybe we should handle that in different ticket. msg.set_payload(b'\xd0\x90\xd0\x91\xd0\x92') == chucks

[issue19470] email.header.Header - should not allow two newlines in a row

2013-11-01 Thread Vajrasky Kok
Changes by Vajrasky Kok sky@speaklikeaking.com: -- nosy: +r.david.murray, vajrasky ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19470

[issue19411] binascii.hexlify docs say it returns a string (it returns bytes)

2013-11-01 Thread Vajrasky Kok
Vajrasky Kok added the comment: Attached the patch to fix the doc. I also fix the module doc because I think bytes and str data types are matter of life and death in this binascii module. -- keywords: +patch nosy: +vajrasky Added file: http://bugs.python.org/file32459

[issue19398] test_trace fails with -S

2013-11-01 Thread Vajrasky Kok
Vajrasky Kok added the comment: Attached the patch to accommodate Terry J. Reedy's request. -- Added file: http://bugs.python.org/file32460/remove_extra_slash_from_sys_path_v2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue13637] binascii.a2b_* functions could accept unicode strings

2013-11-01 Thread Vajrasky Kok
Vajrasky Kok added the comment: Antoine, I think you forgot to update the doc. http://docs.python.org/3.4/library/binascii.html#binascii.unhexlify Changed in version 3.2: Accept only bytestring or bytearray objects as input. Attached the patch to update the doc to reflect the changes

[issue19063] Python 3.3.3 encodes emails containing non-ascii data as 7bit

2013-10-31 Thread Vajrasky Kok
Vajrasky Kok added the comment: So msg.as_string() = cte - base64 message - 0JDQkdCS # base64 encoded string What about msg.as_bytes()? Should it be: cte - 8bit message - \\u0410\\u0411\\u0412 (raw-unicode-escape) or \xd0\x90\xd0\x91\xd0\x92 (utf-8)? or message - 0JDQkdCS (base64

[issue19460] Add test for MIMENonMultipart

2013-10-31 Thread Vajrasky Kok
New submission from Vajrasky Kok: Apparently there is no test for MIMENonMultipart. [sky@localhost cpython]$ grep -R MIMENonMultipart Lib/test/* [sky@localhost cpython]$ Attached the patch to add test for MIMENonMultipart. -- components: Tests files: add_test_non_multipart.patch

[issue19063] Python 3.3.3 encodes emails containing non-ascii data as 7bit

2013-10-30 Thread Vajrasky Kok
Vajrasky Kok added the comment: Here is the preliminary patch to fix the problem. My patch produces 8bit for msg.as_string and msg.as_bytes for simplicity reason. If msg.as_string should gives content-transfer-encoding 7bit with 8bit data but msg.as_bytes should gives content-transfer

[issue19063] Python 3.3.3 encodes emails containing non-ascii data as 7bit

2013-10-30 Thread Vajrasky Kok
Vajrasky Kok added the comment: Okay, so for this case, what are the correct outputs for the cte and the message? from email.charset import Charset from email.message import Message cs = Charset('utf-8') cs.body_encoding = None # disable base64 msg

[issue19434] Wrong documentation of MIMENonMultipart class

2013-10-29 Thread Vajrasky Kok
New submission from Vajrasky Kok: from email.mime.nonmultipart import MIMENonMultipart MIMENonMultipart.__doc__ 'Base class for MIME multipart/* type messages.' Attached the patch to fix the doc of MIMENonMultipart class. -- assignee: docs@python components: Documentation files

[issue19424] _warnings: patch to avoid conversions from/to UTF-8

2013-10-29 Thread Vajrasky Kok
Vajrasky Kok added the comment: Victor, I found out that this commit http://hg.python.org/cpython/rev/34e166d60f37 gives me compiler warning. Objects/unicodeobject.c: In function ‘PyUnicode_CompareWithASCIIString’: Objects/unicodeobject.c:10583:22: warning: pointer targets in initialization

[issue17762] platform.linux_distribution() should honor /etc/os-release

2013-10-28 Thread Vajrasky Kok
Vajrasky Kok added the comment: Apparently my fear is unfounded. The dist, version, id have been initialized with empty value. So if the os-release file does not have complete information, it should be okay with the patch from Andrei Duma

[issue17762] platform.linux_distribution() should honor /etc/os-release

2013-10-28 Thread Vajrasky Kok
Vajrasky Kok added the comment: Hi, Andrei. Could you provide the test? You could take a look at issue 17429 to see how it is done. http://bugs.python.org/issue17429 We would be grateful if you could test the case where os-release file is non-ascii encoded file (although technically

[issue19398] test_trace fails with -S

2013-10-26 Thread Vajrasky Kok
Vajrasky Kok added the comment: I finally found the main culprit which puts extra '/' in my sys.path. The patch removed the extra '/' and also fixed this test automatically. -- Added file: http://bugs.python.org/file32367/remove_extra_slash_from_sys_path.patch

[issue19353] on RHEL6 simple build fails with test_linux_constants (test.test_resource.ResourceTest)

2013-10-26 Thread Vajrasky Kok
Vajrasky Kok added the comment: This issue has been accidentally fixed by http://hg.python.org/cpython/rev/513da56d28de commit. Time to close it? Any last words? -- nosy: +brett.cannon ___ Python tracker rep...@bugs.python.org http

[issue19397] test_pydoc fails with -S

2013-10-26 Thread Vajrasky Kok
Vajrasky Kok added the comment: Attached the patch to fix the test. The main issue is that with S flag, we do not have help in builtins. And I think that is deliberate. [sky@localhost cpython]$ ./python -S Python 3.4.0a4+ (default:64fb6a58ebf4+, Oct 26 2013, 19:04:01) [GCC 4.7.2 20121109

[issue19397] test_pydoc fails with -S

2013-10-26 Thread Vajrasky Kok
Vajrasky Kok added the comment: Attached the patch based on Serhiy's suggestion. -- Added file: http://bugs.python.org/file32376/fix_test_pydoc_with_S_flag_v2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19397

[issue19398] test_trace fails with -S

2013-10-25 Thread Vajrasky Kok
Vajrasky Kok added the comment: This is the emergency patch to solve this issue. The main issue is, [sky@localhost cpython]$ ./python -Sc import sys; print(sys.path) ['', '/usr/local/lib/python34.zip', '/home/sky/Code/python/programming_language/cpython/Lib/', '/home/sky/Code/python

[issue17762] platform.linux_distribution() should honor /etc/os-release

2013-10-24 Thread Vajrasky Kok
Vajrasky Kok added the comment: Hi Andrei Duma, I have looked at your patch but have not tested it yet. But it seems to me that your patch is a little bit weak against the case where the file /etc/os-release is found, but not fully functional (either garbage, or only releases NAME

[issue19349] Not so correct exception message when running venv

2013-10-22 Thread Vajrasky Kok
New submission from Vajrasky Kok: In Lib/venv/__init__.py, line 348: raise ValueError('This script is only for use with Python 3.3') But I am running Python 3.4. Attached the patch to make it better. raise ValueError('This script is only for use with Python = 3.3') If you feel it does

[issue19353] on RHEL6 simple build fails with test_linux_constants (test.test_resource.ResourceTest)

2013-10-22 Thread Vajrasky Kok
Vajrasky Kok added the comment: Do we really need to test these constants in unit test? Other constants such as RLIMIT_STACK, RLIMIT_DATA, etc are not being tested. Other consideration includes people built custom kernel without these constants, or maybe they have outdated glibc

[issue19353] on RHEL6 simple build fails with test_linux_constants (test.test_resource.ResourceTest)

2013-10-22 Thread Vajrasky Kok
Vajrasky Kok added the comment: Or if we really want to test these constants, we can use something like this: if hasattr(resource, 'RLIMIT_NICE'): self.assertIsInstance(resource.RLIMIT_NICE, int) Or if we want to be so strict: if hasattr(resource, 'RLIMIT_NICE'): self.assertTrue(-20

[issue19065] sqlite3 timestamp adapter chokes on timezones

2013-10-20 Thread Vajrasky Kok
Vajrasky Kok added the comment: Added patch to add timezone support for sqlite3 datetime adapter. -- keywords: +patch nosy: +vajrasky Added file: http://bugs.python.org/file32253/add_timezone_support_for_sqlite3_datetime_adapter.patch ___ Python

[issue19287] __contains__() of dbm.ndbm databases fails with str

2013-10-19 Thread Vajrasky Kok
Vajrasky Kok added the comment: What about dbm.gnu and dbm.dumb? Should we add string key support as well? -- nosy: +vajrasky ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19287

[issue19287] __contains__() of dbm.ndbm databases fails with str

2013-10-19 Thread Vajrasky Kok
Vajrasky Kok added the comment: Sorry, I just found out that you already created a separate ticket for dbm.gnu. http://bugs.python.org/issue19288 What about dbm.dumb? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19287

[issue19296] Compiler warning when compiling dbm module

2013-10-19 Thread Vajrasky Kok
New submission from Vajrasky Kok: I got this warning when compiling dbm module with Python 3.4. /home/sky/Code/python/programming_language/cpython/Modules/_dbmmodule.c: In function ‘newdbmobject’: /home/sky/Code/python/programming_language/cpython/Modules/_dbmmodule.c:55:5: warning: passing

[issue19297] test_asyncio: unclosed sockets

2013-10-19 Thread Vajrasky Kok
Vajrasky Kok added the comment: Attached the patch to fix the resource warning problem. -- keywords: +patch nosy: +vajrasky Added file: http://bugs.python.org/file32224/close_httpd_server_in_asyncio_test_utils.patch ___ Python tracker rep

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

2013-10-16 Thread Vajrasky Kok
Vajrasky Kok added the comment: Serhiy's commit http://hg.python.org/cpython/rev/2e8c424dc638 fixed this issue already. So I closed this ticket. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http

[issue18725] Multiline shortening

2013-10-16 Thread Vajrasky Kok
Vajrasky Kok added the comment: Serhiy, you forgot to add shorten to __all__. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18725

[issue18678] Wrong struct members name for spwd module

2013-10-16 Thread Vajrasky Kok
Vajrasky Kok added the comment: I think giving deprecation message when accessing incorrect attribute from spwd struct is not practical. You're right, R. David Murray, as you can see in spwd_struct_members_name_fix_v2.patch. So I make a simpler patch. I just give a deprecation message

[issue19201] Add 'x' mode to lzma.open()

2013-10-15 Thread Vajrasky Kok
Vajrasky Kok added the comment: Stopped the leaking after running the test by adding self.addCleanup. -- Added file: http://bugs.python.org/file32130/add_x_mode_to_lzma_v3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue16845] warnings.simplefilter should validate input

2013-10-15 Thread Vajrasky Kok
Vajrasky Kok added the comment: Here is the patch to add the validation in simplefilter with the test. -- keywords: +patch nosy: +vajrasky Added file: http://bugs.python.org/file32131/add_assert_in_simplefilter.patch ___ Python tracker rep

[issue19258] Got resource warning when running wsgiref demo app

2013-10-14 Thread Vajrasky Kok
New submission from Vajrasky Kok: ./python Lib/wsgiref/simple_server.py Serving HTTP on 0.0.0.0 port 8000 ... 127.0.0.1 - - [14/Oct/2013 17:23:43] GET /xyz?abc HTTP/1.1 200 4510 sys:1: ResourceWarning: unclosed socket.socket fd=4, family=2, type=1, proto=0, laddr=('0.0.0.0', 8000) Attached

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

2013-10-14 Thread Vajrasky Kok
Vajrasky Kok added the comment: Hi, Senthil Kumaran, thank you for your review. I have one small complain about your improved patch. Perhaps we need to give security warning when they want to use allow_dotted_names feature in the documentation. I omitted the warning in the demo because

[issue19223] Add 'x' mode to bz2.open()

2013-10-13 Thread Vajrasky Kok
Vajrasky Kok added the comment: Added doc. -- Added file: http://bugs.python.org/file32075/add_x_mode_to_bz2_v2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19223

[issue19201] Add 'x' mode to lzma.open()

2013-10-13 Thread Vajrasky Kok
Vajrasky Kok added the comment: Added doc. Revamped the test. The patch did not cater to the order of modes (wb is equal to bw?). I think that deserves a separate ticket. -- Added file: http://bugs.python.org/file32077/add_x_mode_to_lzma_v2.patch

[issue16355] inspect.getcomments() does not work in the interactive shell

2013-10-12 Thread Vajrasky Kok
Vajrasky Kok added the comment: Attached the patch to address Georg Brandl's concern (Thank you!). I also added test for checking the comment of the object defined in C (list, open, etc). I have given thought about testing the comment of the object in interactive shell. But it is too much

[issue19223] Add 'x' mode to bz2.open()

2013-10-12 Thread Vajrasky Kok
Vajrasky Kok added the comment: Added test. -- keywords: +patch nosy: +vajrasky Added file: http://bugs.python.org/file32074/add_x_mode_to_bz2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19223

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

2013-10-11 Thread Vajrasky Kok
Vajrasky Kok added the comment: Okay, I updated the patch. Now, it sends the datetime object instead of formatted datetime string. Also, I used static method inside instance to let the client uses dotted attribute feature instead of self attribute trick. -- Added file: http

[issue16355] inspect.getcomments() does not work in the interactive shell

2013-10-11 Thread Vajrasky Kok
Vajrasky Kok added the comment: Added the doc fix and modified the test. -- Added file: http://bugs.python.org/file32057/issue16355_v3.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16355

[issue15805] Add stdout redirection tool to contextlib

2013-10-10 Thread Vajrasky Kok
Vajrasky Kok added the comment: Nice. My only complain is the dis.dis example. We don't have to use redirect_stdout context manager. +# How to capture disassembly to a string + +import dis +import io + +f = io.StringIO() +with redirect_stdout(f

[issue19201] lzma and 'x' mode open

2013-10-10 Thread Vajrasky Kok
Vajrasky Kok added the comment: Here is the unit test for Tim Heaney's work. There is a test that explicitly tests that we get error when opening in 'x' mode. Also, this test is only for lzma. I think we should create separate tickets for other compression methods. -- keywords: +patch

[issue19201] lzma and 'x' mode open

2013-10-10 Thread Vajrasky Kok
Changes by Vajrasky Kok sky@speaklikeaking.com: Removed file: http://bugs.python.org/file32030/add_x_mode_to_lzma.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19201

[issue19201] lzma and 'x' mode open

2013-10-10 Thread Vajrasky Kok
Changes by Vajrasky Kok sky@speaklikeaking.com: Added file: http://bugs.python.org/file32031/add_x_mode_to_lzma.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19201

[issue19192] Move test_current_time from test_xmlrpc_net to test_xmlrpc

2013-10-10 Thread Vajrasky Kok
Vajrasky Kok added the comment: Attached the second version patch to address R. David Murray's concerns. 1. test_dotted_attribute name has been taken, so I use test_instance_with_allow_dotted_names name. Or should I use test_instance_with_dotted_attribute name? Or maybe

[issue16355] inspect.getcomments() does not work in the interactive shell

2013-10-10 Thread Vajrasky Kok
Vajrasky Kok added the comment: Only doc fix? What about unit test confirming that getcomments and getsource return None if inspect can not find the source code? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16355

[issue19192] Move test_current_time from test_xmlrpc_net to test_xmlrpc

2013-10-08 Thread Vajrasky Kok
New submission from Vajrasky Kok: Currently, the test_current_time is idle because the server (time.xmlrpc.com) that it requires is dead (at the moment being and no end in sight). The patch moved the test from Lib/test/test_xmlrpc_net.py to Lib/test/test_xmlrpc.py and simulate

[issue19119] duplicate test name in Lib/test/test_heapq.py

2013-10-06 Thread Vajrasky Kok
Vajrasky Kok added the comment: I have played around with this test. The major issue (there are other issues as well but not so difficult) is whether nlargest and nsmallest should support iterator that could be endless iterator or reject it (by checking __len__ attribute) straight away. Once

[issue16355] inspect.getcomments() does not work in the interactive shell

2013-10-06 Thread Vajrasky Kok
Vajrasky Kok added the comment: I pep-8 Phil Connell's work and revamped the unit test based on R. David Murray's request. -- nosy: +vajrasky Added file: http://bugs.python.org/file31975/issue16355_v2.diff ___ Python tracker rep...@bugs.python.org

[issue19164] Update uuid.UUID TypeError exception: integer should not be an argument.

2013-10-04 Thread Vajrasky Kok
Vajrasky Kok added the comment: The exception message is correct. You can give an integer argument. But you have to use keyword argument. uuid.UUID(int=uuid.uuid4().int) UUID('62ad61e5-b492-4f01-81e6-790049051c4f') From the documentation: __init__(self, hex=None, bytes=None, bytes_le=None

[issue19166] Unusued variable in test_keys in Lib/test/test_dict.py

2013-10-04 Thread Vajrasky Kok
New submission from Vajrasky Kok: This is the test. def test_keys(self): d = {} self.assertEqual(set(d.keys()), set()) d = {'a': 1, 'b': 2} k = d.keys() self.assertIn('a', d) self.assertIn('b', d) self.assertRaises(TypeError, d.keys

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

2013-10-02 Thread Vajrasky Kok
New submission from Vajrasky Kok: from itertools import repeat repeat(2, -10).__length_hint__() 0 repeat(2, times=-10).__length_hint__() 18446744073709551606 repeat(2, times=-10) repeat(2, -10) repeat(2, -10) repeat(2, 0) Hereby, I attached two alternatives of patch to make the behaviour

<    1   2   3   4   5   6   >