[issue27065] robotparser user agent considered hostile by mod_security rules.

2016-05-19 Thread Berker Peksag
Berker Peksag added the comment: Thanks for the report. This is a duplicate of issue 15851. -- nosy: +berker.peksag resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Lib/robotparser.py doesn't accept setting a user agent string, instead it uses the def

[issue27066] SystemError if custom opener returns -1

2016-05-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Added comments on Rietveld. -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list

[issue27054] Python installation problem: No module named 'encodings'

2016-05-19 Thread Hugh C. Lauer
Hugh C. Lauer added the comment: Thanks, I will try it when I get out of airports. Hugh Lauer On May 19, 2016 11:56 AM, Zachary Ware wrote: > > > Zachary Ware added the comment: > > Here's some pretty compelling evidence for a bad PYTHONHOME setting: > > C:\>set PYTHONHOME=C:\path\not\here >

[issue26536] Add the SIO_LOOPBACK_FAST_PATH option to socket.ioctl

2016-05-19 Thread Daniel Stokes
Daniel Stokes added the comment: I have uploaded a new patch with the suggested changes, thanks for the review. -- Added file: http://bugs.python.org/file42908/loopback_fast_path_v3.patch ___ Python tracker ___

[issue27066] SystemError if custom opener returns -1

2016-05-19 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: Here's a proposed fix. -- assignee: -> barry keywords: +patch stage: needs patch -> patch review Added file: http://bugs.python.org/file42907/27066-1.patch ___ Python tracker ___

[issue22558] Missing doc links to source code

2016-05-19 Thread Yoni Lavi
Yoni Lavi added the comment: Friendly ping -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue27066] SystemError if custom opener returns -1

2016-05-19 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On May 20, 2016, at 12:12 AM, ppperry wrote: >Also, `OSError [Errno 0] Error` isn't the most helpful error message. No, definitely not. ;) -- ___ Python tracker

[issue27066] SystemError if custom opener returns -1

2016-05-19 Thread ppperry
ppperry added the comment: Also, `OSError [Errno 0] Error` isn't the most helpful error message. -- nosy: +ppperry ___ Python tracker ___

[issue27066] SystemError if custom opener returns -1

2016-05-19 Thread Barry A. Warsaw
New submission from Barry A. Warsaw: Let's say you use a custom opener, and that opener happens to return exactly -1. You end up with a SystemError because NULL got returned without an exception being set: def negative(fname, flags): return -1 with open('/tmp/foo.txt', 'w', encoding='ut

[issue27065] robotparser user agent considered hostile by mod_security rules.

2016-05-19 Thread John Nagle
New submission from John Nagle: "robotparser" uses the default Python user agent when reading the "robots.txt" file, and there's no parameter for changing that. Unfortunately, the "mod_security" add-on for Apache web server, when used with the standard OWASP rule set, blacklists the default Py

[issue27064] Make py.exe default to Python 3 when used interactively

2016-05-19 Thread Steve Dower
Steve Dower added the comment: LGTM. The launcher is in a bit of a funny place wrt versioning, as it is now somewhat independent from the Python version it is installed with: * won't be downgraded by 3.5 (3.4 will still stomp over the file itself) * has a separate entry in Programs & Features

[issue27064] Make py.exe default to Python 3 when used interactively

2016-05-19 Thread Paul Moore
New submission from Paul Moore: By default, the launcher tries to launch (the latest version of) Python 2 on the user's machine. This can be altered with the configuration file, and if the user doesn't have Python 2 installed Python 3 will be used. Now that we are at Python 3.6, it's about tim

[issue27061] 2.7.11 OS X pkg doesn't put proper version in the receipts

2016-05-19 Thread Ned Deily
Ned Deily added the comment: This problem was brought up previously in Issue24052, which is still open. I am closing this a duplicate add adding you to the nosy list there. -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> OS X installer provides f

[issue24502] OS X installer provides flat sub-packages with no version numbers

