[issue28510] PyUnicodeDecodeError_GetObject always return bytes

2016-10-22 Thread Xiang Zhang
Xiang Zhang added the comment: LGTM. Actually I just read the codecs error handles codes last day but didn't think of this. :-( -- ___ Python tracker

[issue28509] Key-sharing dictionaries can inrease the memory consumption

2016-10-22 Thread Xiang Zhang
Changes by Xiang Zhang : -- nosy: +xiang.zhang ___ Python tracker ___ ___ Python-bugs-list

[issue28509] Key-sharing dictionaries can inrease the memory consumption

2016-10-22 Thread INADA Naoki
INADA Naoki added the comment: And I feel current target size of dict_merge is bit larger. When inserting new item: * ma_used = dk_size*2 / 3 when right before increasing keys * ma_used = dk_size/ 3 when right after increasing keys On the other hand, current dict_merge creates: * ma_used

[issue28509] Key-sharing dictionaries can inrease the memory consumption

2016-10-22 Thread INADA Naoki
INADA Naoki added the comment: > 0 (128, 60) > 1 (128, 60) > 2 (128, 60) > 3 (128, 60) > 4 (128, 60) > 5 (128, 60) Minimum dict keysize is 8, and it's capacity is 5. > 6 (196, 196) Dict is resized. And since __dict__.update() caused the resizing, both are normal (combined) dict. > 7 (196,

[issue28506] Multiprocessing Pool starmap - struct.error: 'i' format requires -2e10<=n<=2e10

2016-10-22 Thread Justin Ting
Justin Ting added the comment: Actually, on further inspection, I seem to be having a slightly different problem with the same error that I initially described now. Even after modifying my code so that each python forked off to another process was only given the following arguments: args =

[issue28498] tk busy command

2016-10-22 Thread klappnase
klappnase added the comment: @Miguel About tk_busy_configure(): I strongly suggest that my version of tk_busy_configure() is better, since it behaves exactly like the usual configure() methods in Tkinter (which includes e.g. Canvas.itemconfigure() or Text.tag_configure()), i.e. you can not

[issue28508] Need way to expose incremental size of key sharing dicts

2016-10-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: >>> from sys import getsizeof >>> class A: def __init__(self, a, b, c, d, e, f): self.a = a self.b = b self.c = c self.d = d self.e = e self.f = f

[issue28508] Need way to expose incremental size of key sharing dicts

2016-10-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Hmm, seems no dict here is shared-key dict. Yes. That seems to be the case. Apparently, doing an update() to the inst dict cause it to recombine. -- resolution: -> not a bug status: open -> closed ___

[issue28508] Need way to expose incremental size of key sharing dicts

2016-10-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Hmm, seems no dict here is shared-key dict. -- ___ Python tracker ___ ___

[issue28281] Remove year limits from calendar

2016-10-22 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: The patch should include an update to documentation. 1. We should probably explain that python -mcalendar does not reproduce the output of UNIX cal. For example, on Mac OS (and various Linux variants): $ cal 9 1752 September 1752 Su Mo Tu We Th Fr

[issue28508] Need way to expose incremental size of key sharing dicts

2016-10-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Isn't this already implemented? No. >>> class A: pass >>> d = dict.fromkeys('abcdefghi') >>> a = A() >>> a.__dict__.update(d) >>> b = A() >>> b.__dict__.update(d) >>> import sys >>> [sys.getsizeof(m) for m in

[issue28498] tk busy command

