[issue25495] binascii documentation incorrect

2015-11-02 Thread Mouse
Mouse added the comment: 1. I concede knowing nothing about the early Python library implementation, functionality, or even purpose. 2. I don't think it makes sense now to either refer to PEM. We'd be two decades too late for that (well, 27 years, to be precise :). See

[issue25525] Deallocation scheme for memoryview is unsafe

2015-11-02 Thread Stefan Krah
Stefan Krah added the comment: Thanks, no big problem. The thing is that the parts I wrote (Modules/_decimal/*, Objects/memoryobject.c, Modules/_testbuffer.c) have been audited rather heavily and have 100% code coverage with a privately maintained patch that inserts allocation failures. There

[issue25474] Weird behavior when setting f_trace in a context manager

2015-11-02 Thread Fred Gansevles
Fred Gansevles added the comment: Xavier, thanks! you found it. If I look the code again, I see that with zero, one, four and five the context-manager (i.e. Context()) and the target (one .. five) are on the same code-line In the case of two and three they are on a different line. Now, with the

[issue25483] Improve f-string implementation: FORMAT_VALUE opcode

2015-11-02 Thread Eric V. Smith
Eric V. Smith added the comment: Right, they're the same because it's a single bit. You 'and' with a mask to get the bits you want, and you 'or' together the values. It's an old habit left over from my bit-twiddling days. I guess the test could really be: have_fmt_spec = (oparg & FVS_MASK)

[issue25495] binascii documentation incorrect

2015-11-02 Thread R. David Murray
R. David Murray added the comment: Add a parenthetical "(57 bytes of the input per line)" and I'll be happy with that. -- ___ Python tracker ___

[issue25495] binascii documentation incorrect

2015-11-02 Thread Mouse
Mouse added the comment: And even those constraints depend on the use. E.g. X.509 does not have those. -- ___ Python tracker ___

[issue25483] Improve f-string implementation: FORMAT_VALUE opcode

2015-11-02 Thread Eric V. Smith
Eric V. Smith added the comment: Some formatting improvements. I removed one of the optimizations I was doing, because it's also done in PyObject_Format(). I plan on moving other optimizations into PyObject_Format(), but I'll open a separate issue for that. I swapped the order of the

[issue25523] Correct "a" article to "an" article

2015-11-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Martin for your review. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue25531] greenlet header file is missing inside virtualenv

2015-11-02 Thread R. David Murray
R. David Murray added the comment: I don't see a link to a greenlet issue, and setuptools is not maintained as part of the stdlib. It sounds like we should close this until and if the greenlet project can point us to a specific problem with the stdlib distutils. -- resolution: ->

[issue25531] greenlet header file is missing inside virtualenv

2015-11-02 Thread Kracekumar Ramaraj
Kracekumar Ramaraj added the comment: I have created an issue in setuptools repo: https://bitbucket.org/pypa/setuptools/issues/455/unable-to-build-extension-in-python-35. -- ___ Python tracker

[issue25495] binascii documentation incorrect

2015-11-02 Thread Mouse
Mouse added the comment: Let's not insinuate anything about the input. This is about what constraints on the OUTPUT MAY be there, not a tutorial from the 80-ties on how one might accomplish it. -- ___ Python tracker

[issue25534] SimpleHTTPServer throwed an exception due to negtive st_mtime attr in file

2015-11-02 Thread Sean Wang
New submission from Sean Wang: I transfered a file from remote Debian host to my local Windows 10 host using SecureFX. I found that the file's last modifed date was ‎1900‎/‎1‎/1‎,‏‎0:00:00 on Windows. I tried to serve this file to be downloaded, and it crashed as follows: Exception happened

[issue25533] Make pkgutil.iter_modules() yield built-in modules

2015-11-02 Thread R. David Murray
R. David Murray added the comment: IMO, definitely this should not be changed by default. An alternative to a boolean flag would be a new function (iter_all_modules?). -- nosy: +r.david.murray ___ Python tracker

[issue25193] itertools.accumulate should have an optional initializer argument

2015-11-02 Thread Alun Champion
Alun Champion added the comment: Understandable, though it would have also made the first order recurrence relationships more accurate, e.g. annualized interest on an initial balance: accumulate(repeat(None), lambda: bal, _: bal*1.05, initializer=1000) vs. artificially repeating 1000:

[issue25533] Make pkgutil.iter_modules() yield built-in modules

2015-11-02 Thread R. David Murray
Changes by R. David Murray : -- nosy: +brett.cannon ___ Python tracker ___ ___

[issue25495] binascii documentation incorrect

2015-11-02 Thread R. David Murray
R. David Murray added the comment: Please take a look at the Examples section of this: http://perldoc.perl.org/MIME/Base64.html Looks kind of like Martin's suggestion :) -- ___ Python tracker

[issue25483] Improve f-string implementation: FORMAT_VALUE opcode

2015-11-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It looks to me that FVS_MASK and FVS_HAVE_SPEC are duplicates. FVS_HAVE_SPEC is set but FVS_MASK is tested. -- ___ Python tracker

[issue25474] Weird behavior when setting f_trace in a context manager

2015-11-02 Thread Xavier de Gaye
Xavier de Gaye added the comment: The difference lies in the line numbers. When tracing lines, the interpreter operates on the basis of physical lines, not logical lines (https://docs.python.org/3/reference/lexical_analysis.html#line-structure). The local trace function is called on the

[issue25534] SimpleHTTPServer throwed an exception due to negtive st_mtime attr in file

2015-11-02 Thread Sean Wang
Sean Wang added the comment: upload a sample test file -- Added file: http://bugs.python.org/file40929/test ___ Python tracker ___

[issue25483] Improve f-string implementation: FORMAT_VALUE opcode

2015-11-02 Thread Stefan Krah
Stefan Krah added the comment: The MASK idiom is nice and I think it's good to be exposed to it from time to time. -- nosy: +skrah ___ Python tracker ___

[issue25523] Correct "a" article to "an" article

2015-11-02 Thread Roundup Robot
Roundup Robot added the comment: New changeset 75df8b0a2cd1 by Serhiy Storchaka in branch '3.4': Issue #25523: Further a-to-an corrections. https://hg.python.org/cpython/rev/75df8b0a2cd1 New changeset 68edc7baeef7 by Serhiy Storchaka in branch '3.5': Issue #25523: Merge a-to-an corrections from

[issue25536] use sys.platform instead of os.name in asyncio docs consistently

2015-11-02 Thread Guido van Rossum
Guido van Rossum added the comment: Sounds good. I'll commit this. -- ___ Python tracker ___ ___

[issue25531] greenlet header file is missing inside virtualenv

2015-11-02 Thread Ned Deily
Changes by Ned Deily : -- Removed message: http://bugs.python.org/msg253937 ___ Python tracker ___

[issue25531] greenlet header file is missing inside virtualenv

2015-11-02 Thread Ned Deily
Ned Deily added the comment: As David notes, this issue does not document any problems with Python 3.5 itself. I see at least two issues here. One, you are using virtualenv, a third-party package, rather than Python's built-in venv. It appears that the most recent release of virtualenv on

[issue25535] collections.Counter methods return Counter objects instead of subclass objects

2015-11-02 Thread R. David Murray
R. David Murray added the comment: This indeed looks like a bug to me, but I won't be surprised if Raymond says it was done on purpose. On the other hand originally the binary operator mothods didn't correctly return NotImplemented for non-Counters, so perhaps it is just an oversight. I'm

[issue25531] greenlet header file is missing inside virtualenv

2015-11-02 Thread Ned Deily
Ned Deily added the comment: As David notes, this issue does not document any problems with Python 3.5 itself. I see at least two issues here. One, you are using virtualenv, a third-party package, rather than Python's built-in venv. It appears that the most recent release of virtualenv on

[issue25535] collections.Counter methods return Counter objects instead of subclass objects

2015-11-02 Thread Mark Dickinson
Mark Dickinson added the comment: I'm fairly sure that this behaviour is deliberate, and (more-or-less) consistently applied throughout the builtin and standard library types. If you create a subclass C of list, then concatenation of two instances of C still gives a result of type list.

[issue24306] Backport py.exe to 3.4

2015-11-02 Thread Steve Dower
Steve Dower added the comment: So with the 3.5 launcher being installed all-users by default, the attached patch is a good option. I'm not able to build 3.4 entirely, but I made the modification to the MSI directly and it works fine, so I intend to go ahead and apply it (with some extra line

[issue25455] Some repr implementations don't check for self-referential structures

2015-11-02 Thread Raymond Hettinger
Raymond Hettinger added the comment: Changing PyObject_Repr is too course; it affects a broad class of objects other than containers, and it risks unknown impacts to larges swaths of third-party code use this venerable API. It is also a break with the long established history of recursion

[issue25540] virtual conf file encoding error on windows

2015-11-02 Thread tanbro
New submission from tanbro: When create a new `venv` on windows, sometimes an `UnicodeDecodeError` occurred. It seems that, it is caused by the system module `site`. In `Lib/site.py`, line 468:: with open(virtual_conf) as f: for line in f: line =

[issue25455] Some repr implementations don't check for self-referential structures

2015-11-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yet one example: >>> import io >>> class BR(io.BufferedReader): ... @property ... def name(self): ... return self ... >>> repr(BR(io.BytesIO())) Segmentation fault The same is for other file-like objects. --

[issue25531] greenlet header file is missing inside virtualenv

2015-11-02 Thread Alexey Borzenkov
Alexey Borzenkov added the comment: I created a simple gist that can show the problem: https://gist.github.com/snaury/ea167713b1804ffbaf5a (testme.sh builds Python 3.5, creates a venv, install greenlet and tries to compile an extension) -- ___

[issue25531] greenlet header file is missing inside virtualenv

2015-11-02 Thread Alexey Borzenkov
Alexey Borzenkov added the comment: I have reproduced this problem on Linux with pyvenv, isn't that part of Python 3.5? -- ___ Python tracker ___

[issue25535] collections.Counter methods return Counter objects instead of subclass objects

2015-11-02 Thread R. David Murray
R. David Murray added the comment: OK, good point. Perhaps we should turn this into a feature request to replace the calls to Counter with a call to an overridable method to make subclassing in this way possible without massive cut and paste. --

[issue25535] collections.Counter methods return Counter objects instead of subclass objects

2015-11-02 Thread Mark Dickinson
Mark Dickinson added the comment: Relevant post from Tim Peters back in 2005, on the subject of subclassing datetime and timedelta: """ Yes, and all builtin Python types work that way. For example, int.__add__ or float.__add__ applied to a subclass of int or float will return an int or float;

[issue25083] Python can sometimes create incorrect .pyc files

2015-11-02 Thread tzickel
tzickel added the comment: 1. You are correct the issue I am talking about is in parsing source files (Altough because python caches them as .pyc it's a worse situation). 2. The example you give is EINTR handling (which is mostly handling interrupted I/O operations by signals and retrying

[issue25516] threading.Condition._is_owned() is wrong when using threading.Lock

2015-11-02 Thread Nir Soffer
Changes by Nir Soffer : -- nosy: +haypo, pitrou ___ Python tracker ___ ___ Python-bugs-list

[issue25539] python3 fail on parsing http header

2015-11-02 Thread 신동원
New submission from 신동원: I tried to login some website using requests session, but it failed because of parsing header. This is header data of problem. It contains two line of continuous CRLF between the data. Date: Mon, 02 Nov 2015 08:45:48 GMT Server: Apache/2.2.20 (Unix) mod_ssl/2.2.20

[issue25531] greenlet header file is missing inside virtualenv

2015-11-02 Thread Kracekumar Ramaraj
Kracekumar Ramaraj added the comment: Updating wheel to latest version fixed assertion issue but uwsgi installation still fails. Virtualenv has updated to latest whhel version https://github.com/pypa/virtualenv/blob/develop/virtualenv_support/wheel-0.26.0-py2.py3-none-any.whl. Also, my

[issue25474] Weird behavior when setting f_trace in a context manager

2015-11-02 Thread Fred Gansevles
Fred Gansevles added the comment: Xavier, thanks for looking at my post. But, since all six invocations of the context manager are the same - I did an 'ast.parse' and 'ast.dump' and the the six calls were *exactly* the same (save lineno and col_offset) - why does 'zero', 'one', 'four' and

[issue25495] binascii documentation incorrect

2015-11-02 Thread Mouse
Mouse added the comment: 1. I am OK with the following text, modeling referred Perldoc: b2a_base64( $bytes, $eol ); Encode data by calling the encode_base64() function. The first argument is the byte string to encode. The second argument is optional, and provides the line-ending sequence to

[issue25536] use sys.platform instead of os.name in asyncio docs consistently

2015-11-02 Thread Guido van Rossum
Guido van Rossum added the comment: Fixed in 3.4, 3.5, 3.6 by these commits: 193327cabbbc, e2400d5d67e7, 40ce5f4b8835. -- resolution: -> fixed status: open -> closed ___ Python tracker

[issue25533] Make pkgutil.iter_modules() yield built-in modules

2015-11-02 Thread Brett Cannon
Brett Cannon added the comment: How would this handle frozen modules? -- ___ Python tracker ___ ___

[issue25535] collections.Counter methods return Counter objects

2015-11-02 Thread Rob Malouf
New submission from Rob Malouf: Several collections.Counter methods return Counter objects, which is leads to wrong or at least confusing behavior when Counter is subclassed. For example, nltk.FreqDist is a subclass of Counter: >>> x = nltk.FreqDist(['a','a','b','b','b']) >>> y =

[issue25536] use sys.platform instead of os.name in asyncio docs consistently

2015-11-02 Thread Akira Li
New submission from Akira Li: asyncio code uses "sys.platform == 'win32'" to detect OS. asyncio docs use both os.name and sys.platform. As far as I can tell there is no *practical* difference between "os.name == 'nt" and "sys.platform == 'win32'" for choosing asyncio.ProactorEventLoop() I've

[issue25531] greenlet header file is missing inside virtualenv

2015-11-02 Thread Ned Deily
Ned Deily added the comment: Alexey, thanks for the simplified test case. I'll look at it further. -- resolution: third party -> stage: resolved -> status: closed -> open ___ Python tracker

[issue25157] Installing Python 3.5.0 32bit on Windows 8.1 64bit system gives Error 0x80240017

2015-11-02 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' : -- nosy: +giampaolo.rodola ___ Python tracker ___ ___

[issue25537] Call `isinstance` instead of `issubclass` during exception handling

2015-11-02 Thread Sjoerd Job Postmus
New submission from Sjoerd Job Postmus: Currently Python2.7 calls `PyObject_IsSubclass` during exception handling. This allows some virtual-base-class machinery to make Python believe a certain class should match an exception while it in reality does not. However, this does not necessarily

[issue25523] Correct "a" article to "an" article

2015-11-02 Thread Martin Panter
Martin Panter added the comment: Thanks Serhiy. My pass over the files missed most cases where there was a line break involved, and certain punctuation and markup, which you picked up on. I skipped the /Lib/msilib/schema.py file in my patch because it was part of the data rather than a

[issue24379] operator.subscript

2015-11-02 Thread Martin Panter
Martin Panter added the comment: On the mailing list, Antoine also suggested removing __slots__ completely as another workaround. I agree that it doesn’t seem important for a singleton, though in the review comments a couple people seemed to want __slots__. --

[issue25474] Weird behavior when setting f_trace in a context manager

2015-11-02 Thread Terry J. Reedy
Terry J. Reedy added the comment: Thank you Xavier. I guess the lesson is that physical line tracing works best (and most as one would hope or expect) when physical lines are logical lines (or compound statement header lines). -- resolution: -> not a bug stage: test needed ->

[issue25535] collections.Counter methods return Counter objects instead of subclass objects

2015-11-02 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger ___ Python tracker ___

[issue25534] SimpleHTTPServer throwed an exception due to negtive st_mtime attr in file

2015-11-02 Thread Martin Panter
Martin Panter added the comment: I think your test file’s time is lost on the web server. On Linux it is pretty easy to make a file with an arbitrary time; maybe Windows has an equivalent: $ touch -d "1 Jan 1900" test I experimented with Wine, and it seems gmtime() raises ValueError on Python

[issue25498] Python 3.4.3 core dump with simple sample code

2015-11-02 Thread Martin Panter
Martin Panter added the comment: I tend to agree with Serhiy about Eryksun’s patch. I understand it solves the current problem, and continues to protect against this scenario: >>> b = bytearray(b"a") >>> c = ctypes.c_char.from_buffer(b) >>> b *= 1000 BufferError: Existing exports of data:

[issue25538] Traceback from __exit__ method is misleading

2015-11-02 Thread R. David Murray
New submission from R. David Murray: This is at least the second time that I've wasted a bunch of debugging time being mislead by the traceback from __exit__. Perhaps I will remember from now on, but...I wonder if it would be possible/practical to improve the situation. The problem is that

[issue25535] collections.Counter methods return Counter objects instead of subclass objects

2015-11-02 Thread Raymond Hettinger
Raymond Hettinger added the comment: The decision was deliberate and matches what we've done elsewhere in Python. The nearest kin to Counters are sets/frozensets which also behave the same way: >>> class S(set): pass >>> type(S('abc') | S('cdef')) Mark Dickinson

[issue25537] Call `isinstance` instead of `issubclass` during exception handling

2015-11-02 Thread R. David Murray
R. David Murray added the comment: This does not sound like the kind of change we would accept for python 2.7. (I also don't understand what the difference is between calling issubclass on the type and isinstance on the instance in this case. But, then, I haven't looked at the code in

[issue2466] os.path.ismount doesn't work for mounts the user doesn't have permission to see

2015-11-02 Thread Berker Peksag
Berker Peksag added the comment: Thanks for the patch, Robin. The patch needs a test case. See Lib/test/test_posixpath.py. The test coverage of ismount() is not high, so we need more tests. Also, I don't have much time to work on this right now, but Antoine's suggestion in msg71294 sounds

[issue25533] Make pkgutil.iter_modules() yield built-in modules

2015-11-02 Thread Martin Panter
New submission from Martin Panter: When no specific list of paths are given, pkgutil.iter_modules() and walk_packages() will list modules found on sys.path. But they don’t list built-in modules, which don’t live in a particular directory. So many users of these APIs (such as the ModuleScanner

[issue22450] urllib doesn't put Accept: */* in the headers

2015-11-02 Thread Martin Panter
Martin Panter added the comment: The Curl programmer replied basically saying there was no scientific reason, but since Curl was previously sending a custom Accept header, it was safer to leave a bare-bones Accept header in than completely remove it. Plus he thought it might be slighly more

[issue25532] infinite loop when running inspect.unwrap over unittest.mock.call

2015-11-02 Thread Michael Foord
Michael Foord added the comment: For mock I think your proposed fix is fine. call is particularly magic as merely importing it into modules can cause introspection problems like this (venusian is a third party library that has a similar issue), so working around these problems as they arise

[issue25495] binascii documentation incorrect

2015-11-02 Thread Martin Panter
Martin Panter added the comment: FWIW that Perl function looks like it does the line splitting for you. It mentions “chunks that are a multiple of 57 bytes”. The Python function does not do any line splitting. You have to use base64.encodebytes(), codecs.encode(encoding="base64") or perhaps

[issue25157] Installing Python 3.5.0 32bit on Windows 8.1 64bit system gives Error 0x80240017

2015-11-02 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: I am having the same problem with Windows 7 64-bit. Tried to install all updates but nothing changed. As for the suggestion to install SP1 1: - Windows update does not automatically install it - As for the manual installation I am not sure which file to

[issue25532] infinite loop when running inspect.unwrap over unittest.mock.call

2015-11-02 Thread Chris Withers
Chris Withers added the comment: Ah yes, I can see how Venusian would get confused. How about making the check a more generic: if attr.startswith('__'): raise AttributeError(attr) ? That said, why does call have a __getattr__? Where is that intended to be used? --

[issue25531] greenlet header file is missing inside virtualenv

2015-11-02 Thread Kracekumar Ramaraj
Kracekumar Ramaraj added the comment: Link to greenlet issue: https://github.com/python-greenlet/greenlet/issues/96 -- status: pending -> open ___ Python tracker

[issue25531] greenlet header file is missing inside virtualenv

2015-11-02 Thread R. David Murray
R. David Murray added the comment: Thanks for the links. I'll leave this open for now since it isn't clear where the problem is. Please update the issue with any additional information you get from setuptools if it looks like a distutils problem, or ping this issue if you get no response

[issue25530] ssl: OP_NO_SSLv3 should always be set unless a user specifically asks for it

2015-11-02 Thread Alex Gaynor
Alex Gaynor added the comment: Oops, there were a few failing tests on that patch. New one is green -- Added file: http://bugs.python.org/file40927/sslv3.diff ___ Python tracker

[issue25157] Installing Python 3.5.0 32bit on Windows 8.1 64bit system gives Error 0x80240017

2015-11-02 Thread eryksun
eryksun added the comment: > As for the suggestion to install SP1 1... As for the manual > installation I am not sure which file to download from It's one of these three, depending on your system architecture: windows6.1-KB976932-X86.exe - This application installs Sp1 to a

[issue12029] Catching virtual subclasses in except clauses

2015-11-02 Thread Martin Panter
Martin Panter added the comment: In the current (v4) patch, it looks like there is an unneeded “allow_new_exception” parameter that is always set to zero. So maybe the patch needs more careful thought. Also I agree it needs documentation, what’s new, “changed in version 3.6”, etc. --

[issue25533] Make pkgutil.iter_modules() yield built-in modules

2015-11-02 Thread Martin Panter
Martin Panter added the comment: My patch doesn’t handle frozen modules. Maybe we need a new sys.frozen_module_names API, or a sys.list_frozen_module_names() function if it is meant to be dynamic. All I could find was

[issue25537] Call `isinstance` instead of `issubclass` during exception handling

2015-11-02 Thread Martin Panter
Martin Panter added the comment: [Avoiding UTF-8 error] This is an interesting idea that never occurred to me. It would be nice to support it if the performance impact isn’t a problem. By the sound of Issue 12029, performance is barely affected until you actually try to catch a “virtual

[issue25538] Traceback from __exit__ method is misleading

2015-11-02 Thread Martin Panter
Martin Panter added the comment: I guess you are mainly complaining about when __exit__() implementation is built into the interpreter. E.g., given demo.py: with open("/dev/full", "wb") as file: file.write(b"data") print("All is well") print("Not executed") the output looks like All