[issue33040] Make itertools.islice supports negative values for start and stop arguments for sized iterable object

2021-04-28 Thread Yaroslav Nikitenko
Yaroslav Nikitenko added the comment: Sorry for a typo. The paragraph before the last should read Negative *step* fundamentally changes the algorithm:... flow[-1:None:-1]. -- ___ Python tracker <https://bugs.python.org/issue33

[issue33040] Make itertools.islice supports negative values for start and stop arguments for sized iterable object

2021-04-28 Thread Yaroslav Nikitenko
Yaroslav Nikitenko added the comment: I hope it's fine to add to closed topics here. I agree with the decision that islice should not handle a special case of sized containers vs iterables. However, I think that the support of negative indices in islice would be nice. A simple use

[issue21041] pathlib.PurePath.parents rejects negative indexes

2020-11-23 Thread Yaroslav Pankovych
Yaroslav Pankovych added the comment: Agree with that, it currently supports this behavior. -- ___ Python tracker <https://bugs.python.org/issue21041> ___ ___

[issue21041] pathlib.PurePath.parents rejects negative indexes

2020-11-23 Thread Yaroslav Pankovych
Yaroslav Pankovych added the comment: And it looks like a special case, so "Special cases aren't special enough to break the rules." -- ___ Python tracker <https://bugs.pyt

[issue21041] pathlib.PurePath.parents rejects negative indexes

2020-11-21 Thread Yaroslav Pankovych
Yaroslav Pankovych added the comment: That makes sense, but should we have this behaviour only for negative indices? We'll end up with something lie: path.parents[len(path.parents) - 1] != path.parents[-1] I think that is should be consistent regardless of negative/positive in

[issue41594] Intermittent failures of loop.subprocess_exec() to capture output

2020-08-25 Thread Yaroslav Halchenko
Yaroslav Halchenko added the comment: Might (although unlikely) be related to https://bugs.python.org/issue40634 which is about BlockingIOError being raised (and ignored) if SelectorEventLoop is reused (not the case here) also in the case of short lived processes. -- nosy

[issue21041] pathlib.PurePath.parents rejects negative indexes

2020-08-22 Thread Yaroslav Pankovych
Yaroslav Pankovych added the comment: Any thoughts about that folks? It's a pretty old bug, let's decide smth for it. -- ___ Python tracker <https://bugs.python.o

[issue21041] pathlib.PurePath.parents rejects negative indexes

2020-08-10 Thread Yaroslav Pankovych
Yaroslav Pankovych added the comment: Here's possible fix: https://github.com/python/cpython/pull/21799 -- ___ Python tracker <https://bugs.python.org/is

[issue21041] pathlib.PurePath.parents rejects negative indexes

2020-08-10 Thread Yaroslav Pankovych
Yaroslav Pankovych added the comment: That's kinda weird for python. I mean, in regular list/etc if I need the last element, I'd normally do list[-1], but here to get the last parent, I need to actually know how many parents do I have. So now, I can do something

[issue41511] Pathlib parents doesn't support slicing with negative indexes

2020-08-09 Thread Yaroslav
Yaroslav added the comment: Here's opened PR: https://github.com/python/cpython/pull/21799 -- ___ Python tracker <https://bugs.python.org/issue41511> ___ ___

[issue41511] Pathlib parents doesn't support slicing with negative indexes

2020-08-09 Thread Yaroslav
New submission from Yaroslav : As I can see, pathlib path parents don't support slicing with negative indexes: >>> import pathlib >>> path = pathlib.PosixPath("some/very/long/path/here") >>> path.parents[-1] ... raise IndexError(idx) IndexError:

[issue41455] Python Devguide differs from python docs

2020-08-02 Thread Yaroslav
Yaroslav added the comment: Here's opened PR. https://github.com/python/cpython/pull/21703 -- nosy: -python-dev ___ Python tracker <https://bugs.python.org/is

[issue41455] Python Devguide differs from python docs

2020-08-02 Thread Yaroslav
Yaroslav added the comment: As I can see here https://github.com/python/devguide/blob/master/garbage_collector.rst#collecting-the-oldest-generation > the GC only triggers a full collection of the oldest generation if the ratio > long_lived_pending / long_lived_total is above a given

[issue40634] Ignored "BlockingIOError: [Errno 11] Resource temporarily unavailable" are still haunting us

2020-06-15 Thread Yaroslav Halchenko
Yaroslav Halchenko added the comment: any feedback/ideas/fixes would still be highly appreciated. Thank you! -- ___ Python tracker <https://bugs.python.org/issue40

[issue40634] Ignored "BlockingIOError: [Errno 11] Resource temporarily unavailable" are still haunting us

2020-05-15 Thread Yaroslav Halchenko
New submission from Yaroslav Halchenko : This is a reincarnation of previous issues such as - older https://bugs.python.org/issue21595 which partially (with ack on that) addressed the issue awhile back - more recent https://bugs.python.org/issue38104 which was closed as "wont fix&qu

