[issue33190] problem with ABCMeta.__prepare__ when called after types.new_class

2018-03-30 Thread Rick Teachey
Rick Teachey added the comment: Thank you; I gave it a go. Hopefully didn't cause too much additional work for someone. -- ___ Python tracker

[issue33190] problem with ABCMeta.__prepare__ when called after types.new_class

2018-03-30 Thread Rick Teachey
Change by Rick Teachey : -- keywords: +patch pull_requests: +6033 stage: -> patch review ___ Python tracker ___

[issue23495] The writer.writerows method should be documented as accepting any iterable (not only a list)

2018-03-30 Thread Zackery Spytz
Zackery Spytz added the comment: Commit 7901b48a1f89b9bfa9d111ae3725400b466a9baa removed the unnecessary list conversion (3.5+), but the documentation issue remains. -- nosy: +ZackerySpytz versions: +Python 3.6, Python 3.7, Python 3.8 -Python 3.4, Python 3.5

[issue23495] The writer.writerows method should be documented as accepting any iterable (not only a list)

2018-03-30 Thread Zackery Spytz
Change by Zackery Spytz : -- keywords: +patch pull_requests: +6032 stage: needs patch -> patch review ___ Python tracker ___

[issue33188] dataclass MRO entry resolution for type variable metaclasses: TypeError

2018-03-30 Thread Rick Teachey
Rick Teachey added the comment: I'll also say: one of the biggest reasons I was excited to read the `dataclasses` PEP was because I thought "AWESOME! Now I can delete all of the stupid boilerplate __init__ and __repr__ methods for those `typing.Sequences`,

[issue33188] dataclass MRO entry resolution for type variable metaclasses: TypeError

2018-03-30 Thread Rick Teachey
Rick Teachey added the comment: > passing keyword arguments to metaclass will be much more rare for dataclasses > than passing a ready namespace The impetus of my running into these issues was assuming that things like `Generic[MyTypeVar]` would "just work" with

[issue33186] Memory corruption with urllib.parse

2018-03-30 Thread Steven D'Aprano
Steven D'Aprano added the comment: Alexey, I'm afraid I can't make heads or tails of your bug report. You've gone into a detailed description of the "bad results" you have, but you haven't explained *why* they're bad, or what you were expecting. I'm afraid that I

[issue33188] dataclass MRO entry resolution for type variable metaclasses: TypeError

2018-03-30 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: > If we're going to call new_class in make_dataclass, then we should change the > signature of make_dataclass to have the new_class parameters. Why? I think we should care about what API/signature is reasonable/typical for dataclasses

[issue33034] urllib.parse.urlparse and urlsplit not raising ValueError for bad port

2018-03-30 Thread Matt Eaton
Matt Eaton added the comment: I was able to get some time together today and created a rough draft for the idea that you had Berker on introducing a new API with more strict parsing rules. This will allow the ValueError to be raised when the URL is parsed rather than

[issue33188] dataclass MRO entry resolution for type variable metaclasses: TypeError

2018-03-30 Thread Eric V. Smith
Eric V. Smith added the comment: If we're going to call new_class in make_dataclass, then we should change the signature of make_dataclass to have the new_class parameters. -- ___ Python tracker

[issue32823] Regression in test -j behavior and time in 3.7.0b1

2018-03-30 Thread Zachary Ware
Zachary Ware added the comment: Terry, could you give me the full command you use to get that result? -- ___ Python tracker ___

[issue31455] ElementTree.XMLParser() mishandles exceptions

2018-03-30 Thread Zachary Ware
Zachary Ware added the comment: This added a refleak on 2.7, see http://buildbot.python.org/all/#/builders/78/builds/122 and later builds. Also, the bug ID in the blurb is incorrect (31544 vs 31455). -- nosy: +zach.ware status: closed -> open

[issue33188] dataclass MRO entry resolution for type variable metaclasses: TypeError

2018-03-30 Thread Rick Teachey
Rick Teachey added the comment: Eric: see also Ivan's comment on Issue 33190, which will factor into the solution to this I think. It seems you can't just pass the `namespace` to the `kwds` argument (as I have done in my solution above). --

[issue33150] Signature error for methods of class configparser.Interpolation

2018-03-30 Thread Terry J. Reedy
Terry J. Reedy added the comment: Can you write a test case that raises the exception? Use .read_string to create the CF instance, as that calls .read_file, which calls ._read, which calls ._join_multiline_values. I wonder if we could delete .before_read and replace its

[issue33191] Refleak in posix_spawn

2018-03-30 Thread Zachary Ware
Change by Zachary Ware : -- keywords: +patch pull_requests: +6031 stage: -> patch review ___ Python tracker ___

[issue33191] Refleak in posix_spawn