2016-05-19 Thread Ned Deily
Changes by Ned Deily : -- nosy: +Paul Bloch priority: normal -> high versions: -Python 3.4 ___ Python tracker ___ ___ Python-bugs-lis

[issue26814] [WIP] Add a new _PyObject_FastCall() function which avoids the creation of a tuple or dict for arguments

2016-05-19 Thread STINNER Victor
STINNER Victor added the comment: > In short, I replayed exaclty the same scenario. And... Only raytrace remains > slower, (...) Oh, it looks like the reference binary calls the garbage collector less frequently than the patched python. In the patched Python, collections of the generation 2 a

[issue27062] `inspect` doesn't have `__all__`

2016-05-19 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I refer again to https://bugs.python.org/issue26632 :) -- nosy: +barry ___ Python tracker ___ ___ P

[issue27063] Some unittest loader tests are silently skipped by mistake

2016-05-19 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Due to bug in the decorator some tests in Lib/unittest/test/test_loader.py are silently skipped. Proposed patch fixes this as well as other bugs in the decorator and tests. -- components: Tests files: test_loader.patch keywords: patch messages: 265

[issue27062] `inspect` doesn't have `__all__`

2016-05-19 Thread Franklin? Lee
New submission from Franklin? Lee: `inspect`'s names are pretty close to unique, except for `stack`, `unwrap`, and `trace`. It doesn't define `__all__`, though. -- components: Library (Lib) messages: 265893 nosy: leewz priority: normal severity: normal status: open title: `inspect` does

[issue27060] Documentation of assertItemsEqual in unittest is VERY misleading in 2.7

2016-05-19 Thread Georg Brandl
Changes by Georg Brandl : -- nosy: +michael.foord ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue22570] Better stdlib support for Path objects

2016-05-19 Thread Guido van Rossum
Guido van Rossum added the comment: Done. The revs are 90e58a77d386, 97198545e6c3, ade839421b8f. -- resolution: out of date -> fixed status: open -> closed ___ Python tracker ___

[issue27061] 2.7.11 OS X pkg doesn't put proper version in the receipts

2016-05-19 Thread Paul Bloch
New submission from Paul Bloch: Python 2.7.6 writes the version number (2.7.6) into the installed receipts. Python 2.7.11 calls the version "0". That isn't very helpful for managed installs. -- components: Macintosh files: typescript.txt messages: 265891 nosy: Paul Bloch, ned.deily, ro

[issue17866] TestCase.assertItemsEqual exists in 2.7, not in 3.3

2016-05-19 Thread Vitaly
Vitaly added the comment: I opened http://bugs.python.org/issue27060 regarding the erroneous documentation of assertItemsEqual in python 2.7. -- ___ Python tracker ___ _

[issue17866] TestCase.assertItemsEqual exists in 2.7, not in 3.3

2016-05-19 Thread Vitaly
Vitaly added the comment: Python 2.7 documentation is VERY misleading about the functionality of assertItemsEqual. It actually claims to compare not only the counts, but the actual sorted elements themselves. This documentation mislead my group to use this method for comparing the elements. Se

[issue27060] Documentation of assertItemsEqual in unittest is VERY misleading in 2.7

2016-05-19 Thread Vitaly
Changes by Vitaly : -- assignee: -> docs@python components: +Documentation nosy: +docs@python ___ Python tracker ___ ___ Python-bugs-

[issue27060] Documentation of assertItemsEqual in unittest is VERY misleading in 2.7

2016-05-19 Thread Vitaly
Changes by Vitaly : -- versions: +Python 2.7 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue27060] Documentation of assertItemsEqual in unittest is VERY misleading in 2.7

2016-05-19 Thread Vitaly
New submission from Vitaly: Python 2.7 documentation is VERY misleading about the functionality of assertItemsEqual. The implementation only compares item counts, but the documentation actually claims to compare not only the counts, but the actual sorted elements themselves. This documentation

