[issue29458] random.seed version=1 behavior

2017-02-05 Thread Raymond Hettinger
Raymond Hettinger added the comment: Sorry Marciej, this isn't a bug. The seeders are consistent. It is the code for randint() that has changed (to fix a minor imbalance in the distribution). $ python2.7 -c "from random import *; seed(1); print(repr(random()))" 0.13436424411240122 $

[issue29457] strftime('%x') does not use my locale

2017-02-05 Thread Hugo Osvaldo Barrera
Hugo Osvaldo Barrera added the comment: The problem is that the datetime/strftime documentation describes "%c" as: Locale’s appropriate date and time representation. However, this is not really accurate (this is not the *default* behaviour), that's why I was mentioning the clarification.

[issue29458] random.seed version=1 behavior

2017-02-05 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger ___ Python tracker ___

[issue29453] Remove reference to undefined dictionary ordering in Tutorial

2017-02-05 Thread Raymond Hettinger
Raymond Hettinger added the comment: Patch 2 looks fine to me. -- nosy: +rhettinger ___ Python tracker ___

[issue26355] Emit major version based canonical URLs for docs

2017-02-05 Thread Berker Peksag
Changes by Berker Peksag : -- nosy: +berker.peksag stage: needs patch -> patch review ___ Python tracker ___

[issue29452] Use FASTCALL for collections.deque methods: index, insert, rotate