2018-03-30 Thread Zachary Ware
New submission from Zachary Ware : There is a refleak in posix_spawn; see for example http://buildbot.python.org/all/#/builders/114/builds/53 The attached PR fixes it, but I am not confident that I did it correctly. -- components: Interpreter Core messages:

[issue33190] problem with ABCMeta.__prepare__ when called after types.new_class

2018-03-30 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: https://devguide.python.org/ will help you. -- ___ Python tracker ___

[issue33190] problem with ABCMeta.__prepare__ when called after types.new_class

2018-03-30 Thread Rick Teachey
Rick Teachey added the comment: Excellent; thank you very much for the explanation. I have never done a PR on a project this size but I'll give it a try. -- ___ Python tracker

[issue33190] problem with ABCMeta.__prepare__ when called after types.new_class

2018-03-30 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: This is not a bug, but a misunderstanding: * First, ABCMeta doesn't have `__prepare__`, it is just `type.__prepare__` * Second, the third argument to `types.new_class` is called `kwds` for a reason. It is not a namespace like in `type`

[issue33147] Update references for RFC 3548 to RFC 4648

2018-03-30 Thread Terry J. Reedy
Terry J. Reedy added the comment: Ewa handles recording of CAs. -- assignee: -> docs@python components: +Documentation nosy: +Ewa.Jodlowska, docs@python, terry.reedy stage: -> patch review versions: +Python 3.8 ___ Python tracker

[issue33190] problem with ABCMeta.__prepare__ when called after types.new_class

2018-03-30 Thread Rick Teachey
New submission from Rick Teachey : I am pretty sure this is a bug. If not I apologize. Say I want to dynamically create a new `C` class, with base class `MyABC` (and dynamically assigned abstract method `m`). This works fine if I use `type`, but if I use `new_class`, the

[issue33130] functools.reduce signature/docstring discordance

2018-03-30 Thread Terry J. Reedy
Terry J. Reedy added the comment: inspect.signature(functools.reduce) raises, so I presume you mean the header for the reduce entry at https://docs.python.org/3/library/functools.html#functools.reduce. The first line of the docstring, functools.reduce.__doc__, also

[issue33189] pygettext doesn't work with f-strings

2018-03-30 Thread Riccardo Polignieri
New submission from Riccardo Polignieri : Tested (on windows) with python 3.6, but I guess it's the same in py3.7: # test.py def hello(x): print(_(f'hello {x}')) > py pygettext.py test.py Traceback (most recent call last): File "C:\Program

[issue33186] Memory corruption with urllib.parse

2018-03-30 Thread Ivan Zakharyaschev
Ivan Zakharyaschev added the comment: > 1. The described result can be valid if there are "doubly quoted" strings in > the input list. To check this I've modified your testcase.py: diff --git a/testcase.py b/testcase.py index b597205..fefcef2 100755 --- a/testcase.py +++

[issue33188] dataclass MRO entry resolution for type variable metaclasses: TypeError

2018-03-30 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: This is not a bug but an explicit design decision. Generic classes are _static_ typing concept and therefore are not supposed to work freely with _dynamic_ class creation. During discussion of PEP 560 it was decided that there should

[issue33188] dataclass MRO entry resolution for type variable metaclasses: TypeError

2018-03-30 Thread Rick Teachey
Rick Teachey added the comment: Same error on 3.7. Probably getting beyond my knowledge here but from the error message, it seems like the answer is simply that: type('MyChild', (MyParent[int],), {}) ...is just the wrong way to make a new `type` when utilizing type

[issue33188] dataclass MRO entry resolution for type variable metaclasses: TypeError