2016-10-22 Thread Miguel
Miguel added the comment: Misc._configure is only used when the first Tcl command is the name of the widget. Very probably my proposal for tk_busy_configure is a better candidate because it follows the conventions used in tkinter (it's similar to pack_configure and place_configure): def

[issue28281] Remove year limits from calendar

2016-10-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Alexander as core developer and the creator of this issue can merge the patch after making his review. But first we should make a decision whether it is worth to do at all. I'm +0 now. Raymond seems has objections. --

[issue28512] PyErr_SyntaxLocationEx() and PyErr_SyntaxLocationObject() always set the offset attribute to None

2016-10-22 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: The purpose of PyErr_SyntaxLocationEx() function (added in 00e4ce31d404) was setting the offset attribute of raised syntax error to specified value. But this never worked as expected. The offset attribute is set to integer value in Python/errors.c:1067,

[issue28498] tk busy command

2016-10-22 Thread Miguel
Miguel added the comment: Thanks klappnase for your collaboration. I dont understand this function: def busy_status(self): '''Returns the busy status of this window. If the window presently can not receive user interactions, True is returned, otherwise False.'''

[issue28507] Regenerate ./configure on the default branch

2016-10-22 Thread Chi Hsuan Yen
Chi Hsuan Yen added the comment: Thanks. Sorry for not reading devguide carefully. -- ___ Python tracker ___

[issue28507] Regenerate ./configure on the default branch

2016-10-22 Thread Ned Deily
Ned Deily added the comment: https://docs.python.org/devguide/faq.html#how-do-i-regenerate-configure -- ___ Python tracker ___

[issue28504] Cleanup unicode_decode_call_errorhandler_wchar/writer

2016-10-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM. Thank you Xiang. I have extended your approach to all sources and have written other two patches: issues28510 and issue28511. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed

[issue28511] Use the "U" format for parsing Unicode object arg in PyArg_Parse*

2016-10-22 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Proposed patch uses the "U" format in PyArg_Parse* functions instead of the "O!" format with _Type argument. This makes code cleaner, faster, and allows to remove additional PyUnicode_READY checks. The patch is inspired by the patch of Xiang Zhang

[issue28510] PyUnicodeDecodeError_GetObject always return bytes

2016-10-22 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Since PyUnicodeDecodeError_GetObject() always returns bytes object, following PyBytes_AsString() never fails and can be replaced with the PyBytes_AS_STRING() macro. This makes error handlers looking a littler clearer and a little faster. The patch is

[issue28504] Cleanup unicode_decode_call_errorhandler_wchar/writer

2016-10-22 Thread Roundup Robot
Roundup Robot added the comment: New changeset 204a43c452cc by Serhiy Storchaka in branch 'default': Issue #28504: Cleanup unicode_decode_call_errorhandler_wchar/writer. https://hg.python.org/cpython/rev/204a43c452cc -- nosy: +python-dev ___ Python

[issue28498] tk busy command

2016-10-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could you provide a patch against the default branch? See https://docs.python.org/devguide/ for help. The patch should include not just changes to the tkinter module, but tests for new methods (add new class in

[issue28509] Key-sharing dictionaries can inrease the memory consumption

2016-10-22 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: The size of small key-sharing dictionary (PEP 412) can be larger than the size of normal dictionary. Python 3.6: >>> def dictsizes(k): ... d = {'a%d'%i: None for i in range(k)} ... class C: ... def __init__(self): ...

[issue28505] pip installation issues with default path on Windows

2016-10-22 Thread Eryk Sun
Eryk Sun added the comment: Issues with pip should be reported to its GitHub site. But installing to the "Program Files" directory certainly isn't a problem for pip. You need to run it with administrator rights. -- nosy: +eryksun resolution: -> not a bug stage: -> resolved status:

[issue28507] Regenerate ./configure on the default branch

2016-10-22 Thread Chi Hsuan Yen
Chi Hsuan Yen added the comment: Well, I remember someone asked me to include ./configure in patches. Maybe it's worth to add a comment in devguide. -- ___ Python tracker

[issue28507] Regenerate ./configure on the default branch

2016-10-22 Thread Ned Deily
Ned Deily added the comment: That's why we suggest to not include configure changes in a patch, only configure.ac changes. It's the responsibility of the patch committer to ensure that generated files like configure are updated properly at commit time. But, yes, it would be better to not have

[issue28508] Need way to expose incremental size of key sharing dicts

2016-10-22 Thread Xiang Zhang
Xiang Zhang added the comment: > Isn't this already implemented? Get the same question. dict.__sizeof__ can identify shared dicts. -- nosy: +xiang.zhang ___ Python tracker

[issue28498] tk busy command

2016-10-22 Thread klappnase
klappnase added the comment: Ok, I investigated this a little further. First I noticed another bug with the code from my first post, the "self._w" must be omitted from the call to busy_current(), so the func should look like: def busy_current(self, pattern=None):

[issue28508] Need way to expose incremental size of key sharing dicts

2016-10-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: >>> class C: ... def __init__(self): ... for i in range(682): ... setattr(self, 'a%d'%i, None) ... >>> sys.getsizeof(C().__dict__) / len(C().__dict__) 4.058651026392962 -- ___ Python

[issue28508] Need way to expose incremental size of key sharing dicts

2016-10-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Isn't this already implemented? -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue28508] Need way to expose incremental size of key sharing dicts

2016-10-22 Thread Raymond Hettinger
New submission from Raymond Hettinger: In many Python programs much of the memory utilization is due to having many instances of the same object. We have key-sharing dicts that reduce the cost by storing only in the incremental values. It would be nice to have visibility to the savings.

[issue28507] Regenerate ./configure on the default branch

2016-10-22 Thread Chi Hsuan Yen
Chi Hsuan Yen added the comment: Thanks for the fast response. My main point is not that would affect users who compile from tarballs. The point is that if I modify configure.ac on the default branch, I can't generate a patch that applies to the default branch cleanly; there are always

[issue28507] Regenerate ./configure on the default branch

2016-10-22 Thread Ned Deily
Ned Deily added the comment: Don't worry about it. We will take care of it as necessary when we release. -- resolution: -> later stage: -> resolved status: open -> closed ___ Python tracker

[issue28507] Regenerate ./configure on the default branch

2016-10-22 Thread Chi Hsuan Yen
New submission from Chi Hsuan Yen: In 0ea088671bc2 and 3ce29b2452f0, --runstatedir was added to ./configure. Seems Benjamin uses a slightly different version of autoconf than 2.69. As a result, modifying ./configure.ac leads to unrelated changes in ./configure. Later in 17bd5239b886, this

[issue28506] Multiprocessing Pool starmap - struct.error: 'i' format requires -2e10<=n<=2e10

2016-10-22 Thread Justin Ting
Justin Ting added the comment: Ah, should have picked that up, coding at 3:30am doesn't do wonders for keeping a clear head. Thanks Tim, I'll keep that in mind! *Justin Ting* *E* justingl...@gmail.com | *M* +61 424 751 665 | *L* *https://au.linkedin.com/in/justinyting

[issue28506] Multiprocessing Pool starmap - struct.error: 'i' format requires -2e10<=n<=2e10

2016-10-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This looks as a duplicate of issue17560. -- nosy: +serhiy.storchaka resolution: -> duplicate superseder: -> problem using multiprocessing with really big objects? ___ Python tracker

[issue28506] Multiprocessing Pool starmap - struct.error: 'i' format requires -2e10<=n<=2e10

2016-10-22 Thread Tim Peters
Tim Peters added the comment: This has nothing to do with the _values_ you're passing - it has to do with the length of the pickle string: def _send_bytes(self, buf): n = len(buf) # For wire compatibility with 3.2 and lower header = struct.pack("!i", n) IT'S

[issue28506] Multiprocessing Pool starmap - struct.error: 'i' format requires -2e10<=n<=2e10

2016-10-22 Thread Justin Ting
New submission from Justin Ting: Multiprocessing is throwing this error when dealing with large amounts of data (all floating points an integers), but none of which exceeds the number boundaries in the error that it throws: File "/root/anaconda3/lib/python3.5/multiprocessing/pool.py", line

[issue28504] Cleanup unicode_decode_call_errorhandler_wchar/writer

2016-10-22 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> serhiy.storchaka ___ Python tracker ___

[issue28505] pip installation issues with default path on Windows

2016-10-22 Thread Wojtek Swiatek
New submission from Wojtek Swiatek: When installing Python 3.5 on Windows (I checked the 64bits installer but I believe the same issue will be with the 32bits), the default installation path when installing for "everyone" is now C:\ Program Files\Python35. When subsequently installing

[issue28504] Cleanup unicode_decode_call_errorhandler_wchar/writer

2016-10-22 Thread Xiang Zhang
New submission from Xiang Zhang: The patch makes several cleanups to unicode_decode_call_errorhandler_wchar/writer: 1. Use U instead O! for argument parser, it ought to be more efficient and write less code. 2. In theory, if inputobj is not bytes, there needs to be a goto onError, or it

[issue27989] incomplete signature with help function using typing

2016-10-22 Thread Guido van Rossum
Guido van Rossum added the comment: Honestly I think pydoc is already too verbose. It would be better if the class header looked more like what was written in the source code -- that is the most compact way to render it. I say open a separate issue since this issue is about functions.

[issue27989] incomplete signature with help function using typing

2016-10-22 Thread Guido van Rossum
Changes by Guido van Rossum : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___

[issue27989] incomplete signature with help function using typing

2016-10-22 Thread Roundup Robot
Roundup Robot added the comment: New changeset dc030d15f80d by Guido van Rossum in branch '3.5': Issue #27989: Tweak inspect.formatannotation() to improve pydoc rendering of function annotations. Ivan L. https://hg.python.org/cpython/rev/dc030d15f80d New changeset 3937502c149d by Guido van

[issue28498] tk busy command

2016-10-22 Thread Miguel
Miguel added the comment: Maybe it's better to add also these methods: busy = tk_busy busy_cget = tk_busy_cget busy_configure = tk_busy_configure busy_current = tk_busy_current busy_forget = tk_busy_forget busy_hold = tk_busy_hold busy_status = tk_busy_status Many

[issue27989] incomplete signature with help function using typing

2016-10-22 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Actually, for classes, it is probably worth adding a separate section "Generic type info" that will render information using __orig_bases__, __parameters__, and __args__. At the same time the "header" will be the same as now, listing runtime __bases__. What

[issue27989] incomplete signature with help function using typing

2016-10-22 Thread Guido van Rossum
Guido van Rossum added the comment: OK, sounds good then. I guess most of the work was in typing.py, not in inspect. :-) -- ___ Python tracker ___

[issue27989] incomplete signature with help function using typing

2016-10-22 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: For function annotations I did as originally proposed. In my previous comment I was talking about documentation for classes. For example: class C(Generic[T], Mapping[int, str]): ... pydoc.render_doc(C) will show "class C(typing.Mapping)". while for function

[issue27989] incomplete signature with help function using typing

2016-10-22 Thread Guido van Rossum
Guido van Rossum added the comment: Hm, I actually like the original proposal better. Perhaps collections.abc.Mapping is more common than typing.Mapping, but is it more common *in function annotations*? I don't think so. Also, I like showing e.g. Iterator[Tuple[int, Any]] rather than just

[issue27989] incomplete signature with help function using typing

2016-10-22 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Here is the patch according to the discussion (modifying inspect). I didn't change the rendering of docs for classes (neither stripped 'typing.' nor changed __bases__ to __orig_bases__). First, collections.abc.X are widely used as base classes, so that plain

[issue25953] re fails to identify invalid numeric group references in replacement strings

2016-10-22 Thread SilentGhost
SilentGhost added the comment: I've modified addgroup to take a pos argument, this seem to introduce minimal disturbance. -- Added file: http://bugs.python.org/file45187/25953_4.diff ___ Python tracker

[issue1602] windows console doesn't print or input Unicode