[issue26969] ascynio should provide a policy to address pass-loop-everywhere problem

2016-05-19 Thread Ilya Kulakov
Ilya Kulakov added the comment: Yury, as you suggested posted to python-ideas (https://groups.google.com/forum/#!topic/python-ideas/ABOe22Mib44) -- ___ Python tracker ___ __

[issue26814] [WIP] Add a new _PyObject_FastCall() function which avoids the creation of a tuple or dict for arguments

2016-05-19 Thread STINNER Victor
STINNER Victor added the comment: > Result of the benchmark suite: > > slower (3): > > * raytrace: 1.06x slower > * etree_parse: 1.03x slower > * normal_startup: 1.02x slower Hum, I recompiled the patched Python, again with PGO+LTO, and ran the same benchmark with the same command. In short, I

[issue27059] find_spec and find_loader ignore package/path argument

2016-05-19 Thread Brett Cannon
Brett Cannon added the comment: So there are 2 problems with your example. One, importlib.util.find_spec() doesn't take a path argument but a package argument which is a package name and not a file system location (https://docs.python.org/3/library/importlib.html#importlib.util.find_spec). Tw

[issue25548] Show the address in the repr for class objects

2016-05-19 Thread ppperry
ppperry added the comment: I don't quite get why the memory address is helpful, but you could work around this using a custom metaclass: class IdMeta(type): def __repr__(cls): return super().__repr__()[:-1] + " at 0x%x>"%id(cls) class IdInRepr(metaclass=IdMeta):pass

[issue27053] Python Windows x86-64 embeddable zip file missing module encodings

2016-05-19 Thread Steve Dower
Changes by Steve Dower : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-li

[issue27053] Python Windows x86-64 embeddable zip file missing module encodings

2016-05-19 Thread Roundup Robot
Roundup Robot added the comment: New changeset 12cb81e90479 by Steve Dower in branch '3.5': Issue #27053: Updates make_zip.py to correctly generate library ZIP file. https://hg.python.org/cpython/rev/12cb81e90479 New changeset a6473f7a8c55 by Steve Dower in branch 'default': Issue #27053: Update

[issue27054] Python installation problem: No module named 'encodings'

2016-05-19 Thread ppperry
Changes by ppperry : -- type: -> crash ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org

[issue27059] find_spec and find_loader ignore package/path argument

2016-05-19 Thread Gerrit Ansmann
New submission from Gerrit Ansmann: According to my understanding, the `package`/`path` argument of the `find_loader`/`find_spec` command should enable it to find modules in other directories than the current one. Instead, these arguments seem to be ignored and even changing the working direct

[issue26369] unicode.decode and str.encode are unnecessarily confusing for non-ascii

2016-05-19 Thread Josh Rosenberg
Josh Rosenberg added the comment: Agree with Steven; the whole reason Python 3 changed from unicode and str to str and bytes was because having Py2 str be text sometimes, and binary data at other times is confusing. The existing behavior can't change in Py2 in any meaningful way without breaki

[issue27058] Tkinter's canvas' dashed lines have incorrect segment lengths

2016-05-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: "Not our fault. Try reporting this to the Tcl team" ;-) In any case thank you for your report Kevin. -- resolution: not a bug -> third party stage: -> resolved ___ Python tracker

[issue26369] unicode.decode and str.encode are unnecessarily confusing for non-ascii

2016-05-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > btw If anyone can find the place in the code (sorry I tried and failed!) > where str.encode('utf-8', error=X) is resulting in an implicit call to the > equivalent of decode(defaultencoding, errors=strict) (as suggested by the > exception message) I think i

[issue26369] unicode.decode and str.encode are unnecessarily confusing for non-ascii

2016-05-19 Thread Steven D'Aprano
Steven D'Aprano added the comment: Ben, I'm sorry to see you have spent such a long time writing up reasons for changing this behaviour. I fear this is a total waste of your time, and ours to read it. Python 2.7 is under feature freeze, and changing the behaviour of str.encode and unicode.deco

