[issue15539] Fixing Tools/scripts/pindent.py
Serhiy Storchaka added the comment: Patch updated. Tests added. I am not sure tests will be passed on Windows. -- Added file: http://bugs.python.org/file28224/pindent_2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15539 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6912] Add 'with' block support to Tools/Scripts/pindent.py
Serhiy Storchaka added the comment: Actually without next['with'] = 'end' with support is broken. See issue15539. -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6912 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16631] tarfile.extractall() doesn't extract everything if .next() was used
Serhiy Storchaka added the comment: Possible this is a duplicate of issue16601. -- nosy: +serhiy.storchaka versions: -Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16631 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16629] IDLE: Calltips test fails due to int docstring change
Serhiy Storchaka added the comment: Yes, I also noticed this. However, int(x=0) - integer is not enough. The right calltip should be int(x=0) - integer\nint(x, base=10) - integer. -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16629 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16631] tarfile.extractall() doesn't extract everything if .next() was used
Serhiy Storchaka added the comment: OK. Then those issues are just related. -- nosy: +lars.gustaebel stage: - patch review type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16631 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16601] Restarting iteration over tarfile continues from where it left off.
Serhiy Storchaka added the comment: Related issue: issue16631. -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16601 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16601] Restarting iteration over tarfile continues from where it left off.
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +lars.gustaebel versions: +Python 3.2, Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16601 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16601] Restarting iteration over tarfile continues from where it left off.
Changes by Serhiy Storchaka storch...@gmail.com: -- stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16601 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16629] IDLE: Calltips test fails due to int docstring change
Serhiy Storchaka added the comment: Here is a patch, which adds multiline calltips support. -- Added file: http://bugs.python.org/file28235/idle_calltips_multiline.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16629 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16630] IDLE: Calltip fails if __getattr__ raises exception
Serhiy Storchaka added the comment: 1. rpcclt.remotecall also can raise an exception. 2. I think fetch_tip() should return '' in case of exception as for non-existent arguments or for non-callables. You can add tests for this cases too. 3. break is a reserved word. It's not a good name for an attribute. 4. It will be better test for exception an instance of the special class and not break TC. class Broken: def __getattr__(self, name): raise Exception('Broken __getattr__') brocken = Broken() test('brocken', '') -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16630 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16629] IDLE: Calltips test fails due to int docstring change
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +chris.jerdonek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16629 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16629] IDLE: Calltips test fails due to int docstring change
Serhiy Storchaka added the comment: Done. Here is an updated patch. -- Added file: http://bugs.python.org/file28237/idle_calltips_multiline_2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16629 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16629] IDLE: Calltips test fails due to int docstring change
Changes by Serhiy Storchaka storch...@gmail.com: Removed file: http://bugs.python.org/file28235/idle_calltips_multiline.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16629 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16631] tarfile.extractall() doesn't extract everything if .next() was used
Serhiy Storchaka added the comment: Since you iterated to the end any iterators are independent (they are just indices in the list of members). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16631 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16636] codecs: readline() followed by readlines() returns trunkated results
Serhiy Storchaka added the comment: Confirm for 3.x. See also issue8260, issue12446, and issue14475. -- components: +IO, Unicode nosy: +ezio.melotti, serhiy.storchaka stage: - needs patch versions: +Python 3.2, Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16636 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16629] IDLE: Calltips test fails due to int docstring change
Serhiy Storchaka added the comment: The number of lines in the return value of get_argspec should be limited, otherwise the calltip window can become too large. Calltip limited by first empty line. But I agree, some reasonable hard limit (say 10 lines) should be. I would separate the issue of fixing the test (behavior) from adding support for multi-line tool tips (enhancement). Then calltip will be wrong. `int` can accept two arguments, not only one. Alternative consistent solution is to revert all changes which were convert oneline signatures to multiline (I think you won't like this ;) ). Unless the policy for IDLE is different, it seems the latter should be limited to 3.4. The policy for IDLE is different. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16629 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16629] IDLE: Calltips test fails due to int docstring change
Serhiy Storchaka added the comment: Patch updated. Added hard limit (10) for number of calltip lines. -- Added file: http://bugs.python.org/file28246/idle_calltips_multiline_3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16629 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16629] IDLE: Calltips test fails due to int docstring change
Changes by Serhiy Storchaka storch...@gmail.com: Removed file: http://bugs.python.org/file28237/idle_calltips_multiline_2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16629 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16629] IDLE: Calltips test fails due to int docstring change
Serhiy Storchaka added the comment: I don't think it was ever a requirement of docstrings that their signature fit on one line or that they render fully in IDLE. I think this is a requirement of IDLE. I still think that the rendering of multi-line signatures should be considered separately. The discussion and issues are different, and people may have different opinions. Then what about this issue? Legalize the current invalid behavior in the tests? I think that the tests should check the valid behavior and if tests failed then the behavior should be corrected, not tests should be faked. For example, why not be smarter about detecting the end of the signature (e.g. first line not having -)? This is a reasonable proposal. Let's discuss it. The objection is that there are such signatures: foo(a, b, c, e, f, g) - some result Would you object to creating a new issue? There is no difference for me what issue it will be, but if it will be a different issue, then I do not see any sense in this issue. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16629 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8260] When I use codecs.open(...) and f.readline() follow up by f.read() return bad result
Serhiy Storchaka added the comment: I think the patch is wrong or is not optimal for case when chars is -1, but size is not. If we want to read all data in any case, then we should call self.stream.read() without argument if chars 0 or size 0. If we want to read no more than size bytes, then all loop code should be totally rewritten. Perhaps I am wrong. -- nosy: +serhiy.storchaka versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8260 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12446] StreamReader Readlines behavior odd
Serhiy Storchaka added the comment: Yes, this is obviously a duplicate of issue8260. -- nosy: +serhiy.storchaka resolution: - duplicate stage: - committed/rejected status: open - closed superseder: - When I use codecs.open(...) and f.readline() follow up by f.read() return bad result ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12446 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14475] codecs.StreamReader.read behaves differently from regular files
Serhiy Storchaka added the comment: This is obviously a duplicate of issue8260 and issue12446. -- nosy: +serhiy.storchaka resolution: - duplicate stage: - committed/rejected status: open - closed superseder: - When I use codecs.open(...) and f.readline() follow up by f.read() return bad result ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14475 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16636] codecs: readline() followed by readlines() returns trunkated results
Changes by Serhiy Storchaka storch...@gmail.com: -- stage: needs patch - committed/rejected status: open - closed superseder: - When I use codecs.open(...) and f.readline() follow up by f.read() return bad result ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16636 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8260] When I use codecs.open(...) and f.readline() follow up by f.read() return bad result
Serhiy Storchaka added the comment: As showed in issue12446, issue14475 and issue16636 there are different methods to reproduce this bug (read(size, chars) + readlines(), readline() + readlines()). All this cases should be tested. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8260 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16624] subprocess.check_output should allow specifying stdin as a string
Serhiy Storchaka added the comment: This is a beautiful patch. LGTM. However it should be tested on Windows. I'm not sure that reading not closed file in different process works on Windows. Zack, can you please submit a contributor form? http://python.org/psf/contrib/contrib-form/ http://python.org/psf/contrib/ -- stage: needs patch - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16624 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16638] support multi-line docstring signatures in IDLE calltips
Serhiy Storchaka added the comment: Here is a patch moved from issue16629. I think this is a bugfix, because current behavior is wrong. Many functions (i.e. int, str, list, dict) have multiline signatures and IDLE shows only first line in a tip. I.e. int(x=0) - integer showed for int(), but int() accepts up to two arguments. This is a regression comparing with times when the signature was oneline. -- keywords: +patch stage: - patch review type: enhancement - behavior versions: +Python 2.7, Python 3.2, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file28249/idle_calltips_multiline_3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16638 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16638] support multi-line docstring signatures in IDLE calltips
Serhiy Storchaka added the comment: I think we should add empty lines after signatures in all docstrings where it needed (i.e. for super()). Here is a command which shows calltips for all builtins: ./python -c from idlelib.CallTips import get_argspec, get_entity; import builtins for name in sorted(builtins.__dict__): print('%s:\t%s' % (name, get_argspec(get_entity(name)).replace('\n', '\n\t'))) And for dict methods: ./python -c from idlelib.CallTips import get_argspec, get_entity; import builtins;^Mfor name in sorted(vars(dict)):^M print('%s:\t%s' % (name, get_argspec(get_entity('{}.'+name)).replace('\n', '\n\t'))) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16638 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16165] sched.scheduler.run() blocks scheduler
Changes by Serhiy Storchaka storch...@gmail.com: Removed file: http://bugs.python.org/file27826/sched_unblock_2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16165 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16165] sched.scheduler.run() blocks scheduler
Serhiy Storchaka added the comment: Oh, I submitted wrong patch (it contained unrelated changes). Here is a right one. -- Added file: http://bugs.python.org/file28254/sched_unblock_3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16165 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16640] Less code under lock in sched.scheduler
New submission from Serhiy Storchaka: In additional to issue16165 I think that sched.scheduler runs more code under a lock than needed. The proposed patch moves this code outside a lock. This unlikely a bug, may be only small enhancement and cleanup. -- components: Library (Lib) files: sched_less_lock.patch keywords: patch messages: 177147 nosy: giampaolo.rodola, pitrou, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Less code under lock in sched.scheduler type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file28255/sched_less_lock.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16640 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16641] sched.scheduler.enter arguments should be modifiable
New submission from Serhiy Storchaka: Example: import sched s=sched.scheduler() s.enter(10, 1, print) Event(time=7452.676787873, priority=1, action=built-in function print, argument=[], kwargs={}) next(s.queue).argument.append(spam) s.enter(5, 1, print) Event(time=7473.326011725, priority=1, action=built-in function print, argument=['spam'], kwargs={}) s.run() spam spam Now every s.enter() call (even for other schedulers) without explicit argument use ['spam'] as argument. Usually functions should not have modifiable arguments (unless it is intentional). We should use non-modifiable value or a sentinel for default. For example an empty tuple as default for argument and None as default for kwargs. -- components: Library (Lib) files: sched_nonmodifiable_args.patch keywords: patch messages: 177151 nosy: giampaolo.rodola, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: sched.scheduler.enter arguments should be modifiable type: behavior versions: Python 3.3, Python 3.4 Added file: http://bugs.python.org/file28256/sched_nonmodifiable_args.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16641 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16641] sched.scheduler.enter arguments should not be modifiable
Changes by Serhiy Storchaka storch...@gmail.com: -- title: sched.scheduler.enter arguments should be modifiable - sched.scheduler.enter arguments should not be modifiable ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16641 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16641] sched.scheduler.enter arguments should not be modifiable
Changes by Serhiy Storchaka storch...@gmail.com: Removed file: http://bugs.python.org/file28256/sched_nonmodifiable_args.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16641 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16641] sched.scheduler.enter arguments should not be modifiable
Serhiy Storchaka added the comment: Sorry, wrong patch. -- Added file: http://bugs.python.org/file28257/sched_nonmodifiable_args.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16641 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16642] Mention new kwargs named tuple parameter in sched module
New submission from Serhiy Storchaka: Here is a patch which adds missed mentions of kwargs named tuple parameter. -- assignee: docs@python components: Documentation files: sched_docs_kwargs.patch keywords: patch messages: 177154 nosy: docs@python, giampaolo.rodola, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Mention new kwargs named tuple parameter in sched module type: behavior versions: Python 3.3, Python 3.4 Added file: http://bugs.python.org/file28258/sched_docs_kwargs.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16642 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16643] Wrong documented default value for timefunc parameter in sched.scheduler()
New submission from Serhiy Storchaka: sched.scheduler() prefers to use time.monotonic as a default value for timefunc parameter, and time.time used only as a fallback. But time.time documented as a default value. -- assignee: docs@python components: Documentation messages: 177155 nosy: docs@python, giampaolo.rodola, haypo, serhiy.storchaka priority: normal severity: normal stage: needs patch status: open title: Wrong documented default value for timefunc parameter in sched.scheduler() type: behavior versions: Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16643 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16644] Wrong code in ContextManagerTests.test_invalid_args() in test_subprocess.py
New submission from Serhiy Storchaka: Test ContextManagerTests.test_invalid_args() in file Lib/test/test_subprocess.py contains code which has no sense. When Popen() fail then this code will not reachable. When Popen() success then c.exception will not assigned. Here is a patch with right test. -- components: Tests files: test_subprocess_test_invalid_args.patch keywords: patch messages: 177164 nosy: ezio.melotti, michael.foord, pitrou, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Wrong code in ContextManagerTests.test_invalid_args() in test_subprocess.py type: behavior versions: Python 3.2, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file28259/test_subprocess_test_invalid_args.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16644 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16645] Wrong test_extract_hardlink() in test_tarfile.py
New submission from Serhiy Storchaka: Test test_extract_hardlink() in Lib/test/test_tarfile.py ran 4 times. First time (uncompressed tarfile) it extract symbolic and hard links successfully, but in other 3 times (gzipped, bzipped and lzma'ed tarfile) extracting fails becouse this links already exists (left from first test). The test just ignore this error and other possible errors (error EEXIST raised, but ignored all except ENOENT). Here is a patch, which adds a right cleanup of extracted links. -- components: Tests files: test_tarfile_test_extract_hardlink.patch keywords: patch messages: 177166 nosy: ezio.melotti, michael.foord, pitrou, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Wrong test_extract_hardlink() in test_tarfile.py type: behavior versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file28260/test_tarfile_test_extract_hardlink.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16645 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16646] FTP.makeport() loses socket error details
New submission from Serhiy Storchaka: In FTP.makeport() a socket error catched and saved but then raised a new error with saved error as argument. Here is a patch which reraises an original error. -- components: Library (Lib) files: ftplib_makeport_raise_err.patch keywords: patch messages: 177171 nosy: serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: FTP.makeport() loses socket error details type: behavior versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file28262/ftplib_makeport_raise_err.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16646 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16646] FTP.makeport() loses socket error details
Changes by Serhiy Storchaka storch...@gmail.com: Removed file: http://bugs.python.org/file28262/ftplib_makeport_raise_err.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16646 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16646] FTP.makeport() loses socket error details
Changes by Serhiy Storchaka storch...@gmail.com: Added file: http://bugs.python.org/file28263/ftplib_makeport_raise_err.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16646 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16647] LMTP.connect() loses socket error details
New submission from Serhiy Storchaka: In LMTP.connect() a socket error catched and saved but then raised a new error with saved error as argument. Here is a patch which reraises an original error. -- components: Library (Lib) files: smtplib_LMTP_connect_raise_err.patch keywords: patch messages: 177172 nosy: serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: LMTP.connect() loses socket error details type: behavior versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file28264/smtplib_LMTP_connect_raise_err.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16647 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16648] stdib should use new exception types from PEP 3151
Serhiy Storchaka added the comment: Right now I'm working on a patch. ;) A pack of issues were produced in process. -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16648 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16650] Popen._internal_poll() references errno.ECHILD outside of the local scope
New submission from Serhiy Storchaka: As noted in Popen._internal_poll() docstring this method cannot reference anything outside of the local scope. However it references errno.ECHILD. The proposed patch fixes this. Is it good that Popen._handle_exitstatus() references building SubprocessError? -- components: Library (Lib) files: subprocess_reference_nonlocal.patch keywords: patch messages: 177201 nosy: asvetlov, pitrou, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Popen._internal_poll() references errno.ECHILD outside of the local scope type: behavior versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file28266/subprocess_reference_nonlocal.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16650 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7330] PyUnicode_FromFormat: implement width and precision for %s, %S, %R, %V, %U, %A
Serhiy Storchaka added the comment: I found one bug and add some nitpicks and optimization suggestion on Rietveld. -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7330 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11159] Sax parser crashes if given unicode file name
Serhiy Storchaka added the comment: However Python doesn't work with bytes filenames (I don't think this is a bug). The proposed patch allows unicode filenames be used in SAX parser. -- keywords: +patch nosy: +serhiy.storchaka stage: - patch review Added file: http://bugs.python.org/file28268/sax_unicode_fn-2.7.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11159 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16647] LMTP.connect() loses socket error details
Serhiy Storchaka added the comment: Patch updated. It can be simpler. -- Added file: http://bugs.python.org/file28269/smtplib_LMTP_connect_raise_err_2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16647 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16647] LMTP.connect() loses socket error details
Changes by Serhiy Storchaka storch...@gmail.com: Removed file: http://bugs.python.org/file28264/smtplib_LMTP_connect_raise_err.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16647 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16650] Popen._internal_poll() references errno.ECHILD outside of the local scope
Serhiy Storchaka added the comment: I'm just asking if this is a bug. If using building exceptions is safe, then we can get rid of _os_error and _ECHILD in 3.3+, using OSError and ChildProcessError instead. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16650 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15955] gzip, bz2, lzma: add option to limit output size
Serhiy Storchaka added the comment: you can just stick if not output: continue before it. And then hang. Because d.unconsumed_tail is not empty and no new data will be read. Why is this necessary? If unconsumed_tail is b'', then there's no need to prepend it (and the concatenation would be a no-op anyway). If unconsumed_tail does contain data, then we don't need to read additional compressed data from the file until we've finished decompressing the data we already have. What if unconsumed_tail is not empty but less than needed to decompress at least one byte? We need read more data until unconsumed_tail grow enought to be decompressed. Are you proposing that the decompressor object maintain its own buffer, and copy the input data into it before passing it to the decompression library? Doesn't that just duplicate work that the library is already doing for us? unconsumed_tail is such buffer and when we call decompressor with new chunk of data we should allocate buffer of size (len(unconsumed_tail)+len(compressed)) and copy len(unconsumed_tail) bytes from unconsumed_tail and len(compressed) from gotten data. But when you use internal buffer, you should only copy new data. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15955 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16651] Find out what stdlib modules lack a pure Python implementation
Serhiy Storchaka added the comment: array audioop binascii random re struct xml.parsers.expat cjkcodecs zlib, bz2, lzma and crypts also can be implemented in pure Python. -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16651 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15872] shutil.rmtree(..., ignore_errors=True) doesn't ignore all errors
Serhiy Storchaka added the comment: Thank you, Hynek, for review and committing. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15872 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15872] shutil.rmtree(..., ignore_errors=True) doesn't ignore all errors
Serhiy Storchaka added the comment: Thank you, Hynek, for review and committing. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15872 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15872] shutil.rmtree(..., ignore_errors=True) doesn't ignore all errors
Changes by Serhiy Storchaka storch...@gmail.com: -- Removed message: http://bugs.python.org/msg177269 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15872 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16645] Wrong test_extract_hardlink() in test_tarfile.py
Changes by Serhiy Storchaka storch...@gmail.com: Removed file: http://bugs.python.org/file28260/test_tarfile_test_extract_hardlink.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16645 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16645] Wrong test_extract_hardlink() in test_tarfile.py
Changes by Serhiy Storchaka storch...@gmail.com: Added file: http://bugs.python.org/file28275/test_tarfile_test_extract_hardlink.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16645 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16656] os.walk ignores international dirs on Windows
Serhiy Storchaka added the comment: It is reproduced on 3.x? -- nosy: +serhiy.storchaka type: - behavior versions: -Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16656 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16656] os.walk ignores international dirs on Windows
Changes by Serhiy Storchaka storch...@gmail.com: -- Removed message: http://bugs.python.org/msg177278 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16656 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16656] os.walk ignores international dirs on Windows
Serhiy Storchaka added the comment: Is it reproduced on 3.x? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16656 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16651] Find out what stdlib modules lack a pure Python implementation
Serhiy Storchaka added the comment: So expat doesn't count as that literally wraps the expat library. XML parser can be implemented in pure Python. There are a lot of XML parsers implemented in different programming languages. Random also requires accessing the system randomization libraries to work properly so I don't think that is a candidate either. No, random have C implemented some basic methods only for speed. It uses time() system function for initial seeding, but time() is accessible from pure Python too. Some OS-specific modules (pwd, grp, spwd, resource, ossaudiodev, etc) can be implemented in pure Python on some platforms (using I/O and ioctl on special files in /etc, /dev or /proc). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16651 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16659] Pure Python implementation of random
New submission from Serhiy Storchaka: C implemented part of random module does not depend on any specific C level abilities. Here is a patch which implements this part on pure Python. May be this is not a best implementation. And I don't know how write tests for both implementations. -- components: Library (Lib) files: random_pure_python.patch keywords: patch messages: 177315 nosy: brett.cannon, rhettinger, serhiy.storchaka priority: normal severity: normal stage: needs patch status: open title: Pure Python implementation of random type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file28278/random_pure_python.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16659 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16659] Pure Python implementation of random
Serhiy Storchaka added the comment: Patch updated. Tests now test both implementation. Thank Ezio for tip. -- Added file: http://bugs.python.org/file28279/random_pure_python_2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16659 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16651] Find out what stdlib modules lack a pure Python implementation
Changes by Serhiy Storchaka storch...@gmail.com: -- dependencies: +Pure Python implementation of random ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16651 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16659] Pure Python implementation of random
Serhiy Storchaka added the comment: I wonder whether it would make sense to use an array to hold the MT state, for a closer match with the C code. I don't think it makes sense. The algorithm is same and list is more natural for Python. Also arrays a little slower than lists, but it doesn't matter, because Python implementation of random slower C implementation anyway. -- stage: needs patch - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16659 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16656] os.walk ignores international dirs on Windows
Serhiy Storchaka added the comment: What are the results of os.listdir(b'.') and os.listdir(u'.') on Python 2.7 and Python 3.3+? What are the results of os.stat(b'Русское имя') and os.stat(b'Русское имя') on Python 2.7 and Python 3.3+? What are the results of sys.getdefaultencoding(), sys.getfilesystemencoding(), locale.getpreferredencoding(False) and locale.getpreferredencoding(True) on Python 2.7 and Python 3.3+? If any of those calls fail, please provide a full traceback. -- stage: committed/rejected - test needed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16656 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16659] Pure Python implementation of random
Serhiy Storchaka added the comment: Yes, I used test_heapq and test_decimal as an example. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16659 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16659] Pure Python implementation of random
Changes by Serhiy Storchaka storch...@gmail.com: Removed file: http://bugs.python.org/file28278/random_pure_python.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16659 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16656] os.walk ignores international dirs on Windows
Serhiy Storchaka added the comment: My guess is that your unicode issue is issue 1602, which is non-trivial to solve. In such case the output will be something like: ['English name', ''] [] [] -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16656 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16664] [PATCH] Test Glob: files starting with .
Serhiy Storchaka added the comment: See also issue16618. -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16664 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16641] sched.scheduler.enter arguments should not be modifiable
Serhiy Storchaka added the comment: Patch updated. Thanks Amaury for nits. -- Added file: http://bugs.python.org/file28282/sched_nonmodifiable_args_2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16641 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16659] Pure Python implementation of random
Changes by Serhiy Storchaka storch...@gmail.com: Added file: http://bugs.python.org/file28283/random_pure_python_3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16659 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16659] Pure Python implementation of random
Changes by Serhiy Storchaka storch...@gmail.com: Removed file: http://bugs.python.org/file28279/random_pure_python_2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16659 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11290] ttk.Combobox['values'] String Conversion to Tcl
Serhiy Storchaka added the comment: Issue15861 has a more general patch which fixes also this issue. -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11290 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15861] ttk.Treeview unmatched open brace in list
Changes by Serhiy Storchaka storch...@gmail.com: Removed file: http://bugs.python.org/file28011/tkinter_quoting_2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15861 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15861] ttk.Treeview unmatched open brace in list
Serhiy Storchaka added the comment: Patch updated. Added additional tests for ttk.Combobox (see issue11290). -- Added file: http://bugs.python.org/file28286/tkinter_quoting_3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15861 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15861] ttk.Treeview unmatched open brace in list
Serhiy Storchaka added the comment: Patch for 2.7 added. -- Added file: http://bugs.python.org/file28287/tkinter_quoting_3-2.7.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15861 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11290] ttk.Combobox['values'] String Conversion to Tcl
Changes by Serhiy Storchaka storch...@gmail.com: -- superseder: - ttk.Treeview unmatched open brace in list versions: +Python 2.7, Python 3.2, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11290 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15045] Make textwrap.dedent() consistent with str.splitlines(True) and str.strip()
Serhiy Storchaka added the comment: Ezra's patch is working, but a little non-optimal. However, I'm not sure, that it is right to extend a set of whitespace characters. See comments at the top of the file. Also this approach should be slower, especially for trivial case (no changes). -- nosy: +serhiy.storchaka stage: needs patch - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15045 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16656] os.walk ignores international dirs on Windows
Serhiy Storchaka added the comment: Thank you, Anatoly, for report. I'll try to investigate this issue. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16656 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16656] os.walk ignores international dirs on Windows
Serhiy Storchaka added the comment: Anatoly, can you please run the attached test? -- Added file: http://bugs.python.org/file28291/test_unicode_fname.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16656 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16656] os.walk ignores international dirs on Windows
Changes by Serhiy Storchaka storch...@gmail.com: Added file: http://bugs.python.org/file28293/test_unicode_fname.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16656 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16656] os.walk ignores international dirs on Windows
Changes by Serhiy Storchaka storch...@gmail.com: Removed file: http://bugs.python.org/file28291/test_unicode_fname.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16656 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16669] Docstrings for namedtuple
New submission from Serhiy Storchaka: Here are two patches which implementation two different interface for same feature. In first patch you can use *doc* and *field_docs* arguments to specify namedtuple class docstring and field docstrings. For example: Point = namedtuple('Point', 'x y', doc='Point: 2-dimensional coordinate', field_docs=['abscissa', 'ordinate']) In second patch you can use *doc* argument to specify namedtuple class docstring and *field_names* argument can be a sequence of pairs: field name and field docstring. For example: Point = namedtuple('Point', [('x', 'absciss'), ('y', 'ordinate')], doc='Point: 2-dimensional coordinate') What approach is better? Feel free to correct a documentation. I know that it need a correction. -- components: Library (Lib) files: namedtuple_docstrings_field_docs.patch keywords: patch messages: 177381 nosy: rhettinger, serhiy.storchaka priority: normal severity: normal status: open title: Docstrings for namedtuple type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file28294/namedtuple_docstrings_field_docs.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16669 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16669] Docstrings for namedtuple
Changes by Serhiy Storchaka storch...@gmail.com: Added file: http://bugs.python.org/file28295/namedtuple_docstrings_tuples_seq.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16669 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16659] Pure Python implementation of random
Serhiy Storchaka added the comment: Patch updated. Comments and docstrings a little enhanced. Thanks Brett for review. Also Python implementation of core generator now is threadsafe (in particular random() and getrandbits() methods) as its C implementation and its private members now are more hidden (to prevent unintentional conflicts). See differences between patches for details. -- Added file: http://bugs.python.org/file28296/random_pure_python_4.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16659 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16659] Pure Python implementation of random
Changes by Serhiy Storchaka storch...@gmail.com: Removed file: http://bugs.python.org/file28296/random_pure_python_4.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16659 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16659] Pure Python implementation of random
Serhiy Storchaka added the comment: Patch updated. One bug fixed. Also I made some benchmarks. The pure Python random() about 100 times slower and getrandbits(32) about 13 times slower than the C implementation. -- Added file: http://bugs.python.org/file28303/random_pure_python_5.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16659 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16669] Docstrings for namedtuple
Serhiy Storchaka added the comment: Yes, we can use inheritance trick/idiom to specify a class docstring. But there are no way to specify attribute docstrings. I encountered this when rewriting some C implemented code to Python. PyStructSequence allows you to specify docstrings for a class and attributes, but namedtuple does not. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16669 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16674] Faster getrandbits() for small integers
New submission from Serhiy Storchaka: The proposed patch adds a fast patch for generating small integers (the most common use case). Microbenchmark: $ ./python -m timeit -s import random; r=random.getrandbits; n=30 r(n);r(n);r(n);r(n);r(n);r(n);r(n);r(n);r(n);r(n) Non patched: 4.27 usec per loop Patched: 2.97 usec per loop -- components: Extension Modules files: random_getrandbits_fastpath.patch keywords: patch messages: 177436 nosy: mark.dickinson, rhettinger, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Faster getrandbits() for small integers type: performance versions: Python 3.4 Added file: http://bugs.python.org/file28304/random_getrandbits_fastpath.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16674 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16656] os.walk ignores international dirs on Windows
Serhiy Storchaka added the comment: Thanks, Anatoly. I see an actual bug. FindFirstFile and FindNextFile return broken name if file unicode name can't be represented in current codepage. I don't know what is perfect solution for this issue. On 2.7 we can decode listdir() argument to unicode and then encode result names to str with sys.getfilesystemencoding() only if it is possible. Therefore listdir() with str argument will return unicode for non-encodable names. This should not make many new problems in addition to those which 2.7 already have with Unicode. But on 3.x listdir() with bytes argument can returns only bytes objects. I don't know what to do with non-encodable names in such case. Perhaps an exception should be raised. Fortunately listdir() with bytes argument is rarely used on 3.x. -- components: +Extension Modules, Unicode, Windows -Library (Lib) nosy: +ezio.melotti, larry, loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16656 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16682] Document that audioop works with bytes, not strings
New submission from Serhiy Storchaka: The audioop module documentation says that functions works with Python strings. This was right in 2.x, but in 3.x here should be bytes objects (actually the functions accept strings too, but this is an implementation detail, meaningless in general). -- assignee: docs@python components: Documentation messages: 177474 nosy: docs@python, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Document that audioop works with bytes, not strings type: enhancement versions: Python 3.2, Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16682 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16682] Document that audioop works with bytes, not strings
Changes by Serhiy Storchaka storch...@gmail.com: -- keywords: +patch Added file: http://bugs.python.org/file28312/audioop_docs_bytes.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16682 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16683] Resort audioop documentation
New submission from Serhiy Storchaka: Functions in the audioop module documentation enumerated in alphabetic order. Only one function out of order. Here is a patch that fixes this. -- assignee: docs@python components: Documentation files: audioop_docs_resort.patch keywords: patch messages: 177475 nosy: docs@python, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Resort audioop documentation type: enhancement versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file28313/audioop_docs_resort.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16683 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16685] Deprecate accepting strings as arguments in audioop functions
New submission from Serhiy Storchaka: Inadvertently strings accepted as arguments of audioop functions. This is a meaningless behavior and remnant of Python 2. We should drop string support. -- components: Extension Modules messages: 177477 nosy: serhiy.storchaka priority: normal severity: normal stage: needs patch status: open title: Deprecate accepting strings as arguments in audioop functions type: enhancement versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16685 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16656] os.walk ignores international dirs on Windows
Serhiy Storchaka added the comment: Surrogateescape is for non-decodable names. Here we have a problem with non-encodable names. I know that naive approach with using only Unicode API inside is not work because Windows use complex logic for filename encoding (for example dropping diacritics). Perhaps Martin have more to say. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16656 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16686] audioop overflow issues
New submission from Serhiy Storchaka: The audioop module has some issues with an overflow. 1. It uses post-checks for an integer overflow. This means using an undefined behavior. 2. When the result truncated in case of overflow, -maxval used as minimal value. But real minimum value is less (-maxval - 1). This means not using full possible range and causes an odd result of some operations (for example add(b'\x80', '\x00', 1) returns b'\x81'). 3. Some operations (for example bias()) does not truncating and just overflow. 4. lin2lin() conversion from 4 to 4 (should do nothing) loses 16 lowest bits. -- components: Extension Modules messages: 177482 nosy: mark.dickinson, serhiy.storchaka priority: normal severity: normal stage: needs patch status: open title: audioop overflow issues type: behavior versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16686 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16626] Infinite recursion in glob.glob('*:') on Windows
Serhiy Storchaka added the comment: Patch contains unrelated changes. Sorry, my fault. Here is a cleaned patch. -- Added file: http://bugs.python.org/file28314/glob_magic_in_drive.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16626 ___diff -r ece75a3b942c Lib/glob.py --- a/Lib/glob.py Wed Dec 05 17:59:29 2012 +0200 +++ b/Lib/glob.py Thu Dec 06 13:07:58 2012 +0200 @@ -28,7 +28,7 @@ if not dirname: yield from glob1(None, basename) return -if has_magic(dirname): +if dirname != pathname and has_magic(dirname): dirs = iglob(dirname) else: dirs = [dirname] ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16626] Infinite recursion in glob.glob('*:') on Windows
Changes by Serhiy Storchaka storch...@gmail.com: Removed file: http://bugs.python.org/file28221/glob_magic_in_drive.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16626 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16685] Deprecate accepting strings as arguments in audioop functions
Serhiy Storchaka added the comment: What happens if you pass strings? They are encoded with UTF-8. See 's#' and 's*' formats in PyArg_ParseTuple() ('y*' recommended for bytes). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16685 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16656] os.walk ignores international dirs on Windows
Serhiy Storchaka added the comment: Ah, I misunderstood your comment. Ah, you misunderstood my comment right now. So, listdir is returning the correct the filename, it's just that we can't encode it to the console encoding. listdir() returns already irremediably broken filename (all Cyrillic letters replaced with '?'). My test script outputs only ascii data, you see literally what you get, there is no output encoding issues. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16656 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com