2017-02-05 Thread Raymond Hettinger
Raymond Hettinger added the comment: Over this looks good. Just one other minor tweak (one that has served me well elsewhere) would be to bypass the cross-module function call with a cheap (near zero cost) register variable test: if (kwnames != NULL && !_PyArg_NoStackKeywords("rotate",

[issue29458] random.seed version=1 behavior

2017-02-05 Thread Xiang Zhang
Changes by Xiang Zhang : -- nosy: +haypo, mark.dickinson, rhettinger ___ Python tracker ___

[issue29457] strftime('%x') does not use my locale

2017-02-05 Thread Xiang Zhang
Xiang Zhang added the comment: I doubt the info belongs to datetime module documentation. When you encounter locale related problems maybe it's better for you to refer locale module documentation, and it mentions this behaviour

[issue29458] random.seed version=1 behavior

2017-02-05 Thread Maciej Obarski
New submission from Maciej Obarski: random.seed version=1 wont generate the same randint sequences in python2 and python3 Python 2.7: >>> seed(1); randint(0,100) 13 Python 3.6: >>> seed(1,version=1); randint(0,100) 17 The documentation states that versio=1 is "provided for reproducing random

[issue29457] strftime('%x') does not use my locale

2017-02-05 Thread Hugo Osvaldo Barrera
Hugo Osvaldo Barrera added the comment: It would seem that locale.setlocale(locale.LC_TIME, "") fixes the issue. However, there seems to be no mention on this on the relevant documentation page[1], which is actually the source of my confusion. As a "fix" to this issue (since I'm probably

[issue29028] Use-After-Free in PyString_FromStringAndSize() of stringobject.c

2017-02-05 Thread Ammar Askar
Ammar Askar added the comment: Did you forget to close this or is this not fixed, Serhiy? -- ___ Python tracker ___

[issue29457] strftime('%x') does not use my locale

2017-02-05 Thread Eryk Sun
Eryk Sun added the comment: As Martin said, you need to set the LC_TIME category using an empty string to use the locale LC_* environment variables. Python 3 sets LC_CTYPE at startup (on Unix platforms only), but LC_TIME is left in the initial C locale: >>>

[issue29457] strftime('%x') does not use my locale

2017-02-05 Thread Martin Panter
Martin Panter added the comment: >>> datetime.now().strftime("%x") '02/06/17' >>> from locale import setlocale, LC_TIME >>> setlocale(LC_TIME) 'C' >>> setlocale(LC_TIME, "en_US.utf8") 'en_US.utf8' >>> datetime.now().strftime("%x") '02/06/2017' -- ___

[issue29457] strftime('%x') does not use my locale

2017-02-05 Thread Martin Panter
Martin Panter added the comment: Have you tried enabling the locale with locale.setlocale()? I believe Python only enables LC_CTYPE by default, so other locale aspects like LC_TIME won’t work until they are enabled. -- nosy: +martin.panter ___

[issue29452] Use FASTCALL for collections.deque methods: index, insert, rotate

2017-02-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The patch is simple and technically it looks correct, but I'm not a fan of using FASTCALL outside of Argument Clinic at this stage. The API still can be changed. Fortunately only three deque methods could have a benefit from using FASTCALL. --

[issue29457] strftime('%x') does not use my locale

2017-02-05 Thread Hugo Osvaldo Barrera
New submission from Hugo Osvaldo Barrera: As the the posix spec for strftime: %c The preferred date and time representation for the current locale. %x The preferred date representation for the current locale without the time. However, python doesn't seem to respect this: $ python3.5 -c

[issue24905] Allow incremental I/O to blobs in sqlite3

2017-02-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: apsw has different order of arguments for blobopen(), all arguments are mandatory, and the parameter for read/write mode is called "writeable" rather than "readonly". This part of API needs to be discussed. Ask for discussion on mailing lists: Python-Ideas

[issue968063] Add fileinput.islastline()

2017-02-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The patch is outdated. It uses private _buffer attribute which no longer exist (see issue15068). But even when _buffer was existing the patch was not correct, because _buffer contained only a part of the file. It is possible to implement islastline(), but

[issue29456] bug in unicodedata.normalize: u1176

2017-02-05 Thread Wonsup Yoon
Wonsup Yoon added the comment: I think you are right. The modern final consonants is [11a8..11c2]. I attached another patch for this issue. -- Added file: http://bugs.python.org/file46536/u11a7u11c3.patch ___ Python tracker

[issue29456] bug in unicodedata.normalize: u1176

2017-02-05 Thread Xiang Zhang
Xiang Zhang added the comment: How about the third character's range? The code seems assuming it's [11a7..11c3] while the spec is [11a8..11c2]? >>> unicodedata.normalize("NFC", "\u1100\u1175\u11a7") '기' while it should be '기ᆧ'? -- nosy: +xiang.zhang

[issue29456] bug in unicodedata.normalize: u1176

2017-02-05 Thread Wonsup Yoon
New submission from Wonsup Yoon: unicodedata can't normalize(NFC) hangul strings which contain \u1176(HANGUL JUNGSEONG A-O). >>> from unicodedata import normalize >>> normalize("NFC", "\u1100\u1176\u11a8") '깍' => should be "\u1100\u1176\u11a8" not '깍' (\uae4d) I attached a patch for this

[issue29371] Typo in doctest documentation

2017-02-05 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- stage: -> patch review ___ Python tracker ___ ___

[issue29371] Typo in doctest documentation

2017-02-05 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: Hi everyone, I made a patch to clarify that "or'ed" here really means "bitwise-OR'ed", and made a reference to the section of the docs about bitwise OR. Please review and let me know if this will work. Thanks. -- keywords: +patch Added file:

[issue29455] Mention coverage.py in trace module documentation

2017-02-05 Thread Brett Cannon
New submission from Brett Cannon: In the trace module it would be nice to also mention that coverage.py is available. -- assignee: docs@python components: Documentation messages: 287075 nosy: brett.cannon, docs@python priority: normal severity: normal status: open title: Mention

[issue29405] improve csv.Sniffer().sniff() behavior

2017-02-05 Thread Xiang Zhang
Xiang Zhang added the comment: I am fine with any version (both are simple and not the hardest part to understand in the logic). :-) I have no opinion on which is better. -- ___ Python tracker

[issue29405] improve csv.Sniffer().sniff() behavior

2017-02-05 Thread Berker Peksag
Berker Peksag added the comment: > [...] but I want to make the change small so others won't get unfamiliar with > the new code. :-) Assuming it doesn't cause any behavior changes, I find Milt's patch simple enough and easier to understand than the version uses 'iteration' variable.

[issue29405] improve csv.Sniffer().sniff() behavior

2017-02-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset 6d0a09623155710680ff19f05f279d45c007a304 by Xiang Zhang in branch 'master': Issue #29405: Make total calculation in _guess_delimiter more accurate. https://github.com/python/cpython/commit/6d0a09623155710680ff19f05f279d45c007a304 --

[issue29405] improve csv.Sniffer().sniff() behavior

2017-02-05 Thread Xiang Zhang
Xiang Zhang added the comment: Thanks Milt. I committed with my change not because it's better, but I want to make the change small so others won't get unfamiliar with the new code. :-) -- resolution: -> fixed stage: commit review -> resolved status: open -> closed

[issue29405] improve csv.Sniffer().sniff() behavior

2017-02-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset 724d1aa7589b by Xiang Zhang in branch 'default': Issue #29405: Make total calculation in _guess_delimiter more accurate. https://hg.python.org/cpython/rev/724d1aa7589b -- nosy: +python-dev ___ Python

[issue968063] Add fileinput.islastline()

2017-02-05 Thread Berker Peksag
Berker Peksag added the comment: Thanks for the updated patch, but I'm not sure FileInput class needs a islastline() method. I couldn't find any similar or duplicate feature requests on the tracker after this opened in 2004 (which is a sign that the need for this method is low.) Also, the

[issue29454] Shutting down consumer on a remote queue

2017-02-05 Thread Xiang Zhang
Changes by Xiang Zhang : -- nosy: +davin type: -> behavior ___ Python tracker ___ ___

[issue29453] Remove reference to undefined dictionary ordering in Tutorial

2017-02-05 Thread Xiang Zhang
Changes by Xiang Zhang : -- assignee: docs@python -> serhiy.storchaka ___ Python tracker ___

[issue24905] Allow incremental I/O to blobs in sqlite3

2017-02-05 Thread Berker Peksag
Changes by Berker Peksag : -- nosy: +berker.peksag ___ Python tracker ___ ___

[issue29452] Use FASTCALL for collections.deque methods: index, insert, rotate

2017-02-05 Thread STINNER Victor
STINNER Victor added the comment: deque-2.patch calls _PyArg_NoStackKeywords() before _PyArg_ParseStack(). -- Added file: http://bugs.python.org/file46533/deque-2.patch ___ Python tracker

[issue29431] Add a PYTHONREVERSEDICTKEYORDER environment variable

2017-02-05 Thread STINNER Victor
STINNER Victor added the comment: While the use case makes sense, test if an application relies on the dictionary iterating order, I'm not sure that adding an option to change the order. For me, it's a rare and very specific use case, whereas your option is public and "too easy" to find and

[issue29431] Add a PYTHONREVERSEDICTKEYORDER environment variable

2017-02-05 Thread lamby
lamby added the comment: > order of other dicts are implementation detail. Right, exactly :) -- ___ Python tracker ___