[issue27058] Tkinter's canvas' dashed lines have incorrect segment lengths

2016-05-19 Thread Kevin
Kevin added the comment: This problem appears to go deeper than Python. On the TK bug tracker, under the issue "-dashofset option doesnt work on ms windows build" (https://core.tcl.tk/tk/tktview?name=1055974fff), a commenter mentions: > On Windows, only certain dash patterns and no dash offse

[issue27058] Tkinter's canvas' dashed lines have incorrect segment lengths

2016-05-19 Thread Kevin
Kevin added the comment: Ok, I've tried testing Serhiy's `canvas_dash.tcl` file, by running: import Tkinter root = Tkinter.Tk() root.tk.eval("source canvas_dash.tcl") root.mainloop() (I'm not sure if this counts as "pure" Tcl/Tk. I don't have any experience in using Tcl/Tk outs

[issue27053] Python Windows x86-64 embeddable zip file missing module encodings

2016-05-19 Thread Wolfgang Langner
Wolfgang Langner added the comment: Yes this is the cause. If it is renamed to python36.zip everything works fine. For the test I have only extracted the distributed zip and executed python.exe. Had not looked further into the issue. So only the simple report something did not work. Thanks for

[issue27053] Python Windows x86-64 embeddable zip file missing module encodings

2016-05-19 Thread Steve Dower
Steve Dower added the comment: The "python35.zip" file contains the standard library and it needs to be renamed "python36.zip". Apparently I hardcoded this somewhere instead of inferring it from the current version... I'll fix. -- assignee: -> steve.dower versions: +Python 3.5 _

[issue16468] argparse only supports iterable choices

2016-05-19 Thread Berker Peksag
Changes by Berker Peksag : -- nosy: +berker.peksag versions: +Python 3.5, Python 3.6 -Python 3.2, Python 3.3, Python 3.4 ___ Python tracker ___ __

[issue17408] second python execution fails when embedding

2016-05-19 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- nosy: -terry.reedy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue26369] unicode.decode and str.encode are unnecessarily confusing for non-ascii

2016-05-19 Thread Ben Spiller
Ben Spiller added the comment: btw If anyone can find the place in the code (sorry I tried and failed!) where str.encode('utf-8', error=X) is resulting in an implicit call to the equivalent of decode(defaultencoding, errors=strict) (as suggested by the exception message) I think it'll be easie

[issue27057] os.set_inheritable(): fall back to fcntl() if ioctl() fails with EACCES

2016-05-19 Thread STINNER Victor
STINNER Victor added the comment: >> You should now sign the PSF Contributor Agreement >Done. Thanks! -- ___ Python tracker ___ ___ P

[issue15913] PyBuffer_SizeFromFormat is missing

2016-05-19 Thread Berker Peksag
Changes by Berker Peksag : -- stage: -> needs patch versions: +Python 3.6 -Python 3.4 ___ Python tracker ___ ___ Python-bugs-list mai

[issue27058] Tkinter's canvas' dashed lines have incorrect segment lengths

2016-05-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could you please test pure Tcl/Tk example? -- nosy: +serhiy.storchaka Added file: http://bugs.python.org/file42902/canvas_dash.tcl ___ Python tracker

[issue27054] Python installation problem: No module named 'encodings'

2016-05-19 Thread Zachary Ware
Zachary Ware added the comment: Here's some pretty compelling evidence for a bad PYTHONHOME setting: C:\>set PYTHONHOME=C:\path\not\here C:\>py -3.5 Fatal Python error: Py_Initialize: unable to load the file system codec ImportError: No module named 'encodings' Current thread 0x1db4 (most

[issue27057] os.set_inheritable(): fall back to fcntl() if ioctl() fails with EACCES

2016-05-19 Thread Michał Bednarski
Michał Bednarski added the comment: > You should now sign the PSF Contributor Agreement Done. > (Well, in fact it would be better to do that *before* merging your change, > but well, your change is short enough ;-)) Well on https://docs.python.org/devguide/patch.html was said "For non-trivial