2016-10-22 Thread irdb
Changes by irdb : -- nosy: +irdb ___ Python tracker ___ ___ Python-bugs-list mailing

[issue28499] Logging module documentation needs a rework.

2016-10-22 Thread Pierre Bousquie
Pierre Bousquie added the comment: Hi stephane, I have tweeted Florian and he is still interested. I think the doc has a lot of information but does not organize it efficiently. My notes from the conference: - Logging reccord attribute is at 16.6.7 (middle of the doc) and that's a must to

[issue28469] timeit: use powers of 2 in autorange(), instead of powers of 10

2016-10-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Following patch takes numbers from the sequence 1, 2, 5, 10, 20, 50, ... It also updates the documentation and tests. -- components: +Library (Lib) stage: -> patch review Added file: http://bugs.python.org/file45186/timeit_autorange_numbers.patch

[issue28503] [Patch] '_crypt' module: fix implicit declaration of crypt(), use crypt_r() where available

2016-10-22 Thread Ed Schouten
New submission from Ed Schouten: The '_crypt' module provides a binding to the C crypt(3) function. It is used by the crypt.crypt() function. Looking at the C code, there are a couple of things we can improve: - Because crypt() only depends on primitive C types, we currently get away with

[issue20357] Mention buildbots in the core dev section of the devguide

2016-10-22 Thread Berker Peksag
Berker Peksag added the comment: Moved to https://github.com/python/devguide/issues/70 -- nosy: +berker.peksag resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker

[issue20847] asyncio docs should call out that network logging is a no-no

2016-10-22 Thread STINNER Victor
STINNER Victor added the comment: +Logs for :mod:`asyncio` module should always point to a file on the local +filesystem. Using any kind of network logging will block the event loop. Well... even writing to a local file can block :-/ By "network", what about the local UNIX socket used by