[issue24905] Allow incremental I/O to blobs in sqlite3

2017-02-05 Thread Aviv Palivoda
Aviv Palivoda added the comment: Thanks for the CR Serhiy. Attached is a new patch after the fixes from the CR. What other developers should I ask? The interface is file like and is the same as apsw. -- Added file: http://bugs.python.org/file46531/blob3.patch

[issue29442] Use argparse and drop dirty optparse hacks in setup.py

2017-02-05 Thread Brett Cannon
Changes by Brett Cannon : -- nosy: -brett.cannon ___ Python tracker ___ ___

[issue20185] Derby #17: Convert 49 sites to Argument Clinic across 13 files

2017-02-05 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : Added file: http://bugs.python.org/file46529/clinic_marshal_v5.diff ___ Python tracker ___

[issue20185] Derby #17: Convert 49 sites to Argument Clinic across 13 files

2017-02-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a set of patches based on issue20185_conglomerate_v4.diff. They are synchronized with current sources. Addressed Martin's comments,converted list.index(), float.__round__() and resource.prlimit() and made other minor changes. -- Added file:

[issue20185] Derby #17: Convert 49 sites to Argument Clinic across 13 files

2017-02-05 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : Added file: http://bugs.python.org/file46530/clinic_resource_v5.diff ___ Python tracker ___

[issue20185] Derby #17: Convert 49 sites to Argument Clinic across 13 files

2017-02-05 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : Added file: http://bugs.python.org/file46527/clinic_list_v5.diff ___ Python tracker ___

[issue20185] Derby #17: Convert 49 sites to Argument Clinic across 13 files

2017-02-05 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : Added file: http://bugs.python.org/file46528/clinic_type_v5.diff ___ Python tracker ___

[issue20186] Derby #18: Convert 31 sites to Argument Clinic across 23 files

2017-02-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5762cf299f863e06244e6b44ba3a91efee7b35c1 by Serhiy Storchaka in branch 'master': Issue #20186: Regenerated Argument Clinic. https://github.com/python/cpython/commit/5762cf299f863e06244e6b44ba3a91efee7b35c1 --

[issue20186] Derby #18: Convert 31 sites to Argument Clinic across 23 files

2017-02-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8ccb3ad39ee4 by Serhiy Storchaka in branch 'default': Issue #20186: Regenerated Argument Clinic. https://hg.python.org/cpython/rev/8ccb3ad39ee4 -- ___ Python tracker

[issue29453] Remove reference to undefined dictionary ordering in Tutorial

2017-02-05 Thread R. David Murray
R. David Murray added the comment: You are correct, I didn't read the full context of the diff. My apologies. -- versions: +Python 3.6 ___ Python tracker

[issue29453] Remove reference to undefined dictionary ordering in Tutorial

2017-02-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM. Thanks Jim. But maybe it is worth to mention that the output corresponds to the order of passed keyword arguments. -- stage: -> commit review ___ Python tracker

[issue29453] Remove reference to undefined dictionary ordering in Tutorial

2017-02-05 Thread Jim Fasarakis-Hilliard
Jim Fasarakis-Hilliard added the comment: Indeed, good point. Changed it to the suggested way. -- Added file: http://bugs.python.org/file46525/controlflowdiff2.patch ___ Python tracker

[issue29453] Remove reference to undefined dictionary ordering in Tutorial

2017-02-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Because it shows preserving the order of keyword arguments (rather than sorting by keyword name). -- ___ Python tracker

[issue29453] Remove reference to undefined dictionary ordering in Tutorial

2017-02-05 Thread Jim Fasarakis-Hilliard
Jim Fasarakis-Hilliard added the comment: It was a random decision on my part, Serhiy, since I didn't see any difference. Why would you go the other way around? -- ___ Python tracker

[issue29453] Remove reference to undefined dictionary ordering in Tutorial

2017-02-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I would not change the order of keyword arguments, but rather change the output. -- nosy: +serhiy.storchaka ___ Python tracker

[issue29454] Shutting down consumer on a remote queue

2017-02-05 Thread Tom
New submission from Tom: Using code adapted from the example in the docs (https://docs.python.org/3/library/multiprocessing.html#using-a-remote-manager), if you create a remote queue server, a producer which puts items in the queue and a consumer which consumes elements from the queue. If the

[issue29453] Remove reference to undefined dictionary ordering in Tutorial

2017-02-05 Thread Xiang Zhang
Xiang Zhang added the comment: David, actually I have the same thoughts as Jim. Ordered ordinary dicts is not a feature but ordered **kwargs is in 3.6. They seems not the same thing. -- ___ Python tracker

[issue29453] Remove reference to undefined dictionary ordering in Tutorial

2017-02-05 Thread Jim Fasarakis-Hilliard
Jim Fasarakis-Hilliard added the comment: Isn't it a language requirement that `**kwargs` be ordered in 3.6, David? PEP 468 states that `**kwargs` is to be an ordered *mapping* and, if I'm not mistaken, that was done in order to not depend on the fact that dicts became ordered. I might have

[issue29446] Improve tkinter 'import *' situation

2017-02-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This also excludes "constants" implicitly added by importing names from tkinter.constants. I don't know whether this is good or bad. Interesting, but from tkinter import * import tkinter.ttk and import tkinter.ttk from tkinter import *

[issue29453] Remove reference to undefined dictionary ordering in Tutorial

2017-02-05 Thread R. David Murray
R. David Murray added the comment: It is not (yet) a language requirement that ordinary dictionaries be ordered. This patch may become appropriate in 3.7, but that has not yet been determined. It is not appropriate for 3.6. In 3.6, the order of keys in an ordinary dictionary is still

[issue29453] Remove reference to undefined dictionary ordering in Tutorial

2017-02-05 Thread INADA Naoki
INADA Naoki added the comment: LGTM -- nosy: +inada.naoki ___ Python tracker ___ ___ Python-bugs-list mailing

[issue29446] Improve tkinter 'import *' situation

2017-02-05 Thread Eric V. Smith
Eric V. Smith added the comment: Instead of: __all__ = [name for name in globals() if not name.startswith('_') and name not in {'enum', 're', 'sys', 'wantobjects'}] Maybe this would be less fragile: import types __all__ = [name for name, obj in globals().items() if not name.startswith('_')

[issue29453] Remove reference to undefined dictionary ordering in Tutorial

2017-02-05 Thread Xiang Zhang
Changes by Xiang Zhang : -- nosy: +xiang.zhang ___ Python tracker ___ ___ Python-bugs-list

[issue29453] Remove reference to undefined dictionary ordering in Tutorial

2017-02-05 Thread Jim Fasarakis-Hilliard
New submission from Jim Fasarakis-Hilliard: Removes `keys = sorted(keywords.keys())` from function example and removes the text that describes why this was necessary. As per PEP 468, this note is obsolete for 3.6+ Also changes the ordering of the function call to match the previous output.

[issue28164] _PyIO_get_console_type fails for various paths

2017-02-05 Thread Eryk Sun
Eryk Sun added the comment: It's an ugly inconsistency that GetFullPathName fails for bare CONIN$ and CONOUT$ prior to Windows 8, in that it gives a different result from simply passing those names to CreateFile. Anyway, thanks for modifying it to work correctly in this case. We should test

[issue29452] Use FASTCALL for collections.deque methods: index, insert, rotate

2017-02-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think _PyArg_NoStackKeywords() should be called before _PyArg_ParseStack(), otherwise this can cause not correct error messages. -- ___ Python tracker

[issue29451] Use _PyArg_Parser for _PyArg_ParseStack(): support positional only arguments

2017-02-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I don't think it would be faster. But it is possible to get rid of some code duplication at the cost of making it slower. -- ___ Python tracker

[issue29452] Use FASTCALL for collections.deque methods: index, insert, rotate

2017-02-05 Thread STINNER Victor
Changes by STINNER Victor : -- assignee: -> rhettinger ___ Python tracker ___ ___

[issue29452] Use FASTCALL for collections.deque methods: index, insert, rotate

2017-02-05 Thread STINNER Victor
New submission from STINNER Victor: Attached patch changes index(), insert() and rotate() functions of the collections.deque type to use FASTCALL calling convention. I chose to only modify these functions since they use METH_VARARGS which requires to create a temporary tuple, whereas other

[issue29451] Use _PyArg_Parser for _PyArg_ParseStack(): support positional only arguments

2017-02-05 Thread STINNER Victor
New submission from STINNER Victor: Serhiy Storshaka wrote a kind of cache for PyArg_ParseTupleAndKeywords(): _PyArg_Parser structure used by _PyArg_ParseTupleAndKeywordsFast(). It makes argument parser much faster. Would it be possible to modify it to be able to use it in

[issue29450] xattr functions aren't in os.supports_fd, os.supports_follow_symlinks

2017-02-05 Thread Omar Sandoval
New submission from Omar Sandoval: {get,list,remove,set}xattr all support fds and follow_symlinks, but they are not in the os.supports_fds and os.supports_follow_symlinks sets. The attached patch adds them. There are no HAVE_* features for the f and l variants of these syscalls since it's an

[issue29446] Improve tkinter 'import *' situation

2017-02-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM. -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue24905] Allow incremental I/O to blobs in sqlite3

2017-02-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Sorry Aviv, I just forget about this issue. Added new comments on Rietveld. Many lines in sqlite3.rst still are too long. It would be worth to ask other developers about wanted interface. -- stage: -> patch review versions: +Python 3.7 -Python 3.6