[issue27058] Tkinter's canvas' dashed lines have incorrect segment lengths

2016-05-19 Thread Kevin
New submission from Kevin: When creating a dashed line using `Canvas.create_line`. Minimal reproducing example: from Tkinter import * root = Tk() canvas = Canvas(root, width=100, height=30, bg="black") canvas.pack() canvas.create_line((0,10,100,10), dash=(20,), fill="red")

[issue27054] Python installation problem: No module named 'encodings'

2016-05-19 Thread Zachary Ware
Zachary Ware added the comment: Also, I suspect your pip issue on Windows 10 is due to the fact that you need to either specify the --user flag or run pip as administrator, since your user account can't write to the global site-packages under Program Files. --

[issue27054] Python installation problem: No module named 'encodings'

2016-05-19 Thread STINNER Victor
STINNER Victor added the comment: To list environment variable, you can open cmd.exe and type the command "set". -- nosy: +haypo ___ Python tracker ___ __

[issue27054] Python installation problem: No module named 'encodings'

2016-05-19 Thread Zachary Ware
Zachary Ware added the comment: Hugh, could you check your environment and see if you have any PYTHON* variables set, particularly PYTHONHOME? -- ___ Python tracker ___

[issue27057] os.set_inheritable(): fall back to fcntl() if ioctl() fails with EACCES

2016-05-19 Thread STINNER Victor
STINNER Victor added the comment: > The ioctl is blocked for given file type regardless of request argument. As > I'm running Python on non-rooted Android updating policy is not really an > option. Oh. Right :-) My intent was to suggest to report the SELinux issue upstream ;-) > It will alway

[issue27054] Python installation problem: No module named 'encodings'

2016-05-19 Thread Stefan Krah
Stefan Krah added the comment: I can only comment on the Windows 10 issue: I think I did the install with "Right-click -> Run as administrator" and then installed for all users. Encodings, pip and everything else works here. -- nosy: +skrah ___ Pytho

[issue27057] os.set_inheritable(): fall back to fcntl() if ioctl() fails with EACCES

2016-05-19 Thread Roundup Robot
Roundup Robot added the comment: New changeset 13c5135d8467 by Victor Stinner in branch '3.5': Fix os.set_inheritable() on Android https://hg.python.org/cpython/rev/13c5135d8467 New changeset 783c1b8cdddb by Victor Stinner in branch 'default': Merge 3.5 (issue #27057) https://hg.python.org/cpyth

[issue27054] Python installation problem: No module named 'encodings'

2016-05-19 Thread Hugh C. Lauer
Hugh C. Lauer added the comment: On a hunch, I uninstalled Python 3.5.1 and reinstalled it for the current user only, to see if it would make a difference in the association of the encodings in the Registry. There was no difference. The original error message still appears. Regards, Hugh C.

[issue27057] os.set_inheritable(): fall back to fcntl() if ioctl() fails with EACCES

2016-05-19 Thread Michał Bednarski
Michał Bednarski added the comment: > Hum, I'm surprised that SELinux blocks such safe function. Maybe the SELinux > policy should be completed to allow it? The ioctl is blocked for given file type regardless of request argument. As I'm running Python on non-rooted Android updating policy is no

[issue27056] pickle: constant propagation in _Unpickler_Read()

2016-05-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: +1. Similar optimization is used in marshal. Added comments on Rietveld. -- ___ Python tracker ___ __

[issue26814] [WIP] Add a new _PyObject_FastCall() function which avoids the creation of a tuple or dict for arguments