2018-03-30 Thread Eric V. Smith
Eric V. Smith added the comment: You can also cause this same error without dataclasses: from typing import TypeVar, Generic from types import new_class MyTypeVar = TypeVar("MyTypeVar") MyParent = new_class("MyParent", (Generic[MyTypeVar],), {}) c = type('MyChild',

[issue33186] Memory corruption with urllib.parse

2018-03-30 Thread Ivan Zakharyaschev
Ivan Zakharyaschev added the comment: > a list contains elements that have never been appended Why do we think that it's true? 1. The described result can be valid if there are "doubly quoted" strings in the input list. 2. Also, there could be a bug in unquote() which

[issue33069] Maintainer information discarded when writing PKG-INFO

2018-03-30 Thread Éric Araujo
Éric Araujo added the comment: +1 to have a warning from distutils for cases not handled by older Metadata PEP. -- ___ Python tracker

[issue33152] Use list comprehension in timeit module instead of loop with append

2018-03-30 Thread Éric Araujo
Change by Éric Araujo : -- components: +Library (Lib) -Distutils resolution: -> not a bug stage: patch review -> resolved status: open -> closed type: behavior -> ___ Python tracker

[issue33180] Flag for unusable sys.executable

2018-03-30 Thread Jakub Wilk
Change by Jakub Wilk : -- nosy: +jwilk ___ Python tracker ___ ___ Python-bugs-list mailing

[issue33181] SimpleHTTPRequestHandler shouldn't redirect to directories with code 301

2018-03-30 Thread Matt Eaton
Matt Eaton added the comment: I agree with you in regards to the statement, "Apache's redirect can be turned off, whereas this can't." That is why my first thought would be to try and control this response to the client a bit better by providing a variable max-age.

[issue33188] dataclass MRO entry resolution for type variable metaclasses: TypeError

2018-03-30 Thread Rick Teachey
Rick Teachey added the comment: Sorry: to be clear, the error only occurs when attempting to create the class using `make_dataclass`. -- ___ Python tracker

[issue33188] dataclass MRO entry resolution for type variable metaclasses: TypeError

2018-03-30 Thread Rick Teachey
New submission from Rick Teachey : I'm getting the following error at when attempting to create a new `dataclass` with any base class that is supplied a type variable: TypeError: type() doesn't support MRO entry resolution; use types.new_class() In principle, it seems

[issue33181] SimpleHTTPRequestHandler shouldn't redirect to directories with code 301

2018-03-30 Thread Oliver Urs Lenz
Oliver Urs Lenz added the comment: Yes, but Apache's redirect can be turned off, whereas this can't, so it seems unnecessarily limiting to force this on users. Note that most of the motivation given by Apache doesn't apply here: with my proposed simplification, both

[issue33181] SimpleHTTPRequestHandler shouldn't redirect to directories with code 301

2018-03-30 Thread Matt Eaton
Matt Eaton added the comment: It looks like the 301 redirect is in place to emulate the behavior that Apache provides when it runs into a trailing slash. This is observed when this condition is met: parts = urllib.parse.urlsplit(self.path) if not

[issue33176] Allow memoryview.cast(readonly=...)

2018-03-30 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I have created an initial implementation in PR 6314. -- nosy: +pablogsal ___ Python tracker

[issue33176] Allow memoryview.cast(readonly=...)

2018-03-30 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- keywords: +patch pull_requests: +6030 stage: -> patch review ___ Python tracker ___

[issue29595] Expose max_queue_size in ThreadPoolExecutor

2018-03-30 Thread Stephen ONeal
Stephen ONeal added the comment: My project we're going into the underlying _work_queue and blocking adding more elements based on unfinished_tasks to accomplish this, bubbling this up to the API would be a welcome addition. -- nosy:

[issue33181] SimpleHTTPRequestHandler shouldn't redirect to directories with code 301

2018-03-30 Thread Oliver Urs Lenz
Oliver Urs Lenz added the comment: In fact, since we use os.path.join, we could remove that condition altogether: if os.path.isdir(path): for index in "index.html", "index.htm": index = os.path.join(path, index) if os.path.exists(index):

[issue33181] SimpleHTTPRequestHandler shouldn't redirect to directories with code 301

2018-03-30 Thread Oliver Urs Lenz
Oliver Urs Lenz added the comment: That would definitely take the sting out of that permanent redirect. But I am still wondering why we redirect at all. Why not leave redirects to the user and do: if os.path.isdir(path): if not path.endswith('/'): path

[issue33185] Python 3.7.0b3 fails in pydoc where b2 did not.

2018-03-30 Thread Ned Deily
Change by Ned Deily : -- nosy: +ned.deily priority: normal -> critical ___ Python tracker ___

[issue33185] Python 3.7.0b3 fails in pydoc where b2 did not.

2018-03-30 Thread Geoffrey Spear
Geoffrey Spear added the comment: This behavior seems to have been introduced in commit ee3784594b33c72c3fdca6a71892d22f14045ab6 -- nosy: +geoffreyspear, ncoghlan ___ Python tracker

[issue33186] Memory corruption with urllib.parse

2018-03-30 Thread Ivan Zakharyaschev
Ivan Zakharyaschev added the comment: The bad results are also reproducible with: # dpkg -l python3.2 Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err:

[issue20928] xml.etree.ElementInclude does not include nested xincludes

2018-03-30 Thread Stefan Behnel
Stefan Behnel added the comment: PR is complete now, ready for merging. -- ___ Python tracker ___

[issue20928] xml.etree.ElementInclude does not include nested xincludes

2018-03-30 Thread Stefan Behnel
Stefan Behnel added the comment: There seems to be no documentation currently for ElementInclude. Would be nice if someone who's interested in this feature could take the time to write something up. I created a documentation ticket as issue #33187. --

[issue33186] Memory corruption with urllib.parse

2018-03-30 Thread Ivan Zakharyaschev
Ivan Zakharyaschev added the comment: I've tested this on a e2k machine (e2k is a VLIW/EPIC architecture, similar to ia64), where python3 3.5 has been compiled with a completely different proprietary compiler, and got the same bad result. python3-3.5.1-alt7.3 (This has

[issue33187] Document ElementInclude (XInclude) support in ElementTree

2018-03-30 Thread Stefan Behnel
New submission from Stefan Behnel : The ElementInclude module in ElementTree seems undocumented. I couldn't find any documentation in the stdlib docs. Pretty much the only source that I could find is here: http://effbot.org/zone/element-xinclude.htm I noticed it while

[issue33186] Memory corruption with urllib.parse

2018-03-30 Thread Ivan Zakharyaschev
Change by Ivan Zakharyaschev : -- nosy: +imz ___ Python tracker ___ ___ Python-bugs-list

[issue33185] Python 3.7.0b3 fails in pydoc where b2 did not.

2018-03-30 Thread Ned Batchelder
Ned Batchelder added the comment: Oh, sorry, I forgot that import attempts aren't shown until -vv -- ___ Python tracker ___

[issue33185] Python 3.7.0b3 fails in pydoc where b2 did not.

2018-03-30 Thread Ned Batchelder
Ned Batchelder added the comment: Turns out it's even simpler: $ pydoc itertools No module named 'ast' # !!! -- ___ Python tracker

[issue33186] Memory corruption with urllib.parse

2018-03-30 Thread ale...@altlinux.org
New submission from ale...@altlinux.org : There is a strange behavior while processing data in a "for" loop with urllib.parse.unquote() - looks like memory corruption - a list contains elements that have never been appended. I'll explain the testcase. I spotted the

[issue33186] Memory corruption with urllib.parse

2018-03-30 Thread ale...@altlinux.org
Change by ale...@altlinux.org : Added file: https://bugs.python.org/file47507/data.txt.gz ___ Python tracker ___

[issue33181] SimpleHTTPRequestHandler shouldn't redirect to directories with code 301

2018-03-30 Thread Matt Eaton
Matt Eaton added the comment: Oliver, A possible option that would work for both the client side caching and the server would be to pass back a Cache-Control header with a max-age attached when the 301 is returned. I am thinking something like this: if

[issue33185] Python 3.7.0b3 fails in pydoc where b2 did not.

2018-03-30 Thread Ned Batchelder
New submission from Ned Batchelder : "pydoc coverage" worked with 3.7b2, but fails with a surprising ModuleNotFoundError for configparser with b3. The configparser is importable in the Python interpreter. I tried with -v to what imports were attempted, and

[issue33169] importlib.invalidate_caches() doesn't clear all caches

2018-03-30 Thread Guido van Rossum
Guido van Rossum added the comment: SGTM. On Fri, Mar 30, 2018, 06:41 Ned Deily wrote: > > Ned Deily added the comment: > > The current behavior is causing problems for at least some use cases so it > does seems to be closer to a

[issue33169] importlib.invalidate_caches() doesn't clear all caches

2018-03-30 Thread Ned Deily
Ned Deily added the comment: The current behavior is causing problems for at least some use cases so it does seems to be closer to a bug than a feature. If there is agreement that it is desirable to make the change, I think it's better to do it now in 3.7 than later.

[issue32563] -Werror=declaration-after-statement expat build failure on Python 3.5

2018-03-30 Thread Nick Coghlan
Nick Coghlan added the comment: Tidying up old git branches, and I noticed this was still open even though Larry had long ago merged the PR. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.5

[issue18814] Add utilities to "clean" surrogate code points from strings

2018-03-30 Thread Nick Coghlan
Nick Coghlan added the comment: With PEPs 538 and 540 implemented for 3.7, my thinking on this has evolved a bit. A recent discussion on python-ideas [1] also introduced me to the third party library, "ftfy", which offers a wide range of tools for cleaning up improperly

[issue25433] whitespace in strip()/lstrip()/rstrip()

2018-03-30 Thread Dimitri Papadopoulos Orfanos
Dimitri Papadopoulos Orfanos added the comment: I agree on avoiding a link to str.isspace() and defining "whitespace" instead. However please note there are many de facto definitions of "whitespace". All of them must be documented - or at least the conceptual

[issue33182] Python 3.7.0b3 fails to build with clang 6.0

2018-03-30 Thread Nick Coghlan
Nick Coghlan added the comment: Thanks for the bug report - the 3.7 branch should be buildable again now. My assumption would be that Travis are still running clang 5, since 6 was only released very recently. -- resolution: -> fixed stage: patch review ->

[issue33182] Python 3.7.0b3 fails to build with clang 6.0

2018-03-30 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset 2961717986201d639b60de51e5f2e9aa2573856c by Nick Coghlan (Miss Islington (bot)) in branch '3.7': bpo-33182: Fix pointer types in _testembed (GH-6310) (GH-6311)