[issue12750] datetime.strftime('%s') should respect tzinfo

2014-08-21 Thread Akira Li
Akira Li added the comment: issue22246 discusses the reverse: strptime('12345', '%s') -- ___ Python tracker <http://bugs.python.org/issue12750> ___ __

[issue22241] strftime/strptime round trip fails even for UTC datetime object

2014-08-21 Thread Akira Li
Akira Li added the comment: > I see that you participated in the original discussion (msg107608). > We settled on str(timezone.utc) == 'UTC+00:00' and this was clearly a > deliberate choice. I don't think we can revisit this now, but we can > probably make strptim

[issue22274] subprocess.Popen(stderr=STDOUT) fails to redirect subprocess stderr to stdout

2014-08-25 Thread Akira Li
New submission from Akira Li: The following command should not produce any output but it does: $ ./python >/dev/null -c 'import subprocess as S, sys; S.call([sys.executable, "-c", "import sys; print(42, file=sys.stderr)"], stderr=S.STDOUT)' Its stdout is r

[issue22274] subprocess.Popen(stderr=STDOUT) fails to redirect subprocess stderr to stdout

2014-08-28 Thread Akira Li
Akira Li added the comment: Josh, on Windows, if at least one standard stream is replaced; all three hStdInput, hStdOutput, hStdError handles are provided (all-or-nothing). On POSIX, standard streams stdin (0), stdout (1), stderr (2) are always inherited from the parent. Each stream can be

[issue22277] webbrowser.py add parameters to suppress output on stdout and stderr

2014-08-28 Thread Akira Li
Akira Li added the comment: open(url, stdout=DEVNULL) won't work on Windows (os.startfile()) and OS X (AppleScript) by default. UnixBrowser already suppresses the output when it is safe, if self.redirect_stdout=True and self.background=True are set. Also, open(url, stdout=DEVNULL)

[issue22296] cookielib uses time.time(), making incorrect checks of expiration times in cookies

2014-09-01 Thread Akira Li
Akira Li added the comment: time.time() returns the current time in seconds since Epoch it is neither local nor UTC time. It can be converted to both. You can get local time using datetime.fromtimestamp(ts). You can get UTC time using datetime.utcfromtimestamp(ts) or to get an aware datetime

[issue22296] cookielib uses time.time(), making incorrect checks of expiration times in cookies

2014-09-01 Thread Akira Li
Akira Li added the comment: timestamp() method works correctly for an aware datetime objects as in my example (notice: timezone.utc in the code). The issue is not that it is a manual computation, the issue is that it is incorrect: #XXX WRONG, DO NOT DO IT time.mktime

[issue22296] cookielib uses time.time(), making incorrect checks of expiration times in cookies

2014-09-01 Thread Akira Li
Akira Li added the comment: The last example assumes that time.gmtime(0) is 1970-01-01 00:00:00Z (otherwise time.time() may return different timestamp) -- ___ Python tracker <http://bugs.python.org/issue22

[issue22356] mention explicitly that stdlib assumes gmtime(0) epoch is 1970

2014-09-07 Thread Akira Li
New submission from Akira Li: See discussion on Python-ideas https://mail.python.org/pipermail/python-ideas/2014-September/029228.html -- assignee: docs@python components: Documentation files: docs-time-epoch_is_1970.diff keywords: patch messages: 226539 nosy: akira, docs@python

[issue22377] %Z in strptime doesn't match EST and others

2014-09-13 Thread Akira Li
Akira Li added the comment: if PEP 431 is implemented (or anything that gives access to zoneinfo) then strptime could extend the list of timezones it accepts (utc + local timezone names) to include names from the tz database: import pytz # $ pip install pytz {tzname for tz in map

[issue22377] %Z in strptime doesn't match EST and others

2014-09-13 Thread Akira Li
Akira Li added the comment: Without %z (utc offset) strptime returns a naive datetime object that is interpreted as utc or local time usually. It might explain why %Z tries to match only utc and the local timezone names. -- ___ Python tracker <h

[issue22426] strptime accepts the wrong '2010-06-01 MSK' string but rejects the right '2010-06-01 MSD'

2014-09-16 Thread Akira Li
New submission from Akira Li: >>> import os >>> import time >>> os.environ['TZ'] = 'Europe/Moscow' >>> time.tzset() >>> time.strptime('2010-06-01 MSK', '%Y-%m-%d %Z') time.struct_time(tm_year=2010, tm

[issue22426] strptime accepts the wrong '2010-06-01 MSK' string but rejects the right '2010-06-01 MSD'

2014-09-16 Thread Akira Li
Akira Li added the comment: Correction: The correct offset is +0400: >>> dt = datetime(2010, 5, 31, 20, tzinfo=timezone.utc).astimezone() And _timezones dict is defined in Lib/email/_parseaddr.py -- ___ Python tracker <http://bug

[issue22377] %Z in strptime doesn't match EST and others

2014-09-16 Thread Akira Li
Akira Li added the comment: If the current implementation is considered correct (%Z not recognizing EST) then indeed extending the list of recognized timezones is another issue. And the docs should be changed to match the implementation. The current behavior is broken, see also issue22426 If

[issue22426] strptime accepts the wrong '2010-06-01 MSK' string but rejects the right '2010-06-01 MSD'

2014-09-16 Thread Akira Li
Akira Li added the comment: My patch for issue22377 also fixes this bug. With the patch applied. Both MSK and MSD are accepted if the new timezones parameter is false (default for Python 3.5, will be changed to True in Python 3.6 If timezones is True then MSD return a correct aware datetime

[issue22426] strptime accepts the wrong '2010-06-01 MSK' string but rejects the right '2010-06-01 MSD'

2014-09-16 Thread Akira Li
Akira Li added the comment: MSD variant works on my machine because C library uses the historical timezone database there. I'm not sure whether it works on old Windows versions. -- ___ Python tracker <http://bugs.python.org/is

[issue22442] subprocess.check_call hangs on large PIPEd data.

2014-09-19 Thread Akira Li
Akira Li added the comment: > This is a documented failure on the python subprocess page, > but why not just fix it up directly in python itself? If you want to discard the output; you could use: check_call(args, stdin=DEVNULL, stdout=DEVNULL, stderr=STDOUT) check_call() pass

[issue22377] %Z in strptime doesn't match EST and others

2014-09-19 Thread Akira Li
Akira Li added the comment: > I don't think we are going to support a timezone list like that without PEP > 431. PEP 431 won't fix this issue. See below. > You should attach your patch to a new issue. When I said this should > the doc issue, that is because only a doc

[issue22443] read(1) blocks on unflushed output

2014-09-19 Thread Akira Li
Akira Li added the comment: Related: http://stackoverflow.com/questions/25923901/last-unbuffered-line-cant-be-read Make sure you follow the links in the comments. -- nosy: +akira ___ Python tracker <http://bugs.python.org/issue22

[issue22442] subprocess.check_call hangs on large PIPEd data.

2014-09-21 Thread Akira Li
Akira Li added the comment: > What do you think? I would prefer to deprecate PIPE argument for subprocess.call(): issue DeprecationWarning in 3.5 and raise ValueError in 3.6+ I've uploaded a patch that issues the warning. -- keywords: +patch type: -> enhancement versions:

[issue21332] subprocess bufsize=1 docs are misleading

2014-09-21 Thread Akira Li
Changes by Akira Li <4kir4...@gmail.com>: Added file: http://bugs.python.org/file36679/subprocess-line-buffering-issue21332-ps5.patch ___ Python tracker <http://bugs.python.org/i

[issue22442] subprocess.check_call hangs on large PIPEd data.

2014-09-21 Thread Akira Li
Akira Li added the comment: @juj: DeprecationWarning is generated if PIPE is passed to call() as any positional or keyword argument in particular stdin, stdout, stderr. It also applies to check_call() that uses call() internally. -- ___ Python

[issue22442] subprocess.check_call hangs on large PIPEd data.

2014-09-21 Thread Akira Li
Akira Li added the comment: Victor, the message in my patch is copied almost verbatim from the current subprocess' documentation [1] [1] https://hg.python.org/cpython/file/850a62354402/Doc/library/subprocess.rst#l57 People use `call(cmd, stdout=PIPE)` as a *broken* way to suppress o

[issue22477] GCD in Fractions

2014-09-24 Thread Akira Li
Akira Li added the comment: Whether or not gcd(a, b) == gcd(|a|, |b|) depends on the definition if we believe to Stepanov of C++ STL fame who mentions in his lecture [1] [1] http://www.stepanovpapers.com/gcd.pdf that the current implementation that uses two operation __bool__ and __mod__

[issue22477] GCD in Fractions

2014-09-25 Thread Akira Li
Changes by Akira Li <4kir4...@gmail.com>: -- nosy: -akira ___ Python tracker <http://bugs.python.org/issue22477> ___ ___ Python-bugs-list mailing list

[issue22472] OSErrors should use str and not repr on paths

2014-09-29 Thread Akira Li
Akira Li added the comment: OSError has *filename* attribute. Could it be passed to the UI instead? -- nosy: +akira ___ Python tracker <http://bugs.python.org/issue22

[issue22472] OSErrors should use str and not repr on paths

2014-09-30 Thread Akira Li
Akira Li added the comment: I meant, in general, repr() is better for an error message because it should be unambigous unlike str() but in your particular case you could use filename attribute to format the way you like it for your UI. -- ___ Python

[issue22524] PEP 471 implementation: os.scandir() directory scanning function

2014-10-06 Thread Akira Li
Changes by Akira Li <4kir4...@gmail.com>: -- nosy: +akira ___ Python tracker <http://bugs.python.org/issue22524> ___ ___ Python-bugs-list mailing list

[issue1065986] Fix pydoc crashing on unicode strings

2014-01-04 Thread Akira Kitada
Akira Kitada added the comment: Made a few more adjustments to fix things r.david.murray pointed out. -- Added file: http://bugs.python.org/file33316/issue1065986-6.patch ___ Python tracker <http://bugs.python.org/issue1065

[issue6625] UnicodeEncodeError on pydoc's CLI

2014-01-12 Thread Akira Kitada
Akira Kitada added the comment: I suppose this is a duplicate of #1065986. -- nosy: +akitada ___ Python tracker <http://bugs.python.org/issue6625> ___ ___ Pytho

[issue1185124] pydoc doesn't find all module doc strings

2014-01-13 Thread Akira Kitada
Akira Kitada added the comment: I tried pydoc_2.7.patch with the following test file and found source_synopsis returns \x escaped string instead of \u escaped one. # -*- coding: utf-8 -*- u"""ツ""" class Spam(object): u"""ツ"""

[issue6863] Wrong linker command if CXX set to "ccache g++"

2009-09-12 Thread Akira Kitada
Akira Kitada added the comment: Aren't CC and CXX variables just for compilers? """ CC Program for compiling C programs; default `cc'. CXX Program for compiling C++ programs; default `g++'. """ http://www.gnu.org/software/make/manual/make.

[issue1294959] Problems with /usr/lib64 builds.

2009-09-12 Thread Akira Kitada
Akira Kitada added the comment: I think this is duplicate of issue858809. -- ___ Python tracker <http://bugs.python.org/issue1294959> ___ ___ Python-bugs-list m

[issue1019715] distutils ignores configure's --includedir

2009-09-12 Thread Akira Kitada
Akira Kitada added the comment: I think this is duplicate of issue858809. -- ___ Python tracker <http://bugs.python.org/issue1019715> ___ ___ Python-bugs-list m

[issue804543] invalid use of setlocale

2009-02-27 Thread Akira Kitada
Akira Kitada added the comment: If I'm not mistaken, this bug seems to be fre-introduced in "release30-maint/Modules/python.c". It could be fixed in just as it was before. -- components: +Interpreter Core -None nosy: +akitada type: -> behavior versions: +Python 2.6,

[issue5394] Distutils in trunk does not work with old Python (2.3 - 2.5)

2009-02-28 Thread Akira Kitada
New submission from Akira Kitada : As written in its README, "Distutils must remain compatible with 2.3", but it isn't. Attached patch fixes this. -- assignee: tarek components: Distutils files: python23_compat.diff keywords: patch messages: 82920 nosy: akitada, tarek s

[issue1294959] Problems with /usr/lib64 builds.

2009-02-28 Thread Akira Kitada
Akira Kitada added the comment: 3rd party C modules are put in site-packages, so just having importer of 64-bit python look at lib64-dynload is not enough for solving this. To work around this problem, I did some hacks on my local Python to look at lib and lib64. It worked, but just as

[issue2698] Extension module build fails for MinGW: missing vcvarsall.bat

2009-02-28 Thread Akira Kitada
Changes by Akira Kitada : -- assignee: -> tarek components: +Windows nosy: +tarek type: -> compile error ___ Python tracker <http://bugs.python.org/

[issue2941] Propagate define to resurce mingw32 compile

2009-02-28 Thread Akira Kitada
Changes by Akira Kitada : -- assignee: -> tarek components: +Windows nosy: +tarek type: -> compile error ___ Python tracker <http://bugs.python.org/

[issue2200] find_executable fails to find .bat files on win32

2009-02-28 Thread Akira Kitada
Changes by Akira Kitada : -- assignee: -> tarek components: +Windows nosy: +tarek ___ Python tracker <http://bugs.python.org/issue2200> ___ ___ Python-bugs-lis

[issue4010] configure options don't trickle down to distutils

2009-02-28 Thread Akira Kitada
Changes by Akira Kitada : Removed file: http://bugs.python.org/file12954/issue4010.diff ___ Python tracker <http://bugs.python.org/issue4010> ___ ___ Python-bugs-list m

[issue4010] configure options don't trickle down to distutils

2009-02-28 Thread Akira Kitada
Akira Kitada added the comment: Updated issue4010 to honor os.environ['CPPFLAGS']. Added file: http://bugs.python.org/file13212/issue4010.diff ___ Python tracker <http://bugs.python.

[issue4459] bdist_rpm assumes python

2009-02-28 Thread Akira Kitada
Akira Kitada added the comment: There are two options for that in bdist_rpm. --python path to Python interpreter to hard-code in the .spec file (default: "python") --fix-python hard-code the exact path to the curr

[issue4214] no extension debug info with msvc9compiler.py

2009-02-28 Thread Akira Kitada
Changes by Akira Kitada : -- assignee: -> tarek components: +Windows nosy: +tarek ___ Python tracker <http://bugs.python.org/issue4214> ___ ___ Python-bugs-lis

[issue4843] make distutils use shutil

2009-02-28 Thread Akira Kitada
Akira Kitada added the comment: 'ignore' was introduced in Python 2.6 but distutils has to keep Python 2.3 compatible. See: http://bugs.python.org/issue5052 So I guess you have to wait some more years before dropping distutils.dir_util and distutils.file_util. -- nosy

[issue1355826] shutil.move() does not preserve ownership

2009-02-28 Thread Akira Kitada
Changes by Akira Kitada : -- type: -> feature request versions: +Python 2.6, Python 2.7, Python 3.0, Python 3.1 -Python 2.4 ___ Python tracker <http://bugs.python.org/issue1

[issue4480] bdist_msi and bdist_wininst are missing an uninstaller icon

2009-03-01 Thread Akira Kitada
Changes by Akira Kitada : -- assignee: -> tarek components: +Windows nosy: +tarek ___ Python tracker <http://bugs.python.org/issue4480> ___ ___ Python-bugs-lis

[issue4918] Windows installer created with Python 2.5 does not work with Python 2.6.1

2009-03-01 Thread Akira Kitada
Changes by Akira Kitada : -- assignee: -> tarek components: +Windows nosy: +tarek type: -> crash ___ Python tracker <http://bugs.python.org/issue4918> ___ __

[issue5235] distutils seems to only work with VC++ 2008 (9.0)

2009-03-01 Thread Akira Kitada
Changes by Akira Kitada : -- components: +Windows ___ Python tracker <http://bugs.python.org/issue5235> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue4459] bdist_rpm should enable --fix-python by default

2009-03-03 Thread Akira Kitada
Changes by Akira Kitada : -- title: bdist_rpm assumes python -> bdist_rpm should enable --fix-python by default ___ Python tracker <http://bugs.python.org/iss

[issue3985] removed string module from distutils [patch]

2009-03-07 Thread Akira Kitada
Akira Kitada added the comment: The patch looks ok to me. Python 2.3 - 2.6 seem working fine with this patch, too. -- nosy: +akitada ___ Python tracker <http://bugs.python.org/issue3

[issue3992] removed custom log from distutils

2009-03-07 Thread Akira Kitada
Akira Kitada added the comment: I updated the patch. Mine only changes log.py. -- nosy: +akitada Added file: http://bugs.python.org/file13260/remove-custom-log-revised.diff ___ Python tracker <http://bugs.python.org/issue3

[issue5736] Add the iterator protocol to dbm modules

2009-04-11 Thread Akira Kitada
New submission from Akira Kitada : In Python 2.6, dbm modules othar than bsddb don't support the iterator protocol. >>> import dbm >>> d = dbm.open('spam.dbm', 'c') >>> for k in range(5): d["key%d" % k] = "value%d" % k

[issue5736] Add the iterator protocol to dbm modules

2009-04-11 Thread Akira Kitada
Akira Kitada added the comment: Attached is a patch that adds the iterator protocol. Now it can be interated through like: >>> for k in d: print k, d[k] ... key1 vale1 key3 vale3 key0 vale0 key2 vale2 key4 vale4 The problem is there is no way to get the internal pointer back to the

[issue5736] Add the iterator protocol to dbm modules

2009-04-11 Thread Akira Kitada
Akira Kitada added the comment: Revised patch adds firstkey and nextkey to dbm. Now the internal pointer can be reset with firstkey. -- Added file: http://bugs.python.org/file13674/issue5736.diff ___ Python tracker <http://bugs.python.org/issue5

[issue5736] Add the iterator protocol to dbm modules

2009-04-12 Thread Akira Kitada
Akira Kitada added the comment: Here's another patch which addsd iter to dbm and gdbm. Note that dbm and gdbm C API is a little different. gdbm_nextkey requires key for its argument, dbm_nextkey don't. So I had to use for gdbm an static variable that points to the current pos

[issue5736] Add the iterator protocol to dbm modules

2009-04-12 Thread Akira Kitada
Akira Kitada added the comment: Of course iter should work in the same way in all dbm modules. iter in dbm/gdbm should work like dumbdbm's iter. >>> dumb = dumbdbm.open('foo', 'n') >>> dumb['k1'] = 'v1';dumb['k2'] = '

[issue5736] Add the iterator protocol to dbm modules

2009-04-13 Thread Akira Kitada
Akira Kitada added the comment: Yes, using a static variable there is wrong and actually I'm now working on "dbm_iterobject" just as Martin suggested. dbm iterator should behave just like one in dict. I think I can use Objects/dictobject.c as a good example for this. Attached i

[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2009-06-23 Thread Akira Kitada
Akira Kitada added the comment: Thanks for this great work! Does Regexp 2.7 include Unicode Scripts support? http://www.regular-expressions.info/unicode.html Perl and Ruby support it and it's pretty handy. -- nosy: +akitada ___ Python tr

[issue6331] Add unicode script info to the unicode database

2009-06-23 Thread Akira Kitada
Changes by Akira Kitada : -- nosy: +akitada ___ Python tracker <http://bugs.python.org/issue6331> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue5753] CVE-2008-5983 python: untrusted python modules search path

2009-06-24 Thread Tanaka Akira
Tanaka Akira added the comment: src/if_python.c in vim-7.2 has a comment: /* Set sys.argv[] to avoid a crash in warn(). */ I think the crash is follows. % python Python 2.5.2 (r252:60911, Jan 4 2009, 17:40:26) [GCC 4.3.2] on linux2 Type "help", "copyright", "credi

[issue28876] bool of large range raises OverflowError

2016-12-05 Thread Akira Li
Akira Li added the comment: Here's a patch with range_bool() implementation, tests and the docs update. I'm not sure how it should be documented. I've specified it as versionchanged:: 3.6 -- keywords: +patch nosy: +akira Added file: http://bugs.python.org/file45765/r

[issue28876] bool of large range raises OverflowError

2016-12-05 Thread Akira Li
Akira Li added the comment: I've removed the documentation changes from the patch. -- Added file: http://bugs.python.org/file45773/range_bool-no_docs.patch ___ Python tracker <http://bugs.python.org/is

[issue28180] sys.getfilesystemencoding() should default to utf-8

2016-12-21 Thread Akira Li
Changes by Akira Li <4kir4...@gmail.com>: -- nosy: +akira ___ Python tracker <http://bugs.python.org/issue28180> ___ ___ Python-bugs-list mailing list

[issue28876] bool of large range raises OverflowError

2017-01-22 Thread Akira Li
Akira Li added the comment: Following the python-dev discussion [1] I've added a variant of the patch that uses c99 designated initializers [2] [1] https://mail.python.org/pipermail/python-dev/2017-January/147175.html [2] https://gcc.gnu.org/onlinedocs/gcc/Designated-Inits

[issue28876] bool of large range raises OverflowError

2017-01-23 Thread Akira Li
Akira Li added the comment: I've updated the patch to use 4-space indent (pep-7). I've added space around "=" (pep-7); unlike the usual "dict(designator=value)" -- no space around "=" for keyword argument (pep-8). -- Added file: http://

[issue29352] provide the authorative source for s[i:j] negative slice indices (<-len(s)) behavior for standard sequences

2017-01-23 Thread Akira Li
New submission from Akira Li: I've failed to find where the behavior for negative indices in s[i:j] expression (i, j < -len(s)) for standard sequences (str, list, etc) is formally defined. The observed behavior implemented in PySlice_GetIndicesEx(): If "len(s) + i" or "

[issue27050] Demote run() below the high level APIs in subprocess docs

2016-06-08 Thread Akira Li
Akira Li added the comment: > setting "universal_newlines=True" switches to UTF-8 encoded text pipes It uses locale.getpreferredencoding(False) encoding -- something like cp1252,cp1251,etc on Windows, and UTF-8 on *nix with proper locale settings. It is ASCII (C/POSIX locale de

[issue27273] subprocess.run(cmd, input='text') should pass universal_newlines=True to Popen

2016-06-08 Thread Akira Li
New submission from Akira Li: At the moment, subprocess.run(cmd, input='text') raises TypeError. It would be nice if universal_newlines=isinstance(input, str) if *input* is set. I've attached a corresponding patch with the necessary changes to the docs, tests and the subpro

[issue27079] Bugs in curses.ascii predicates

2016-06-30 Thread Akira Li
Akira Li added the comment: There is an overlapping issue from 2010: "curses.ascii.isblank() function is broken. It confuses backspace (BS 0x08) with tab (0x09)" http://bugs.python.org/issue9770 Your patch fixes it too (it should be closed). Note: the patch does not pass tests fro

[issue27079] Bugs in curses.ascii predicates

2016-07-01 Thread Akira Li
Akira Li added the comment: I'm not sure anything should be done (e.g., it is "undefined behavior" to pass a negative value such as CHAR_MIN (if *char* type is signed) to a character classification function in C. Though EOF value (-1 traditionally) should be handled). If you

[issue22627] Calling timestamp() on a datetime object modifies the timestamp of a different datetime object.

2014-10-14 Thread Akira Li
Akira Li added the comment: Christopher, About your script http://paste.ubuntu.com/8562027/ dateutil may break if the local timezone had different UTC offset in the past. You could use tzlocal module to get pytz timezone that can handle such timezones. To get the correct time for

[issue11820] idle3 shell os.system swallows shell command output

2014-10-19 Thread Akira Li
Akira Li added the comment: It looks like the issue can be reduced to whether or not to show this output: >>> import os >>> os.write(1, b'should we see this in idle?\n') should we see this in idle? 28 assuming sys.__stdout__.fileno() == fileno(stdout) == 1

[issue22709] restore accepting detached stdin in fileinput binary mode

2014-10-23 Thread Akira Li
New submission from Akira Li: The patch for Issue #21075: "fileinput.FileInput now reads bytes from standard stream if binary mode is specified" broke code that used sys.stdin = sys.stdin.detach() with FileInput(mode='rb') in Python 3.3 I've attached the patch that

[issue22709] restore accepting detached stdin in fileinput binary mode

2014-10-23 Thread Akira Li
Akira Li added the comment: It is incorrect that sys.stdin is *always* a text stream. It often is, but not always. There are cases when it is not e.g., $ tar zcf - stuff | gpg -e | ssh user@server 'cat - > stuff.tar.gz.gpg' tar's stdout is *not* a text stream. gpg'

[issue22709] restore accepting detached stdin in fileinput binary mode

2014-10-23 Thread Akira Li
Akira Li added the comment: > This is not related to Python. Terms "character", "string", "text", "file" > can have different meaning in different domains. In Python we use Python > terminology. There is no such thing as sys.stdin in Posix-co

[issue22715] PEP 257: drop the recommendation for a blank line between the class line and the docstring

2014-10-24 Thread Akira Kitada
New submission from Akira Kitada: The PEP 257 says: Insert a blank line before and after all docstrings (one-line or multi-line) that document a class Looking at stdlib and popular open source software, I couldn't find packages that follow this style, so I think this is not rea

[issue22715] PEP 257: drop the recommendation for a blank line between the class line and the docstring

2014-10-24 Thread Akira Kitada
Akira Kitada added the comment: Guido is with me :) On Wed, Oct 22, 2014 at 2:16 AM, Guido van Rossum wrote: > I think the argument is about the blank line between the "class" line and > the docstring. I agree with Akira that very few packages follow this style, > and I thi

[issue22715] PEP 257: drop the recommendation for a blank line between the class line and the docstring

2014-10-24 Thread Akira Kitada
Akira Kitada added the comment: Good point. I looked at some Python files but, as you pointed out, I couldn't find ones what follow the recommendation. In some files there is a blank line after a docstring but it seemed it's not because it "is written as a number of sections"

[issue22749] remove obsolete remark in time.clock() docs

2014-10-28 Thread Akira Li
New submission from Akira Li: time.clock() documentation [1] says: this is the function to use for benchmarking Python or timing algorithms. and Deprecated since version 3.3: The behaviour of this function depends on the platform: use perf_counter() or process_time() instead, depending

[issue22798] time.mktime doesn't update time.tzname

2014-11-05 Thread Akira Li
New submission from Akira Li: time.tzname is initialized from C tzname variable or tm_zone around Jan, Jul of the current year. If time.mktime() is called with a time tuple from the past/future then after the call time.tzname might be out-of-sync with the corresponding C tzname and tm_zone

[issue22798] time.mktime doesn't update time.tzname

2014-11-05 Thread Akira Li
Akira Li added the comment: I've attached test-timezone-info-is-updated.diff file -- a patch for Lib/test/test_time.py that demonstrates that time functions fail to update the timezone info. The test uses Europe/Moscow timezone but most timezones around the world had/will have diff

[issue22798] time.mktime doesn't update time.tzname

2014-11-05 Thread Akira Li
Changes by Akira Li <4kir4...@gmail.com>: Added file: http://bugs.python.org/file37134/test_mktime_changes_tzname.c ___ Python tracker <http://bugs.python.org/i

[issue22799] wrong time.timezone

2014-11-05 Thread Akira Li
New submission from Akira Li: $ TZ=:Europe/Moscow ./python -mtest -v test_time == FAIL: test_localtime_timezone (test.test_time.TestPytime) -- Traceback

[issue16353] add function to os module for getting path to default shell

2014-11-05 Thread Akira Li
Akira Li added the comment: > Matt Frank added the comment: > > Unfortunately os.defpath seems to be hardcoded. And hardcoded to the > wrong value on every system I have looked at, including Linux. os.defpath is supposed to be ':'+CS_PATH, e.g., look at glibc (C library

[issue16353] add function to os module for getting path to default shell

2014-11-06 Thread Akira Li
Akira Li added the comment: > Matt Frank added the comment: > > In msg230720 Akira Li (akira) wrote: >> os.defpath is supposed to be ':'+CS_PATH, e.g., look at glibc (C library >> used on Linux) sysdeps/posix/spawni.c I don't know whether it is >> poss

[issue16353] add function to os module for getting path to default shell

2014-11-06 Thread Akira Li
Changes by Akira Li <4kir4...@gmail.com>: Added file: http://bugs.python.org/file37140/os.get_shell_executable-3.patch ___ Python tracker <http://bugs.python.org/i

[issue22791] datetime.utcfromtimestamp() shoud have option for create tz aware datetime

2014-11-08 Thread Akira Li
Akira Li added the comment: >>> from datetime import datetime, timezone >>> datetime.fromtimestamp(0, timezone.utc) datetime.datetime(1970, 1, 1, 0, 0, tzinfo=datetime.timezone.utc) already works and it is documented [1] [1] https://docs.python.org/3/lib

[issue22791] datetime.utcfromtimestamp() shoud have option for create tz aware datetime

2014-11-09 Thread Akira Li
Akira Li added the comment: I agree the documentation should nudge towards aware datetime objects. I've attached a documentation patch as an example. -- keywords: +patch Added file: http://bugs.python.org/file37162/issue22791-utcfromtimestamp-aware

[issue22536] subprocess should include filename in FileNotFoundError exception

2014-11-17 Thread Akira Li
Akira Li added the comment: I can confirm that without the patch the filename attribute is None despite being mentioned in strerror. Travis, you should use `orig_executable` instead of `args[0]` to cover: subprocess.call("exit 0", shell=True, executable='/nonexistent bash

[issue22536] subprocess should include filename in FileNotFoundError exception

2014-11-17 Thread Akira Li
Akira Li added the comment: If the_oserror.filename is not None then str(the_oserror) appends the filename twice: [Errno 2] No such file or directory: 'nonexistent': 'nonexistent' You could remove `err_msg += ':' ...` statements to avoid the repeatition. I

[issue22536] subprocess should include filename in FileNotFoundError exception

2014-11-19 Thread Akira Li
Akira Li added the comment: It would be inconsitent to provide filename only if exec is called e.g.: >>> import subprocess subprocess.call("not used", cwd="nonexistent") FileNotFoundError: [Errno 2] No such file or directory: 'nonexistent' Th

[issue21872] LZMA library sometimes fails to decompress a file

2014-11-20 Thread Akira Li
Akira Li added the comment: @Esa changing the buffer size helps with some "bad" files but lzma module still fails on some files. I've uploaded decompress-example-files.py script that demonstrates it. ------ nosy: +akira Added file: http://bugs.python.org/file37239/dec

[issue21872] LZMA library sometimes fails to decompress a file

2014-11-20 Thread Akira Li
Changes by Akira Li <4kir4...@gmail.com>: Added file: http://bugs.python.org/file37240/decompress-example-files.py ___ Python tracker <http://bugs.python.org/i

[issue21872] LZMA library sometimes fails to decompress a file

2014-11-20 Thread Akira Li
Changes by Akira Li <4kir4...@gmail.com>: Removed file: http://bugs.python.org/file37239/decompress-example-files.py ___ Python tracker <http://bugs.python.org/i

[issue21872] LZMA library sometimes fails to decompress a file

2014-11-21 Thread Akira Li
Akira Li added the comment: If lzma._BUFFER_SIZE is less than 2048 then all example files are decompressed successfully (at least lzma module produces the same results as xz utility) -- Added file: http://bugs.python.org/file37241/decompress-example-files.py

[issue21872] LZMA library sometimes fails to decompress a file

2014-11-21 Thread Akira Li
Changes by Akira Li <4kir4...@gmail.com>: Removed file: http://bugs.python.org/file37240/decompress-example-files.py ___ Python tracker <http://bugs.python.org/i

[issue22752] incorrect time.timezone value

2014-11-24 Thread Akira Li
Akira Li added the comment: C standard delegates to implementations: The local time zone and Daylight Saving Time are implementation-defined. gcc (one of the implementations) says [1]: [timezone] contains the difference between UTC and the latest local standard time, in seconds west of

[issue22798] time.mktime doesn't update time.tzname

2014-11-25 Thread Akira Li
Akira Li added the comment: One of the ways to fix this issue is to synchronize time.tzname attribute with the corresponding C tzname variable. I've uploaded sync-time-timezone-attr-with-c.diff patch that synchronizes tzname, timezone, altzone, daylight attributes. The patch also inc

[issue22798] time.mktime doesn't update time.tzname

2014-11-25 Thread Akira Li
Changes by Akira Li <4kir4...@gmail.com>: Removed file: http://bugs.python.org/file37132/test_mktime_changes_tzname.c ___ Python tracker <http://bugs.python.org/i

<    1   2   3   4   5   >