2016-05-19 Thread STINNER Victor
STINNER Victor added the comment: Status of the my FASTCALL implementation (34456cce64bb.patch): * Add METH_FASTCALL calling convention to C functions, similar to METH_VARARGS|METH_KEYWORDS * Clinic uses METH_FASTCALL when possible (it may use METH_FASTCALL for all cases in the future) * Add

[issue26814] [WIP] Add a new _PyObject_FastCall() function which avoids the creation of a tuple or dict for arguments

2016-05-19 Thread STINNER Victor
STINNER Victor added the comment: New patch: 34456cce64bb.patch $ diffstat 34456cce64bb.patch .hgignore |3 Makefile.pre.in | 37 b/Doc/includes/shoddy.c |2 b/Include/Python.h

[issue26814] [WIP] Add a new _PyObject_FastCall() function which avoids the creation of a tuple or dict for arguments

2016-05-19 Thread STINNER Victor
Changes by STINNER Victor : Removed file: http://bugs.python.org/file42898/34456cce64bb.diff ___ Python tracker ___ ___ Python-bugs-list maili

[issue26814] [WIP] Add a new _PyObject_FastCall() function which avoids the creation of a tuple or dict for arguments

2016-05-19 Thread STINNER Victor
Changes by STINNER Victor : Added file: http://bugs.python.org/file42898/34456cce64bb.diff ___ Python tracker ___ ___ Python-bugs-list mailing

[issue26814] [WIP] Add a new _PyObject_FastCall() function which avoids the creation of a tuple or dict for arguments

2016-05-19 Thread STINNER Victor
STINNER Victor added the comment: Hi, I made progress on my FASTCALL branch. I removed tp_fastnew, tp_fastinit and tp_fastnew fields from PyTypeObject to replace them with new type flags (ex: Py_TPFLAGS_FASTNEW) to avoid code duplication and reduce the memory footprint. Before, each function was

[issue27054] Python installation problem: No module named 'encodings'

2016-05-19 Thread Hugh C. Lauer
Hugh C. Lauer added the comment: Upon further investigation, I find lots of encodings in the folder C:\Program Files\Python35\Lib\encodings\ and lots of compiled encodings in the subfolder __pycache__ . Somehow, these are not being found by Python itself, or there is something missing from th

[issue27057] os.set_inheritable(): fall back to fcntl() if ioctl() fails with EACCES

2016-05-19 Thread STINNER Victor
STINNER Victor added the comment: Hum, I'm surprised that SELinux blocks such safe function. Maybe the SELinux policy should be completed to allow it? Detect when ioctl() fails with EACCESS and fallback to fnctl() sounds like a good option. But do you expect ioctl() to always fail with EACCESS

[issue27057] os.set_inheritable(): fall back to fcntl() if ioctl() fails with EACCES

2016-05-19 Thread Michał Bednarski
New submission from Michał Bednarski: When SELinux forbids ioctl() it fails with EACCES and whole os.set_inheritable raises exception. As in https://bugs.python.org/issue22258 code was added to fall back to fcntl when ioctl() fails with ENOTTY I'm adding EACCES value to same condition to fall

[issue27056] pickle: constant propagation in _Unpickler_Read()

2016-05-19 Thread STINNER Victor
New submission from STINNER Victor: According to Linux perf, the unpickle_list benchmark (of the CPython benchmark suite) heavily depends on the performance of load() and _Unpickler_Read() functions. While running benchmarks with PGO+LTO compilation, I noticed a difference around 5% because on

[issue17408] second python execution fails when embedding

2016-05-19 Thread Denny Weinberg
Denny Weinberg added the comment: Hi, I think that the problem exists also in python 3.5.1 After calling Py_Finalize and Py_Initialize I get the message "attribute of type 'NoneType' is not callable" on the datetime.strptime method. Example: from datetime import datetime s = '20160505 16'

[issue17408] second python execution fails when embedding

2016-05-19 Thread Palm Kevin
Changes by Palm Kevin : -- nosy: +palm.kevin ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho