[issue26710] ConfigParser: Values in DEFAULT section override defaults passed to constructor

2016-04-07 Thread SilentGhost
SilentGhost added the comment: You can override the level if an environmental variable was defined. Not sure why it needs to be responsibility of the ConfigParser. While I'm not going to immediately close this issue, I don't think such a backward-incompatible proposal is viable. --

[issue23239] SSL match_hostname does not accept IP Address

2016-04-07 Thread Marc Abramowitz
Marc Abramowitz added the comment: `ip_certs_comment.patch` is a simple patch that just removes the verbiage about not supporting IP addresses in hostnames, as that restriction was removed by an earlier commit from Antoine. -- ___ Python tracker

[issue23239] SSL match_hostname does not accept IP Address

2016-04-07 Thread Christian Heimes
Christian Heimes added the comment: I'm -1 on the patch for a practical reason: The current API is broken and I don't want to have it documented as officially supported. In fact it is not only broken but also incompatible with more modern releases of OpenSSL. Recently OpenSSL got proper

[issue26710] ConfigParser: Values in DEFAULT section override defaults passed to constructor

2016-04-07 Thread Marc Abramowitz
Marc Abramowitz added the comment: Some more info on the logging example I gave. So here is a program called `my_app.py`: ``` import os import logging.config logging.config.fileConfig('logging.ini', defaults=os.environ) logger = logging.getLogger(__name__) logger.debug('debug msg')

[issue25339] sys.stdout.errors is set to "surrogateescape"

2016-04-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What do you think about this Victor? -- ___ Python tracker ___ ___

[issue26710] ConfigParser: Values in DEFAULT section override defaults passed to constructor

2016-04-07 Thread Marc Abramowitz
Marc Abramowitz added the comment: So I think changing the behavior of `defaults` might break backwards compatibility for folks who are relying on the old behavior. So I guess I would propose adding a new parameter called `overrides`. These would take precedence over `defaults` and that

[issue26704] unittest.mock.patch: Double patching instance method: AttributeError: Mock object has no attribute '__name__'

2016-04-07 Thread SilentGhost
Changes by SilentGhost : -- nosy: +michael.foord stage: -> patch review type: crash -> behavior versions: -Python 3.4 ___ Python tracker

[issue26710] ConfigParser: Values in DEFAULT section override defaults passed to constructor

2016-04-07 Thread Marc Abramowitz
New submission from Marc Abramowitz: My expectation was that any defaults I passed to ConfigParser when creating one would override values in the DEFAULT section of the config file. This is because I'd like the DEFAULT section to have the default values, but then I want to be able to override

[issue26693] Exception ignored in: in _shutdown, assert tlock.locked()

2016-04-07 Thread skydoom
skydoom added the comment: It looks like there is a bug in the _shutdown function of threading.py, that it does not check whether the _main_thread.is_alive() or not. My temporary fix is to add the following checking in the beginning of _shutdown and it seems no more error message pop up:

[issue26707] plistlib fails to parse bplist with 0x80 UID values

2016-04-07 Thread John Lehr
John Lehr added the comment: I’m sorry, but the files in which I detected the problem cannot be circulated. I will try to create a test account on Snapchat and generate some test data, but I can’t do this anytime soon. > On Apr 7, 2016, at 12:51 AM, SilentGhost

[issue26693] Exception ignored in: in _shutdown, assert tlock.locked()

2016-04-07 Thread skydoom
skydoom added the comment: sorry typo above, is_active should be read as is_alive. -- ___ Python tracker ___

[issue26707] plistlib fails to parse bplist with 0x80 UID values

2016-04-07 Thread John Lehr
John Lehr added the comment: I’m glad you found it in the Apple specification. I looked, but missed it. I would absolutely defer to you on your assessment of the decoding. > On Apr 7, 2016, at 1:46 AM, Serhiy Storchaka wrote: > > > Serhiy Storchaka added the

[issue26698] Tk DPI awareness

2016-04-07 Thread Terry J. Reedy
Terry J. Reedy added the comment: This is not an IDLE issue, and probably not a tkinter issue. The display of characters on a screen is done by the OS font software under direction of tcl/tk. What OS are you running and what version of Tk (see IDLE -> Help -> About IDLE)? --

[issue18844] allow weights in random.choice

2016-04-07 Thread Steven Basart
Steven Basart added the comment: Left in a line of code that was supposed to be removed. Fixed. -- Added file: http://bugs.python.org/file42393/weighted_choice_v5.patch ___ Python tracker

[issue18844] allow weights in random.choice

2016-04-07 Thread Steven Basart
Changes by Steven Basart : Removed file: http://bugs.python.org/file42392/weighted_choice_v5.patch ___ Python tracker ___

[issue18844] allow weights in random.choice

2016-04-07 Thread Steven Basart
Steven Basart added the comment: Re-implemented with suggested improvements taken into account. Thanks @mark.dickinson and @pitrou for the suggestions. I also removed the redundant "fast path" portion for this code since it doesn't deal with generators anyways. Let me know additional

[issue26707] plistlib fails to parse bplist with 0x80 UID values

2016-04-07 Thread John Lehr
John Lehr added the comment: Based on the format specification pointed to by Serhiy, perhaps this a better patch, correcting size from previous patch submission and treating: 706,707c706,708 < # tokenH == 0x80 is documented as 'UID' and appears to be used for < #

[issue26707] plistlib fails to parse bplist with 0x80 UID values

2016-04-07 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> ronaldoussoren ___ Python tracker ___ ___

[issue25320] unittest loader.py TypeError when code directory contains a socket

2016-04-07 Thread Mike Miller
Mike Miller added the comment: Just as a side note, the patch also works for soft links that point to files that don't exist. Thanks for getting this fixed! -- nosy: +Mike Miller ___ Python tracker

[issue26711] Fix comparison of plistlib.Data

2016-04-07 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Proposed patch fixes several bugs in plistlib.Data.__eq__(). * isinstance(other, str) was used instead of isinstance(other, bytes). Data always wraps bytes and should be comparable with bytes. str was correct type in Python 2. * id(self) == id(other) is

[issue26708] Constify C string pointers in the posix module

2016-04-07 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Proposed patch adds the "const" qualifier to char and wchar_t pointers in the posix module to prevents possible bugs. These pointers point to internal data of PyBytes or PyUnicode objects or to C string literals, and unintentional changing the content is

[issue26707] plistlib fails to parse bplist with 0x80 UID values

2016-04-07 Thread SilentGhost
SilentGhost added the comment: Here is the version of the patch suitable for the Rietveld. John, could you perhaps provide an example file that uses UID values? Also, the code is identical to handling of 0x50 token, perhaps it could be incorporated into it. -- nosy: +SilentGhost

[issue26703] Socket state corrupts when original socket object goes out of scope in a different thread

2016-04-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: The general answer here is you should avoid mixing calls to different abstraction layers. Either use only the file descriptor or only the socket object. This is not limited to lifetime issues, other issues can occur. For example, setting a timeout on a

[issue26708] Constify C string pointers in the posix module

2016-04-07 Thread Larry Hastings
Larry Hastings added the comment: You should find a different reviewer. I don't really care about "const". I'll live with it if it's there but I'm not going to go around adding it. -- ___ Python tracker

[issue18844] allow weights in random.choice

2016-04-07 Thread Mark Dickinson
Mark Dickinson added the comment: > One to make it return a single number if amount == 1 and the other to check > that the amount > 1. I think that's a dangerous API. Any code making a call to "weighted_choice(..., amount=n)" for variable n now has to be prepared to deal with two possible

[issue18844] allow weights in random.choice

2016-04-07 Thread Mark Dickinson
Mark Dickinson added the comment: > One to make it return a single number if amount == 1 and the other to check > that the amount > 1. Suggestion: if you want to go that way, return a single number if `amount` is not provided (so make the default value for `amount` None rather than 1). If

[issue18844] allow weights in random.choice

2016-04-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Suggestion: if you want to go that way, return a single number if `amount` is > not provided (so make the default value for `amount` None rather than 1). If > `amount=1` is explicitly given, a list containing one item should be returned. +1 --

[issue26709] Year 2038 problem in plistlib

2016-04-07 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Plistlib fails to load dates before year 1901 and after year 2038 in binary format on platforms with 32-bit time_t. >>> data = plistlib.dumps(datetime.datetime(1901, 1, 1), >>> fmt=plistlib.FMT_BINARY) >>> plistlib.loads(data) Traceback (most recent call

[issue26707] plistlib fails to parse bplist with 0x80 UID values

2016-04-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: UID is rather int than bytes. And I would use a special UID type. According to Apple's sources [1], the size of UID data is tokenL+1, not self._get_size(tokenL). [1] http://www.opensource.apple.com/source/CF/CF-1153.18/CFBinaryPList.c --

[issue26671] Clean up path_converter in posixmodule.c

2016-04-07 Thread Martin Panter
Martin Panter added the comment: Looks like the tests may need updating for a changed exception message: http://buildbot.python.org/all/builders/x86%20Ubuntu%20Shared%203.x/builds/12996/steps/test/logs/stdio == FAIL: test_stat

[issue26257] Eliminate buffer_tests.py

2016-04-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset 197e1f8b28b7 by Martin Panter in branch '3.5': Issue #26257: Eliminate buffer_tests.py and fix ByteArrayAsStringTest https://hg.python.org/cpython/rev/197e1f8b28b7 New changeset ea598d69b7d3 by Martin Panter in branch 'default': Issue #26257: Merge

[issue26671] Clean up path_converter in posixmodule.c

2016-04-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset 633bb190fb76 by Serhiy Storchaka in branch 'default': Issue #26671: Fixed tests for changed error messages. https://hg.python.org/cpython/rev/633bb190fb76 -- ___ Python tracker

[issue26671] Clean up path_converter in posixmodule.c

2016-04-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Martin. -- status: open -> closed ___ Python tracker ___ ___

[issue23551] IDLE to provide menu link to PIP gui.

2016-04-07 Thread Eric Khoo Jiun Hooi
Eric Khoo Jiun Hooi added the comment: The search button of search tab still not done yet, so it still cannot be used now -- Added file: http://bugs.python.org/file42396/pip_gui_v5.py ___ Python tracker