[issue26670] Add a developer mode: -X dev command line option

2016-04-01 Thread STINNER Victor
STINNER Victor added the comment: > Why does this patch execv() the interpreter to set options? I'd expect it to > be possible to get the same result by updating the argument parsing code in > Py_Main. It's to set PYTHONMALLOC env var which must be set before Py_Main() is called. Since I got

[issue26679] curses: Descripton of KEY_NPAGE and KEY_PPAGE inverted

2016-04-01 Thread SilentGhost
SilentGhost added the comment: Here is the patch. -- nosy: +SilentGhost stage: -> patch review type: enhancement -> behavior Added file: http://bugs.python.org/file42344/issue26679.diff ___ Python tracker

[issue26673] Tkinter error when opening IDLE configuration menu

2016-04-01 Thread wysaard
wysaard added the comment: I'm having the problem if I'm running idle with Python 2.7.11 too. -- ___ Python tracker ___

[issue26678] Incorrect linking to elements in datetime package

2016-04-01 Thread Andy Maier
Andy Maier added the comment: Ok. If these methods generate index entries, maybe the problem is on my side by not linking them correctly. So let's try with the other two changes. Unfortunately, I cannot easily build cpython at the moment to verify, I moved to Linux and when trying to build

[issue26673] Tkinter error when opening IDLE configuration menu

2016-04-01 Thread SilentGhost
Changes by SilentGhost : -- versions: +Python 2.7 ___ Python tracker ___ ___

[issue26670] Add a developer mode: -X dev command line option

2016-04-01 Thread SilentGhost
Changes by SilentGhost : -- resolution: fixed -> rejected stage: -> resolved ___ Python tracker ___

[issue18844] allow weights in random.choice

2016-04-01 Thread Christian Kleineidam
Christian Kleineidam added the comment: A user can use map(), filter(), zip() without knowing anything about generators. In most cases those function will do their magic and provide a finite number of outputs. The weighted_choice_generator on the other hand isn't as easy to use. If the user

[issue26683] Questionable terminology for describing what locals() does

2016-04-01 Thread Terry J. Reedy
Terry J. Reedy added the comment: I requested that we stop (mis)using 'free variable' in the docs years ago. A strong +1 from me. The 'locals' function what named when 'local' and 'non-global' were synonyms. When non-local, non-global names were added, nonlocals were included with 'locals'

[issue26488] hashlib command line interface

2016-04-01 Thread SilentGhost
SilentGhost added the comment: Left comments on Rietveld. -- ___ Python tracker ___ ___ Python-bugs-list

[issue26673] Tkinter error when opening IDLE configuration menu

2016-04-01 Thread wysaard
wysaard added the comment: In the screen of `About IDLE` it shows "Tk version 8.6.4". It used to work, as least since last september (when I installed this) I've had no problems. I assumed reinstalling would solve it but that did nothing. I've removed the entire python package, made my package

[issue26606] logging.baseConfig is missing the encoding parameter

2016-04-01 Thread Vinay Sajip
Vinay Sajip added the comment: > you have also to remember to restore sys.stdout I'm not sure you understand how it works. The value of sys.stdout isn't changed, so why does it need to be restored? > for non-English languages it would be more appropriate to use codecs.open() > instead of

[issue26664] find a bug in activate.fish of venv of cpython3.6

2016-04-01 Thread 鄭景文
鄭景文 added the comment: First, I use python 3.5.1 to create virtual environment. It works fine with fish. There is no $ in the activate.fish file. Second, after I removed the $, It works fine, both in ubuntu and arch linux. I guess it is because the $ is for bash not for fish, the activate.fish

[issue26488] hashlib command line interface

2016-04-01 Thread STINNER Victor
STINNER Victor added the comment: > The blocksize should be fixed and large (perhaps 256kB). I used strace to check md5sum & sha1sum: they use read() syscalls of 32,768 bytes. stat().st_blksize is 4,096 bytes. I'm not sure that it matters so much to use large read. But I don't really care,

[issue26686] email.parser stops parsing headers too soon.

2016-04-01 Thread Mark Sapiro
Mark Sapiro added the comment: Added Python 2.7 to versions: -- versions: +Python 2.7 ___ Python tracker ___

[issue26686] email.parser stops parsing headers too soon.

2016-04-01 Thread SilentGhost
Changes by SilentGhost : -- components: +email nosy: +barry, r.david.murray versions: +Python 3.5 -Python 3.4 ___ Python tracker

[issue26687] Use Py_RETURN_NONE in sqlite3 module

2016-04-01 Thread Berker Peksag
Changes by Berker Peksag : -- keywords: +patch Added file: http://bugs.python.org/file42345/py_return_none_macro.diff ___ Python tracker

[issue26687] Use Py_RETURN_NONE in sqlite3 module

2016-04-01 Thread Berker Peksag
New submission from Berker Peksag: The attached patch replaces all "Py_INCREF(Py_None); return Py_None;" lines with the Py_RETURN_NONE macro in sqlite3 module. -- components: Extension Modules messages: 262754 nosy: berker.peksag priority: normal severity: normal stage: patch review

[issue26686] email.parser stops parsing headers too soon.

2016-04-01 Thread Mark Sapiro
New submission from Mark Sapiro: Given an admittedly defective (the folded Content-Type: isn't indented) message part with the following headers/body --- Content-Disposition: inline; filename="04EBD_._A546BB.zip" Content-Type: application/x-rar-compressed;

[issue26673] Tkinter error when opening IDLE configuration menu

2016-04-01 Thread Terry J. Reedy
Terry J. Reedy added the comment: Serhiy, what do you make of the TclError? Could it be an ArchLinux-specific bug in tk? Here is the entire function: def SetFontSample(self, event=None): fontName = self.fontName.get() fontWeight = tkFont.BOLD if self.fontBold.get() else

[issue26509] asyncio: spurious ConnectionAbortedError logged on Windows

2016-04-01 Thread STINNER Victor
Changes by STINNER Victor : -- title: spurious ConnectionAbortedError logged on Windows -> asyncio: spurious ConnectionAbortedError logged on Windows ___ Python tracker

[issue26673] Tkinter error when opening IDLE configuration menu

2016-04-01 Thread wysaard
wysaard added the comment: I just fixed this problem. In my ~/.idlerc/ folder there was no `config-main.cfg` so I created it and used the settings found here: https://svn.python.org/projects/python/trunk/Mac/IDLE/config-main.def After doing that everything worked fine again. I'm not sure

[issue26606] logging.baseConfig is missing the encoding parameter

2016-04-01 Thread Vinay Sajip
Vinay Sajip added the comment: > and almost no one shows how to use the stream. Because most examples out there don't care about Unicode, etc. > I understand the redirection in the following way (also shown in the Dive > Into Python book) There's certainly no need to do that, and that would

[issue18293] ssl.wrap_socket (cert_reqs=...), getpeercert, and unvalidated certificates

2016-04-01 Thread Sascha Silbe
Sascha Silbe added the comment: Has there been any progress on this? For my application I'd very much like "ssh-like" operation, using the public key itself as identifier rather than requiring some kind of automated CA setup. Being able to set a custom verification callback would be great,

[issue26295] Random failures when running test suite in parallel (-m test -j0) caused by test_regrtest

2016-04-01 Thread STINNER Victor
STINNER Victor added the comment: Finally, I fixed the issue differently: test_regrtest now creates a temporary directory and uses --testdir command line parameter. Before, using --testdir didn't work because regrtest always added "test." prefix to module names (ex: test_os => test.test_os).

[issue26668] Remove Lib/test/test_importlib/regrtest.py?

2016-04-01 Thread Brett Cannon
Brett Cannon added the comment: Yes, I'm fine with removing it once I/someone double-checks that all the tests in test.test_importlib.import_ are doing the right thing in regards to util.test_both(..., __import__=util.__import__). -- ___ Python

[issue26647] ceval: use Wordcode, 16-bit bytecode

2016-04-01 Thread STINNER Victor
STINNER Victor added the comment: I reviewed wpy3.patch. I concur with Raymond, it's really nice to have a regular structure for the bytecode. -- Serhiy proposed to *reduce* the size of bytecode by adding new specialized bytecode which include the argument. For example (LOAD_CONST, 0) =>

[issue2943] Distutils should generate a better error message when the SDK is not installed

2016-04-01 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___

[issue26509] asyncio: spurious ConnectionAbortedError logged on Windows

2016-04-01 Thread STINNER Victor
STINNER Victor added the comment: > Can someone please commit the patch? Done. -- resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue26509] asyncio: spurious ConnectionAbortedError logged on Windows

2016-04-01 Thread Roundup Robot
Roundup Robot added the comment: New changeset 68e694475483 by Victor Stinner in branch '3.5': asyncio: Don't log ConnectionAbortedError https://hg.python.org/cpython/rev/68e694475483 -- nosy: +python-dev ___ Python tracker

[issue26668] Remove Lib/test/test_importlib/regrtest.py?

2016-04-01 Thread STINNER Victor
STINNER Victor added the comment: Do you mean that you are ok to remove this file in Python 3.6? The file is not used by test_importlib. -- ___ Python tracker

[issue26688] unittest2 referenced in unittest.mock documentation

2016-04-01 Thread Ashley Anderson
New submission from Ashley Anderson: I noticed a few references to `unittest2` in the documentation in the `unittest.mock` "getting started" section: https://docs.python.org/3.6/library/unittest.mock-examples.html#patch-decorators I am attaching a patch that just changes these occurrences

[issue26687] Use Py_RETURN_NONE in sqlite3 module

2016-04-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This patch and more can be generated by Сoccinelle [1] semantic patch. spatch --in-place --dir . --sp-file py_return_none_macro.cocci But be aware that some maintainers consider such sort of changes a code churn. [1] http://coccinelle.lip6.fr/

[issue26673] Tkinter error when opening IDLE configuration menu

2016-04-01 Thread Terry J. Reedy
Terry J. Reedy added the comment: I should have thought of .idlerc as being a possible problem. The usual fix is to delete its contents. For this tracker, exiting with a traceback is a behavior issue; a crash is something worse, a core dump or whatever the MAC equivalent is. .idlerc should

[issue26642] Replace stdout and stderr with simple standard printers at Python exit

2016-04-01 Thread STINNER Victor
STINNER Victor added the comment: +if (!closed) { +PyObject *res = PyObject_CallMethod(file, "close", ""); +PyErr_Clear(); +Py_XDECREF(res); +} +if (!dunder_closed) { +PyObject *res = PyObject_CallMethod(dunder_file, "close", ""); +

[issue26606] logging.baseConfig is missing the encoding parameter

2016-04-01 Thread Jānis Šlapiņš
Jānis Šlapiņš added the comment: Many examples in the internet only show the usage of the filename parameter of basicConfig() and almost no one shows how to use the stream. That's why I wanted to use the filename parameter. But now I tested other options and they work for me. My case may be

[issue26668] Remove Lib/test/test_importlib/regrtest.py?

2016-04-01 Thread STINNER Victor
STINNER Victor added the comment: > once I/someone double-checks that all the tests in > test.test_importlib.import_ are doing the right thing in regards to > util.test_both(..., __import__=util.__import__). Ah, I didn't understand that it was a question. I'm not interested to check that.

[issue26687] Use Py_RETURN_NONE in sqlite3 module

2016-04-01 Thread STINNER Victor
STINNER Victor added the comment: py_return_none_macro.diff looks good to me. -- nosy: +haypo ___ Python tracker ___

[issue26348] activate.fish sets VENV prompt incorrectly

2016-04-01 Thread Vinay Sajip
Vinay Sajip added the comment: Implementing this patch has led to another issue being raised: #26664. Dan - would you care to take a look and comment? Thanks. -- ___ Python tracker

[issue26642] Replace stdout and stderr with simple standard printers at Python exit

2016-04-01 Thread STINNER Victor
STINNER Victor added the comment: Patch version 2: * check if the stream was already "closed" (see below and comment in the patch) * first replace stream and then close it and DECREF the object * don't close stdin anymore > 1. Is there a reason only name is closed, not dunder_name? (Josh's

[issue26488] hashlib command line interface

2016-04-01 Thread Aviv Palivoda
Aviv Palivoda added the comment: Publishing another patch after SilentGhost and Victor CR. I also changed the block size to 256 KB. If someone can remove the dependency on issue 14156 (I don't think I have permissions). -- Added file:

[issue26676] Add missing XMLPullParser to ElementTree.__all__

2016-04-01 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3d6b67361749 by Martin Panter in branch 'default': Issue #26676: Add missing XMLPullParser to ElementTree.__all__ https://hg.python.org/cpython/rev/3d6b67361749 -- nosy: +python-dev ___ Python tracker

[issue26488] hashlib command line interface

2016-04-01 Thread Aviv Palivoda
Aviv Palivoda added the comment: I am adding a new patch with changes from Martin CR (Thanks for the review) and support in the "check" option. I also changed to examples in the Documentation to use sha256 instead of md5 as Christian asked. I left one example with sha1 so when someone read it

[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2016-04-01 Thread Robert Smallshire
Robert Smallshire added the comment: As for whether the shortcut float.is_integer(x) was needed, it has different behavior to x==int(x) when x is either NaN or an infinity. We must even deal with two different exception types OverflowError or ValueError respectively for these two values on

[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2016-04-01 Thread Stefan Krah
Stefan Krah added the comment: is_integer() is very important for writing new functions. libmpdec has it and it's used a lot inside mpdecimal.c. In this case though I assume Robert needs it for duck typing. -- ___ Python tracker

[issue26676] Add missing XMLPullParser to ElementTree.__all__

2016-04-01 Thread Martin Panter
Changes by Martin Panter : -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker ___

[issue26606] logging.baseConfig is missing the encoding parameter

2016-04-01 Thread Jānis Šlapiņš
Jānis Šlapiņš added the comment: Yes, it also works. But then you have also to remember to restore sys.stdout to the initial state at the end. In addition, for non-English languages it would be more appropriate to use codecs.open() instead of just open() in this case. The complexity of the

[issue26678] Incorrect linking to elements in datetime package

2016-04-01 Thread Andy Maier
Andy Maier added the comment: Hi Martin! The intersphinx stuff is simply linking from a Sphinx RST documentation to a different Sphinx RST documentation, using support from the intersphinx extension of Sphinx. I think the name comes from the interwiki links in MediaWiki. It only comes into

[issue26682] Ttk Notebook tabs do not show with 1-2 char names

2016-04-01 Thread Terry J. Reedy
Terry J. Reedy added the comment: No, I can't remember where it is and do not have an account on their tracker, if one is needed. -- ___ Python tracker

[issue26682] Ttk Notebook tabs do not show with 1-2 char names

2016-04-01 Thread Terry J. Reedy
Terry J. Reedy added the comment: I am not surprised, somehow, that details of bug should depend on system. I should have said Win 10, 3.5.1/8.6.4. -- ___ Python tracker

[issue21069] test_fileno of test_urllibnet intermittently fails

2016-04-01 Thread Martin Panter
Martin Panter added the comment: Mark: My understanding is on Windows, winsock file descriptors and C library file descriptors are different beasts; see . Perhaps the test should call socket functions like socket.recv() on

[issue13952] mimetypes doesn't recognize .csv

2016-04-01 Thread Werner Van Geit
Werner Van Geit added the comment: Will this patch ever make it into the main python version ? I just ran into exactly this issue (mimetypes returns None as mimetype of csv file on Windows) -- nosy: +Werner Van Geit versions: +Python 3.4, Python 3.5, Python 3.6

[issue21069] test_fileno of test_urllibnet intermittently fails

2016-04-01 Thread Mark Lawrence
Changes by Mark Lawrence : -- nosy: -BreamoreBoy ___ Python tracker ___ ___

[issue26671] Clean up path_converter in posixmodule.c

2016-04-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Good catch! Here is updated patch. It fixes also hiding exception in dir_fd converter. -- Added file: http://bugs.python.org/file42341/path_converter_cleanup_2.patch ___ Python tracker

[issue26685] Raise errors from socket.close()

2016-04-01 Thread Martin Panter
New submission from Martin Panter: While looking at a recent failure of test_fileno() in test_urllibnet, I discovered that socket.close() ignores the return value of the close() system call. It looks like it has always been this way:

[issue26671] Clean up path_converter in posixmodule.c

2016-04-01 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___

[issue26685] Raise errors from socket.close()

2016-04-01 Thread STINNER Victor
STINNER Victor added the comment: I like the idea :-) -- nosy: +haypo ___ Python tracker ___ ___

[issue26685] Raise errors from socket.close()

2016-04-01 Thread Martin Panter
Changes by Martin Panter : -- dependencies: +test_fileno of test_urllibnet intermittently fails ___ Python tracker ___

[issue26678] Incorrect linking to elements in datetime package

2016-04-01 Thread Martin Panter
Martin Panter added the comment: I’m happy to make those two minimal changes (:noindex: and tzinfo class), but I have a feeling they won’t help your problem linking to datetime.tzinfo.utcoffset() and dst(). The markup for those methods already generates index entries, see

[issue21069] test_fileno of test_urllibnet intermittently fails

2016-04-01 Thread Martin Panter
Martin Panter added the comment: Here is a patch implementing my ideas. Let me know what you think of the ideas and/or the patch :) If people think this change is too much for 3.5, I could try making a more minimal patch that calls something like socket.getpeername() rather than read(). That

[issue26657] Directory traversal with http.server and SimpleHTTPServer on windows

2016-04-01 Thread Martin Panter
Martin Panter added the comment: Thomas: My check for os.path.devnull was just a half-hearted attempt to check for special device names like NUL on Windows. It is far from foolproof, and would fail my CON.fusion test that I mentioned above. Anyway, to address this specific bug it would be

[issue5901] missing meta-info in documentation pdf

2016-04-01 Thread Berker Peksag
Berker Peksag added the comment: I get the following output when I try Python 3.5.1 docs: $ pdfinfo using.pdf Title: Subject: Keywords: Author: Creator:LaTeX with hyperref package Producer: pdfTeX-1.40.14 CreationDate: Sat Apr 2 00:17:54 2016

[issue26679] curses: Descripton of KEY_NPAGE and KEY_PPAGE inverted

2016-04-01 Thread Berker Peksag
Berker Peksag added the comment: Thanks, Robert and SilentGhost. I verified the patch with the following script: import curses def main(stdscr): while True: c = stdscr.getch() if c == curses.KEY_PPAGE: stdscr.addstr('Page Up') elif c ==

[issue26679] curses: Descripton of KEY_NPAGE and KEY_PPAGE inverted

2016-04-01 Thread Roundup Robot
Roundup Robot added the comment: New changeset f41d3321007f by Berker Peksag in branch '3.5': Issue #26679: Fix description of KEY_PPAGE and KEY_NPAGE constants https://hg.python.org/cpython/rev/f41d3321007f New changeset 23d986228c6b by Berker Peksag in branch 'default': Issue #26679: Fix

[issue26647] ceval: use Wordcode, 16-bit bytecode

2016-04-01 Thread Demur Rumed
Demur Rumed added the comment: Got f_lasti working as -1. Applied PEP7. Unrelated: fixed a misnamed variable in test_grammar because it ran into a peephole bug (const -> jump_if_false erase didn't work when EXTENDED_ARGs were involved). dis has argval/arg set to None instead of the unused

[issue26678] Incorrect linking to elements in datetime package

2016-04-01 Thread Roundup Robot
Roundup Robot added the comment: New changeset 30e077f886cc by Martin Panter in branch '3.5': Issue #26678: Fix indexing of datetime.tzinfo and timezone classes https://hg.python.org/cpython/rev/30e077f886cc New changeset 854db1a2cd98 by Martin Panter in branch 'default': Issue #26678: Merge

[issue26688] unittest2 referenced in unittest.mock documentation

2016-04-01 Thread Roundup Robot
Roundup Robot added the comment: New changeset 73279e4a1107 by Berker Peksag in branch '3.5': Issue #26688: Fix module name in mock docs https://hg.python.org/cpython/rev/73279e4a1107 New changeset 24efe844e598 by Berker Peksag in branch 'default': Issue #26688: Fix module name in mock docs

[issue26488] hashlib command line interface

2016-04-01 Thread Martin Panter
Martin Panter added the comment: I left some replies to Rietveld comments (sending review emails seems buggy). For a chunk size, don’t worry too much about it. I would say keep it large enough to limit time spent executing Python code and syscalls, keep it small to avoid wasting high speed

[issue26646] Allow built-in module in package

2016-04-01 Thread Brett Cannon
Brett Cannon added the comment: Referring to the other issue was more about tying the two issues together than necessarily expecting the other patch to work. As for supporting packages as well as submodules, I'm not sure. It seems a little odd not to support the idea, but then again if

[issue26688] unittest2 referenced in unittest.mock documentation

2016-04-01 Thread Berker Peksag
Berker Peksag added the comment: Good catch, thanks Ashley! 3.3 and 3.4 are in security-fix-only mode so we don't fix documentation issues in those branches. -- nosy: +berker.peksag resolution: -> fixed stage: -> resolved status: open -> closed type: -> behavior versions: -Python

[issue26646] Allow built-in module in package

2016-04-01 Thread Daniel Shaulov
Daniel Shaulov added the comment: Hi Brett, I don't think that the patch from that issue is relevant anymore. I did take the test case that was proposed in that issue and I am attaching a fixed version here. I did realize from the discussion that my patch probably doesn't work on Windows (I

[issue26686] email.parser stops parsing headers too soon.

2016-04-01 Thread Martin Panter
Martin Panter added the comment: Also see Issue 24363, basically the same bug in the HTTP parser, which (ab?)uses the email package to do most of the work. In that case, according to my note the faulty header field ends with: X-Frame-Options: SAMEORIGIN\r\n Set-Cookie: mb-CookieP=; HttpOnly;

[issue26678] Incorrect linking to elements in datetime package

2016-04-01 Thread Martin Panter
Martin Panter added the comment: Can you link to other methods? E.g. try io.IOBase.close(), which is done the normal way as a method indented under its class, and nntplib.NNTP.quit(), which is listed separately from its class definition. Regarding CRLFs in “configure”, all I can guess is

[issue17436] hashlib: add a method to hash the content of a file

2016-04-01 Thread Aviv Palivoda
Aviv Palivoda added the comment: While working on issue 26488 I found a real need for this feature. I added a new method to the hash object named fromfile(). The function update the hash object with the content of the file like object it receives. I only added the feature to hash algorithm

[issue17436] hashlib: add a method to hash the content of a file

2016-04-01 Thread STINNER Victor
STINNER Victor added the comment: > I added a new method to the hash object named fromfile(). Usually, fromxxx() is used to create a new object. In your case, it's more to update an existing hash object. So I would prefer the name "readfile". IMHO you need two methods: *

[issue17436] hashlib: add a method to hash the content of a file

2016-04-01 Thread Christian Heimes
Christian Heimes added the comment: For readfile() it might make more sense to implement it directly in C and let OpenSSL's BIO layer handle IO internally. It's more efficient and you can release the GIL around the whole operation. -- nosy: +christian.heimes

[issue26684] pathlib.Path.with_name() and .with_suffix do not allow combining with an empty Path

2016-04-01 Thread Ethan Furman
Ethan Furman added the comment: Never mind. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___