[issue38801] Scientific notation doesn't work with itertools.islice

2019-11-14 Thread Yaroslav Nikitenko
Yaroslav Nikitenko added the comment: Hello Raymond. Many thanks for your explanation. In this case I suggest any of the following: 1) distinguish between integer and floating numbers in scientific notation. Definitely, 1e+6 is an integer. I can't see where else numbers in scien

[issue38801] Scientific notation doesn't work with itertools.islice

2019-11-14 Thread Yaroslav Nikitenko
New submission from Yaroslav Nikitenko : Numbers written in scientific notation don't work with itertools.islice. Check this script: # a usual function works ## def works as well f = lambda x : x f(1e+6) # 100.0 import itertools # islice without scientific notation

[issue38449] regression - mimetypes guess_type is confused by ; in the filename

2019-10-11 Thread Yaroslav Halchenko
Yaroslav Halchenko added the comment: FWIW, our more complete test filename is # python3 -c 'import patoolib.util as ut; print(ut.guess_mime(r" \"\`;b&b&c |.tar.gz"))' (None, None) which works fine with older versions -- _

[issue38449] regression - mimetypes guess_type is confused by ; in the filename

2019-10-11 Thread Yaroslav Halchenko
New submission from Yaroslav Halchenko : Our tests in DataLad started to fail while building on Debian with Python 3.7.5rc1 whenever they passed just fine previously with 3.7.3rc1. Analysis boiled down to mimetypes $> ./python3.9 -c 'import mimetypes; mimedb = mimetypes.MimeType

[issue32276] there is no way to make tempfile reproducible (i.e. seed the used RNG)

2017-12-12 Thread Yaroslav Halchenko
Yaroslav Halchenko added the comment: I have spent too much time in Python to be able to compare to other languages ;) but anywhere I saw RNG being used, there was a way to seed it or to provide a state. tempfile provides no such API my usecase -- comparison of logs from two runs where I

[issue32276] there is no way to make tempfile reproducible (i.e. seed the used RNG)

2017-12-11 Thread Yaroslav Halchenko
New submission from Yaroslav Halchenko : It is quite often desired to reproduce the same failure identically. In many cases sufficient to seed the shared random._inst (via random.seed). tempfile creates new instance(s) for its own operation and does not provide API to seed it. I do not think

[issue31651] io.FileIO cannot write more than 2GB (-4096) bytes??? must be documented (if not fixed)

2017-09-30 Thread Yaroslav Halchenko
Yaroslav Halchenko added the comment: Thank you for the follow-ups! Wouldn't it be better if Python documentation said exactly that On Linux, write() (and similar system calls) will transfer at most 0x7000 (2,147,479,552) bytes, returning the number of bytes actually transf

[issue31651] io.FileIO cannot write more than 2GB (-4096) bytes??? must be documented (if not fixed)

2017-09-30 Thread Yaroslav Halchenko
New submission from Yaroslav Halchenko : originally detected on python 2.7, but replicated with python 3.5.3 -- apparently io.FileIO, if given a bytestring of 2GB or more, cannot write it all at once -- saves (and returns that size) only 2GB - 4096. I found no indication for such behavior

[issue30438] tarfile would fail to extract tarballs with files under R/O directories (twice)

2017-05-24 Thread Yaroslav Halchenko
Changes by Yaroslav Halchenko : -- title: tarfile would fail to extract tarballs with files under R/O directories -> tarfile would fail to extract tarballs with files under R/O directories (twice) ___ Python tracker <http://bugs.pyth

[issue30438] tarfile would fail to extract tarballs with files under R/O directories

2017-05-24 Thread Yaroslav Halchenko
Yaroslav Halchenko added the comment: Dear Catherine, Thank you very much for looking into it!! And sorry that I have missed the fact of recursive addition when pointing to a directory. Indeed though, tar handles that case a bit more gracefully. BUT I feel somewhat dumb since I am afraid

[issue30438] tarfile would fail to extract tarballs with files under R/O directories

2017-05-22 Thread Yaroslav Halchenko
New submission from Yaroslav Halchenko: If tarfile contains a file under a directory which has no write permission, extractall would fail since chmod'ing of the directory is done right when it is "extracted". Please find attached a quick&dummy script to demonstrate the pr

[issue25284] Spec for BaseEventLoop.run_in_executor(executor, callback, *args) is outdated in documentation

2015-09-30 Thread Yaroslav Admin
Changes by Yaroslav Admin : -- title: Docs for BaseEventLoop.run_in_executor(executor, callback, *args) is outdated in documentation -> Spec for BaseEventLoop.run_in_executor(executor, callback, *args) is outdated in documentation ___ Pyt

[issue25284] Docs for BaseEventLoop.run_in_executor(executor, callback, *args) is outdated in documentation

2015-09-30 Thread Yaroslav Admin
New submission from Yaroslav Admin: Parameter for BaseEventLoop.run_in_executor(executor, callback, *args) was renamed from callback to func in 3.5.0 release, but it's not reflected in the docs. Commit with change: https://github.com/python/cpython/c

[issue13248] deprecated in 3.2/3.3, should be removed in 3.5 or ???

2015-07-30 Thread Yaroslav Halchenko
Yaroslav Halchenko added the comment: the function getargspec was removed but references to it within docstrings remained: $> git grep getargspec Doc/library/inspect.rst: The first four items in the tuple correspond to :func:`getargspec`. Doc/library/inspect.rst: :func:`getargspec`

[issue16997] subtests

2013-02-11 Thread Yaroslav Halchenko
Changes by Yaroslav Halchenko : -- nosy: -Yaroslav.Halchenko ___ Python tracker <http://bugs.python.org/issue16997> ___ ___ Python-bugs-list mailing list Unsub

[issue9998] ctypes find_library should search LD_LIBRARY_PATH on linux

2011-07-25 Thread Yaroslav Bulatov
Yaroslav Bulatov added the comment: Sorry for confusion, I meant the original problem causes problems. I haven't tested the patch because my target machines don't have gcc -- ___ Python tracker <http://bugs.python.

[issue9998] ctypes find_library should search LD_LIBRARY_PATH on linux

2011-07-25 Thread Yaroslav Bulatov
Yaroslav Bulatov added the comment: This causes problem for Freetype Python bindings on Linux -- ___ Python tracker <http://bugs.python.org/issue9998> ___ ___

[issue9998] ctypes find_library should search LD_LIBRARY_PATH on linux

2011-07-25 Thread Yaroslav Bulatov
Changes by Yaroslav Bulatov : -- nosy: +yaroslavvb ___ Python tracker <http://bugs.python.org/issue9998> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11443] Zip password issue

2011-03-09 Thread Yaroslav
Yaroslav added the comment: Ok, i try that example in new versions 3+, and it works there. Thanks -- status: open -> closed ___ Python tracker <http://bugs.python.org/issu

[issue11443] Zip password issue

2011-03-08 Thread Yaroslav
Yaroslav added the comment: I forgot zip file -- Added file: http://bugs.python.org/file21052/data.zip ___ Python tracker <http://bugs.python.org/issue11

[issue11443] Zip password issue

2011-03-08 Thread Yaroslav
New submission from Yaroslav : There's issue while setting password. I brute-force different passwords for that arhive-file, and it pass with different, not correct password. For that arhive password is: "pass", but that arhive is correct in python and even extract files fro

[issue10006] non-Pythonic fate of __abstractmethods__

2010-10-01 Thread Yaroslav Halchenko
Yaroslav Halchenko added the comment: yikes... surprising resolution -- I expected that fix would either makes __abstractmethods__ accessible in derived "type"s or becomes absent from output of dir() -- but none of those has happened. Now we ended up with a consistent non-Python

[issue10006] non-Pythonic fate of __abstractmethods__

2010-10-01 Thread Yaroslav Halchenko
New submission from Yaroslav Halchenko : We ran into this while generating documentation for our project (PyMVPA) with recent sphinx and python2.6 (fine with 2.5, failed for 2.6, 2.7, 3.1), which relies on traversing all attributes given by "dir(obj)", BUT apparently __abstrac

[issue9235] missing "import sys" in Tools/gdb/libpython.py

2010-07-12 Thread Yaroslav Halchenko
Yaroslav Halchenko added the comment: sorry -- git describe was by mistake in there... report is based on SVN revision 82502 -- ___ Python tracker <http://bugs.python.org/issue9

[issue9235] missing "import sys" in Tools/gdb/libpython.py

2010-07-12 Thread Yaroslav Halchenko
New submission from Yaroslav Halchenko : as you can see from below, sys. is used, but never imported (besides a docstring) $> git describe upstream/0.5.0.dev-875-gf06319e $> grep -5 'sys' /home/yoh/proj/misc/python/Tools/gdb/libpython.py """ During developme

[issue7897] Support parametrized tests in unittest

2010-05-11 Thread Yaroslav Halchenko
Yaroslav Halchenko added the comment: Hi Nick, Am I reading your right, Are you suggesting to implement this manual looping/collecting/reporting separately in every unittest which needs that? On Tue, 11 May 2010, Nick Coghlan wrote: > Nick Coghlan added the comment: > I agree with M

[issue7897] Support parametrized tests in unittest

2010-04-09 Thread Yaroslav Halchenko
Yaroslav Halchenko added the comment: Fernando, I agree... somewhat ;-) At some point (whenever everything works fine and no unittests fail) I wanted to merry sweepargs to nose and make it spit out a dot (or animate a spinning wheel ;)) for every passed unittest, so instead of 300 dots I got

[issue7897] Support parametrized tests in unittest

2010-04-08 Thread Yaroslav Halchenko
Yaroslav Halchenko added the comment: In PyMVPA we have our little decorator as an alternative to Fernando's generators, and which is closer, I think, to what Michael was wishing for: @sweepargs http://github.com/yarikoptic/PyMVPA/blob/master/mvpa/testing/sweepargs.py NB it has some