[issue29989] subprocess.Popen does not handle file-like objects without file descriptors

2017-04-09 Thread Martin Panter
Martin Panter added the comment: The current exception seems to give a reasonable hint: >>> subprocess.Popen((executable,), stdout=BytesIO()) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.5/subprocess.py", line 914, in __init__

[issue29030] argparse: choices override metavar

2017-04-09 Thread Martin Panter
Martin Panter added the comment: I think the documentation should be fixed to say choices overrides dest, and the implementation should be left alone. Even if the documentation is not a “formal module reference”, it should not be wrong or misleading. Also, Issue 14039 is related, about

[issue14039] Add "metavar" argument to add_subparsers() in argparse

2017-04-09 Thread Martin Panter
Martin Panter added the comment: Thanks to Issue 11807, the documentation now lists “metavar”. (However, it looks like a positional argument, rather than keyword-only, and its use seems to be discouraged, but those issues are not specific to “metavar”.) Some points specific to “metavar

[issue23674] super() documentation isn't very clear

2017-04-08 Thread Martin Panter
Martin Panter added the comment: The magical no-argument call could also be clarified: 8. Define in the main text what happens when you omit the first argument (the subclass) to “super”. At the moment, I think the reader could infer that it is the method’s class, but this is only hinted

[issue29944] Argumentless super() fails in classes constructed with type()

2017-04-08 Thread Martin Panter
Martin Panter added the comment: In Issue 23674, I posted a patch that changes to consistent parameter names (subclass, self). The exception message would avoid “type”, becoming super(subclass, self): self must be an instance or subtype of subclass -- nosy: +martin.panter

[issue30000] Inconsistency in the zlib module

2017-04-07 Thread Martin Panter
Martin Panter added the comment: I don’t have a strong opinion on adding the missing parameters to the one-shot “compress” function, though it does seem beneficial to have a consistent set of parameters supported across the relevant APIs

[issue30017] zlib.error: Error -2 while flushing: inconsistent stream state

2017-04-07 Thread Martin Panter
Martin Panter added the comment: It looks like the zip entry writer object may not expect its “close” method to be called multiple times. Other file objects tend to allow this with no ill effect. Adding Serhiy and Thomas who implemented the writer object in Issue 26039. The first time

[issue29989] subprocess.Popen does not handle file-like objects without file descriptors

2017-04-07 Thread Martin Panter
Martin Panter added the comment: Raphael: Can you point to the implementation code that handles file objects without a file descriptor (or give a demonstration of it)? I suspect there is no such support and you are mistaken. Perhaps we can instead clarify in the “subprocess” documentation

[issue30012] gzip.open(filename, "rt") fails on Python 2.7.11 on win32, invalid mode rtb

2017-04-07 Thread Martin Panter
Martin Panter added the comment: I agree this is not a bug. It is just one of the unfortunate compatibility breaks between Py 2 and 3. Mode="rt" is not one of the values that are supported according to the documentation; adding support would be a new feature. I understand the

[issue29987] inspect.isgeneratorfunction not working with partial functions

2017-04-05 Thread Martin Panter
Martin Panter added the comment: Not in general. I think you would have to make special cases for partial functions, __wrapped__, and whatever else there is, and combinations of these. It would be very hard to determine the correct result for test2 in test2 = lambda: test(a=10) # test2

[issue29991] http client marks valid multipart headers with defects.

2017-04-05 Thread Martin Panter
Martin Panter added the comment: Looks like a duplicate of Issue 29353, which has a more complete patch proposed. However, see my comment about a problem with using heartersonly=True. My policy-flag.v2.patch for Issue 24363 may help (the details have faded from my mind, but I suspect

[issue29987] inspect.isgeneratorfunction not working with partial functions

2017-04-04 Thread Martin Panter
Martin Panter added the comment: Doesn't seem like a bug to me. Even if there was special support for "partial" objects, that won't help with other ways of producing the same sort of thing. test2 = functools.partial(test, a=10) @functools.wraps(test) def test2(): return test(a

[issue29975] Issue in extending documentation

2017-04-03 Thread Martin Panter
Martin Panter added the comment: FWIW I don’t see any error in the first quote. “Should X happen, Y happens” is valid English. Though I admit this kind of grammar is not used that often. If it is too hard to understand, it should be okay to change it to “If it becomes a danging pointer

[issue29968] Document that no characters are allowed to proceed \ in explicit line joining

2017-04-03 Thread Martin Panter
Martin Panter added the comment: I think he means make something like the following legal, where dots (.) indicate space characters: a.=.\. b At the moment it is a SyntaxError: >>> a = \ File "", line 1 a = \ ^ SyntaxError: unexpected character afte

[issue23404] 'make touch' does not work with git clones of the source repository

2017-04-03 Thread Martin Panter
Martin Panter added the comment: I had mainly been using my boot-flag.patch with BSD Make (bmake) rather than Gnu Make. It seems I was relying on a bug in BSD Make that merges escaped newlines in command lines, despite Posix and Gnu Make. Anyway, Chi’s fix seems appropriate. I am posting

[issue23404] 'make touch' does not work with git clones of the source repository

2017-04-03 Thread Martin Panter
Changes by Martin Panter <vadmium...@gmail.com>: Added file: http://bugs.python.org/file46773/boot-flag.py2.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue29967] "AMD64 FreeBSD 9.x 3.x" tries to rebuild Include/opcode.h, timestamp issue

2017-04-03 Thread Martin Panter
Martin Panter added the comment: I think this is the same underlying problem as Issue 23404. Either we get “make touch” working without Mercurial, or we use some other mechanism to either disable regeneration by default (my preference), or disable regeneration by explicit request (possible

[issue29926] time.sleep ignores _thread.interrupt_main()

2017-04-02 Thread Martin Panter
Martin Panter added the comment: BTW pthread_kill was only added to Python 3.3, so is not available for Python 2. I’m not sure what the best fix for 2.7 would be. Maybe it’s not worth it, or maybe you can find another way to a signal to the user process or its main thread without interfering

[issue29926] time.sleep ignores _thread.interrupt_main()

2017-04-02 Thread Martin Panter
Martin Panter added the comment: Hi Terry, this patch is what I imagined a fix would look like for Linux. I am not familiar with Idle (internally nor externally), so there may be improvements you can make. It works as I expected for normal blocking functions and a tight “for” loop

[issue29964] %z directive has no effect on the output of time.strptime

2017-04-02 Thread Martin Panter
Martin Panter added the comment: We could change this to a documentation issue if you have any suggestions to make the documentation clearer. I understand the “time” module is mainly a wrapper or emulator of the OS’s own strptime, mktime, etc functions, which explains some of these quirks

[issue29964] %z directive has no effect on the output of time.strptime

2017-04-02 Thread Martin Panter
Martin Panter added the comment: As far as I can see, the documentation only claims that “mktime” converts local time. If you saw a suggestion that it supports arbitrary time zones, please point it out. -- ___ Python tracker <rep...@bugs.python.

[issue29964] %z directive has no effect on the output of time.strptime

2017-04-02 Thread Martin Panter
Martin Panter added the comment: Are you sure? It works for me: >>> strptime("+0200", "%z").tm_gmtoff 7200 >>> strptime("+", "%z").tm_gmtoff 0 The "struct_time" class is documented as a named tuple, but the time zone o

[issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself?

2017-04-01 Thread Martin Panter
Martin Panter added the comment: By “factory instance”, I presume you just mean a function (or class or method) that returns an appropriate object when called. (I think these are normally called “factory functions”. Instances are objects, the things that class constructors and factories

[issue29751] PyLong_FromString documentation wrong on numbers with leading zero and base=0

2017-04-01 Thread Martin Panter
Martin Panter added the comment: Underscores are only applicable to 3.6+, but the original concern about leading zeros applies to 3.5. On Git Hub I suggested dropping the details and just referring to the Lexical Analysis section <https://docs.python.org/3.5/reference/lexical_analysis.h

[issue26947] Hashable documentation improvement needed

2017-04-01 Thread Martin Panter
Martin Panter added the comment: The pull request currently suggests “All of Python’s immutable built-in objects are hashable; mutable containers (such as lists or dictionaries) are not.” This seems better wording than the original. FWIW, I would have tried “Python’s built-in immutable

[issue27867] various issues due to misuse of PySlice_GetIndicesEx

2017-04-01 Thread Martin Panter
Changes by Martin Panter <vadmium...@gmail.com>: -- nosy: -martin.panter ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27867> ___

[issue28556] typing.py upgrades

2017-04-01 Thread Martin Panter
Changes by Martin Panter <vadmium...@gmail.com>: -- nosy: -martin.panter ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28556> ___

[issue27100] Attempting to use class with both __enter__ & __exit__ undefined yields __exit__ attribute error

2017-04-01 Thread Martin Panter
Changes by Martin Panter <vadmium...@gmail.com>: -- nosy: -martin.panter ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27100> ___

[issue29951] PyArg_ParseTupleAndKeywords exception messages containing "function"

2017-03-31 Thread Martin Panter
Martin Panter added the comment: In this test, “keyword arguments” is definitely wrong: >>> f(**{1:2}) -TypeError: f() keywords must be strings +TypeError: f() keyword arguments must be strings To me, a keyword argument is a _value_ passed in using the f(name=. . .) syntax, and th

[issue29928] Add f-strings to Glossary

2017-03-28 Thread Martin Panter
Martin Panter added the comment: When I wrote the documentation <https://docs.python.org/dev/reference/lexical_analysis.html#f-strings>, I think I tried to avoid “f-string”, being jargon, and used more formal terminology from PEP 498 instead. But I agree they more than regular li

[issue29251] Class __dict__ is only a mapping proxy

2017-03-27 Thread Martin Panter
Martin Panter added the comment: I don’t know if it is an implementation detail or not. Maybe it is the documentation itself which defines that. Anyway, I think your wording would have been fine for my original problem. I wonder if we should clarify that only reading the mapping is supported

[issue29573] NamedTemporaryFile with delete=True should not fail if file already deleted

2017-03-27 Thread Martin Panter
Martin Panter added the comment: See also Issue 27425, about making the deletion step more flexible after the file has been created, which might help here. I’m not sure about security problems, but IMO failure to remove a temporary file (because it is already gone, or some other reason

[issue4928] tempfile.NamedTemporaryFile: automatic cleanup by OS

2017-03-27 Thread Martin Panter
Changes by Martin Panter <vadmium...@gmail.com>: -- title: Problem with tempfile.NamedTemporaryFile -> tempfile.NamedTemporaryFile: automatic cleanup by OS ___ Python tracker <rep...@bugs.python.org> <http://bugs.py

[issue21071] struct.Struct.format is bytes, but should be str

2017-03-27 Thread Martin Panter
Martin Panter added the comment: Hi Victor, I’m not sure about changing the data type. As Python 3 grows older, there is potentially more code being written that you break by fixing a bug like this. It is incompatible if you used to write >>> print(struct.Struct('hi').format.decode

[issue18022] Inconsistency between quopri.decodestring() and email.quoprimime.decode()

2017-03-26 Thread Martin Panter
Martin Panter added the comment: The double equals "==" case for the “quopri” implementation in Python is now consistent with the others thanks to the fix in Issue 23681 (see also Issue 21511). According to Issue 20121, the quopri (Python) implementation only supports LF (\n)

[issue23901] Force console stdout to use UTF8 on Windows

2017-03-26 Thread Martin Panter
Martin Panter added the comment: This seems to be discussing the same sort of stuff that ended up with the Issue 1602 implementation. -- nosy: +martin.panter resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> windows console doesn't pr

[issue29907] Unicode encoding failure

2017-03-26 Thread Martin Panter
Martin Panter added the comment: I presume you are trying to print to the normal Windows console. I understand the console was not well supported until Python 3.6 (see Issue 1602). Have you tried that version? I’ll leave this open for someone more experienced to confirm, but I suspect what

[issue29903] struct.Struct Addition

2017-03-25 Thread Martin Panter
Martin Panter added the comment: For the native alignment case (prefix code @), perhaps you can already use the “ctypes” module, which supports structures with more complicated embedded fields. For the the unaligned modes (prefixes =, <, > and !), I am a little sympathetic. In the p

[issue21071] struct.Struct.format is bytes, but should be str

2017-03-25 Thread Martin Panter
Martin Panter added the comment: A backwards-compatible way forward would be to preserve (and document) the “format” attribute as a byte string, and add a new attribute which is definitely a text string. Not sure of a good name; perhaps “Struct.text_format” or “format_str” is a start

[issue27446] struct: allow per-item byte order

2017-03-25 Thread Martin Panter
Martin Panter added the comment: This seems too obscure to be worth supporting in the built-in library IMO. The use case loses one line of code but gains a more complicated structure format string. -- nosy: +martin.panter ___ Python tracker <

[issue29891] urllib.request.Request accepts but doesn't check bytes headers

2017-03-24 Thread Martin Panter
Martin Panter added the comment: If you enable BytesWarning (python -b) you do get an error: >>> urlopen(req, data) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.5/urllib/request.py", line 162, in urlopen return opener.op

[issue29854] Segfault when readline history is more then 2 * history size

2017-03-23 Thread Martin Panter
Martin Panter added the comment: Gnu Readline comes includes its own documentation (e.g. /usr/share/info/history.info.gz on my computer). It is also at <https://cnswww.cns.cwru.edu/php/chet/readline/history.html>. Perhaps the history_base value is relevant; see some of the comments st

[issue20631] python readline module crashing on NULL access

2017-03-23 Thread Martin Panter
Changes by Martin Panter <vadmium...@gmail.com>: -- superseder: -> Make libedit support more generic; port readline / libedit to FreeBSD ___ Python tracker <rep...@bugs.python.org> <http://bugs.pyt

[issue20631] python readline module crashing on NULL access

2017-03-23 Thread Martin Panter
Changes by Martin Panter <vadmium...@gmail.com>: -- resolution: -> duplicate stage: patch review -> resolved status: open -> closed ___ Python tracker <rep...@bugs.python.org> <http://bu

[issue20631] python readline module crashing on NULL access

2017-03-23 Thread Martin Panter
Martin Panter added the comment: Closing in favour of Issue 13501, since the report was apparently about using a non-Apple Editline rather than Gnu Readline. However see also Issue 29854, where the same symptom is seen with Gnu Readline, and it will probably get the same fix

[issue29885] Allow GMT timezones to be used in datetime.

2017-03-23 Thread Martin Panter
Martin Panter added the comment: Does the “astimezone” method work for you? <https://docs.python.org/3.5/library/datetime.html#datetime.datetime.astimezone> >>> from datetime import * >>> aedt = timezone(+timedelta(hours=11)) >>> local = datetime.now(aedt) &g

[issue29700] readline memory corruption when sys.stdin fd >= FD_SETSIZE for select()

2017-03-18 Thread Martin Panter
Martin Panter added the comment: Marien’s pull request is for 2.7 and adds two new paths when raw_input is called: * On Linux (actually glibc), use “poll” rather than “select” * In other cases, if sys.stdin cannot be used with “select”, raise ValueError Marien admits that even in the best

[issue29831] os.path.exists seems can not recgnize "~"

2017-03-16 Thread Martin Panter
Martin Panter added the comment: I agree with Josh. This is how it is supposed to work. os.system calls the shell (e.g. Bash) rather than running the "ls" program directly. Unix shells translate "~" to the home directory (as well as translating a lot of other stuff, e.g

[issue29823] mimetypes guesses XSL mimetype when passed an XML file

2017-03-15 Thread Martin Panter
Martin Panter added the comment: Perhaps a duplicate of Issue 1043134? -- nosy: +martin.panter superseder: -> Add preferred extensions for MIME types versions: -Python 3.3, Python 3.4 ___ Python tracker <rep...@bugs.python.org&

[issue29815] Fail at divide a negative integer number for a positive integer number

2017-03-15 Thread Martin Panter
Martin Panter added the comment: If you ignore the c[0] argument, the rest looks fine to me. See the documentation at <https://docs.python.org/2/reference/expressions.html#binary-arithmetic-operations> and <https://docs.python.org/2/library/stdtypes.html#numeric-types-int-float-lon

[issue29809] TypeError in traceback.print_exc - unicode does not have the buffer interface

2017-03-14 Thread Martin Panter
Martin Panter added the comment: FWIW I tend to use cStringIO.StringIO as a Python 2 replacement for io.StringIO to avoid this str vs unicode problem. But that only accepts ASCII, so won't help you if you really need the UTF-8 encoding step. -- nosy: +martin.panter

[issue29387] Tabs vs spaces FAQ out of date

2017-03-14 Thread Martin Panter
Martin Panter added the comment: The “tabnanny” script was removed from Tools/scripts/ in 2.0: <https://github.com/python/cpython/commit/a02c898>. So the 2.7 FAQ also has the wrong location. -- ___ Python tracker <rep...@bugs.python.o

[issue29807] ArgParse page in library reference rewrite

2017-03-14 Thread Martin Panter
Martin Panter added the comment: Also see Issue 26602 and Issue 11176, each with patches. Perhaps you could help review and combine them. -- nosy: +martin.panter ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue26602] argparse doc introduction is inappropriately targeted

2017-03-14 Thread Martin Panter
Martin Panter added the comment: The patch looks unfinished. I left some narrow nit-picky review comments, but I haven’t really thought about the problem from a high level. -- nosy: +martin.panter stage: -> patch review versions: +Python 2.7, Python 3.5, Python 3.6, Python

[issue12284] argparse.ArgumentParser: usage example option

2017-03-13 Thread Martin Panter
Changes by Martin Panter <vadmium...@gmail.com>: -- resolution: -> works for me stage: needs patch -> resolved status: open -> closed ___ Python tracker <rep...@bugs.python.org> <http://bu

[issue29715] Arparse improperly handles "-_"

2017-03-13 Thread Martin Panter
Martin Panter added the comment: Max, I’m not sure if you saw the double-dash (--) workaround. IMO that is the “correct” way to do this for Unix command lines, and for the current version of “argparse”. But I guess that may be too inconvenient for your Morse Code case. Perhaps you can write

[issue29799] Add tests for header API of 'urllib.request.Request' class

2017-03-12 Thread Martin Panter
New submission from Martin Panter: I think the RequestTests class really belongs in test_urllib2, which already has a RequestHdrsTests class testing these APIs. BTW test_urllib.py (no 2) is mainly for testing the stuff that came from Python 2’s “urllib” module, but the Request class

[issue8450] httplib: false BadStatusLine() raised

2017-03-12 Thread Martin Panter
Martin Panter added the comment: I don’t think so. It is best to avoid a new exception type (even a subclass) in a bug fix. That would break code which checks “type(exc) == BadStatusLine” or similar. Specific exception messages are supposed to be implementation details, and the current

[issue7427] BadStatusLine is hell to debug

2017-03-12 Thread Martin Panter
Martin Panter added the comment: This change was only made in 2.7a4, not 2.6 -- versions: +Python 2.7 -Python 2.6 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/

[issue15082] [httplib] httplib.BadStatusLine on any HTTPS connection in certain unknown cases.

2017-03-12 Thread Martin Panter
Changes by Martin Panter <vadmium...@gmail.com>: -- resolution: -> fixed stage: -> test needed status: open -> pending ___ Python tracker <rep...@bugs.python.org> <http://bu

[issue21109] tarfile: Traversal attack vulnerability

2017-03-10 Thread Martin Panter
Martin Panter added the comment: Issue 29788 proposes an option to disable the vulnerability in the CLI -- dependencies: +tarfile: Add absolute_path option to tarfile, disabled by default ___ Python tracker <rep...@bugs.python.org>

[issue29788] tarfile: Add absolute_path option to tarfile, disabled by default

2017-03-10 Thread Martin Panter
Martin Panter added the comment: The CLI was added in Issue 13477. I didn’t see any discussion of traversal attacks there, so maybe it was overlooked. Perhaps there should also be a warning, like with the Tarfile.extract and “extractall” methods. However I did see one of the goals was to keep

[issue29746] Update marshal docs to Python 3

2017-03-10 Thread Martin Panter
Martin Panter added the comment: One other difference between 2 and 3 is that Python 3 has two kinds of “binary” files. In most cases, a subset of the BufferedIOBase API is assumed, which does “exact” reads and writes. I understand this is how Python 2 files worked. But there is also

[issue29783] Modify codecs.open() to use the io module instead of codecs.StreamReaderWriter()

2017-03-10 Thread Martin Panter
Martin Panter added the comment: I agree that it would be better to hold off deprecating codecs.open until Python 2 is no longer supported. This deprecation also discussed in Issue 8796. There is more to compatability than the missing attributes. The most obvious one to me

[issue24755] asyncio.wrap_future undocumented

2017-03-10 Thread Martin Panter
Changes by Martin Panter <vadmium...@gmail.com>: -- components: +asyncio stage: -> patch review versions: +Python 3.6, Python 3.7 ___ Python tracker <rep...@bugs.python.org> <http://bugs.pyt

[issue29786] asyncio.wrap_future() is not documented

2017-03-10 Thread Martin Panter
Changes by Martin Panter <vadmium...@gmail.com>: -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> asyncio.wrap_future undocumented ___ Python tracker <rep...@bugs.python.org> <http:/

[issue29751] PyLong_FromString fails on decimals with leading zero and base=0

2017-03-07 Thread Martin Panter
Martin Panter added the comment: My guess is this is supposed to emulate (or is actually the implementation of) the "int" constructor and the Python syntax. In these cases, numbers with leading zeros are disallowed. This was to help with Python 2 porting, where a leading zero

[issue29741] BytesIO methods don't accept integer types, while StringIO counterparts do

2017-03-06 Thread Martin Panter
Martin Panter added the comment: What is the use case? Unless changing the behaviour would be useful, I think the simplest solution would be to document that the methods should only be given instances of “int”, so that it is clear that other kinds of numbers are unsupported. -- nosy

[issue29700] readline memory corruption when sys.stdin fd >= FD_SETSIZE for select()

2017-03-06 Thread Martin Panter
Martin Panter added the comment: “Input9)” is probably a typo for “input()”. In Python 2, sys.stdin etc are by default wrappers around ’s “stdin” etc, and can easily be wrappers around other FILE objects, so the PyOS_Readline API and Python’s “readline” module pass these objects directly

[issue29715] Arparse improperly handles "-_"

2017-03-03 Thread Martin Panter
Martin Panter added the comment: This is actually expected behaviour of the “argparse”, as well as general Unix CLI programs. See the documentation <https://docs.python.org/3.6/library/argparse.html#arguments-containing>. The general workaround is to use a double-dash sep

[issue29706] IDLE needs syntax highlighting for async and await

2017-03-03 Thread Martin Panter
Martin Panter added the comment: See also Issue 26264 about the “keyword” module -- nosy: +martin.panter ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue29700] readline memory corruption when sys.stdin fd >= FD_SETSIZE for select()

2017-03-02 Thread Martin Panter
Martin Panter added the comment: Be careful, some OSes have limited support for “poll”, “kqueue”, etc with terminals, and I ended up using “select” in the test suite: https://bugs.python.org/issue26870#msg265604 https://github.com/python/cpython/commit/79f561d126d09d6d7ea1457a2a6ef267d93e6448

[issue29681] getopt fails to handle option with missing value in middle of list

2017-02-28 Thread Martin Panter
Martin Panter added the comment: It's not clear what you expected the behaviour to be. A function cannot both raise an exception and return a value. In any case, you are correct in saying "the next option, '-d', is taken as the argument." I do not think this is a bug.

[issue26389] Expand traceback module API to accept just an exception as an argument

2017-02-26 Thread Martin Panter
Martin Panter added the comment: Matthias’s proposal adds support for a new keyword-only “exc” argument: print_exception(exc=exception_instance) I still think it is worth supporting a single positional argument as well: print_exception(exception_instance) Another point is that it may

[issue29610] ssl do_handshake fails on https-proxy (aka. https over https-proxy)

2017-02-20 Thread Martin Panter
Martin Panter added the comment: It looks like you are trying to tunnel one SSL or TLS connection through another SSL/TLS connection (instead of through a plain OS socket). There is already a bug recently opened about this: Issue 29394. Basically, the SSL module doesn’t support

[issue29394] Cannot tunnel TLS connection through TLS connection

2017-02-20 Thread Martin Panter
Changes by Martin Panter <vadmium...@gmail.com>: -- stage: -> needs patch versions: +Python 2.7, Python 3.5, Python 3.7 ___ Python tracker <rep...@bugs.python.org> <http://bugs.pyt

[issue29593] Improve UnboundLocalError message for deleted names

2017-02-17 Thread Martin Panter
Martin Panter added the comment: Matthias’s proposal sounds reasonable to me. There is a minor disadvantage that it will exceed the width of an 80-character terminal: UnboundLocalError: local variable 'x' referenced before assignment, or got delet ed But I don’t think the wrapping is a big

[issue29587] Generator/coroutine 'throw' discards exc_info state, which is bad

2017-02-17 Thread Martin Panter
Martin Panter added the comment: The second example seems like the original complaint in Issue 25612. That spawned a separate bug related to the first situation, which was later closed: Issue 25683. -- nosy: +martin.panter type: -> behav

[issue29564] ResourceWarning tracking is attaching incorrect file:position to unclosed socket

2017-02-15 Thread Martin Panter
Martin Panter added the comment: The file position is often useful when the cleanup is deterministic. Example: def f1(): file1 = open("/dev/null") def f2(): file2 = open("/dev/null") del file2 # ResourceWarning f1() # ResourceWarning at function exit f2()

[issue29564] ResourceWarning tracking is attaching incorrect file:position to unclosed socket

2017-02-15 Thread Martin Panter
Martin Panter added the comment: You say that the line number is incorrect. What would you consider a correct line number to be? Let me try again to explain my theory about garbage collection and reference cycles. Perhaps you have two objects a and b, linked such that a.x = b and b.y

[issue29536] test_hashlib failure on Ubuntu 16.04

2017-02-15 Thread Martin Panter
Martin Panter added the comment: Looks like the tests should run if the data is already downloaded. First run needs -u urlfetch. My guess is your data is somehow corrupted. Check out your copy of the files in Lib/test/data/, compare them to e.g. <http://www.pythontest.net/hashlib/blake2b.

[issue29564] ResourceWarning tracking is attaching incorrect file:position to unclosed socket

2017-02-14 Thread Martin Panter
Martin Panter added the comment: Without more information about what the relevant code is and why you think the line number is wrong, my best guess is you may not realize how the ResourceWarning is emitted. It happens when the garbage collector runs and destroys the socket object, which

[issue29558] Provide run_until_complete inside loop

2017-02-14 Thread Martin Panter
Martin Panter added the comment: Sounds related to Issue 22239 -- nosy: +martin.panter ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue29552] Issue in Dictionary fromkeys

2017-02-14 Thread Martin Panter
Martin Panter added the comment: I suggest to close this as not a bug. -- resolution: -> not a bug ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.or

[issue29552] Issue in Dictionary fromkeys

2017-02-14 Thread Martin Panter
Martin Panter added the comment: This is similar to the problem of building a list by repeating one item: <https://docs.python.org/2.7/faq/programming.html#how-do-i-create-a-multidimensional-list>. With dict.fromkeys(), the resulting dictionary maps each specified key object to t

[issue27286] str object got multiple values for keyword argument

2017-02-10 Thread Martin Panter
Martin Panter added the comment: Diff showing what changed relative to the main 3.5 branch when merging in the 3.5.2 release: <https://hg.python.org/cpython/rev/31a2a278dc85:1f8938164809>. There are four news entries deleted from the 3.5.2rc1 section. Ideally they should have been

[issue29521] Minor warning messages when compiling documentation

2017-02-10 Thread Martin Panter
Changes by Martin Panter <vadmium...@gmail.com>: -- dependencies: +Tabs vs spaces FAQ out of date ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue29521] Minor warning messages when compiling documentation

2017-02-10 Thread Martin Panter
Martin Panter added the comment: Jim, regarding Doc/faq/windows.rst, this warning lead me to open Issue 29387. We already have discussed a patch for that, and I think it is ready to commit (when it gets to the top of my list, if nobody else beats me to it). Regarding Misc/NEWS, I think I

[issue29432] wait_for(gather(...)) logs weird error message

2017-02-08 Thread Martin Teichmann
Martin Teichmann added the comment: I added a solution to this problem. I just silence the bad error message by overwriting _GatheringFuture.__del__ to do nothing. This may have undesired side effects, though. -- ___ Python tracker <

[issue29479] httplib: could not skip "ACCEPT-ENCODING" header

2017-02-08 Thread Martin Panter
Martin Panter added the comment: Please explain what the wrong behaviour that you see is, and what you expect the right behaviour should be. That code is intended to either keep any user-supplied Accept-Encoding header field, or send “Accept-Encoding: identity” if the field is not supplied

[issue29478] email.policy.Compat32(max_line_length=None) not as documented

2017-02-08 Thread Martin Panter
New submission from Martin Panter: By default, the email package turns single-line header fields into multi-line ones to try and limit the length of each line. The documentation <https://docs.python.org/release/3.5.2/library/email.policy.html#email.policy.Policy.max_line_length>

[issue29457] strftime('%x') does not use my locale

2017-02-05 Thread Martin Panter
Martin Panter added the comment: >>> datetime.now().strftime("%x") '02/06/17' >>> from locale import setlocale, LC_TIME >>> setlocale(LC_TIME) 'C' >>> setlocale(LC_TIME, "en_US.utf8") 'e

[issue29457] strftime('%x') does not use my locale

2017-02-05 Thread Martin Panter
Martin Panter added the comment: Have you tried enabling the locale with locale.setlocale()? I believe Python only enables LC_CTYPE by default, so other locale aspects like LC_TIME won’t work until they are enabled. -- nosy: +martin.panter

[issue15533] subprocess.Popen(cwd) documentation: Posix vs Windows

2017-02-04 Thread Martin Panter
Changes by Martin Panter <vadmium...@gmail.com>: -- components: +Windows stage: test needed -> needs patch title: subprocess.Popen(cwd) documentation -> subprocess.Popen(cwd) documentation: Posix vs Windows ___ Python tracker <rep...@

[issue15451] PATH is not honored in subprocess.Popen in win32

2017-02-04 Thread Martin Panter
Martin Panter added the comment: Perhaps this is a duplicate of Issue 8557 -- nosy: +martin.panter ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue29387] Tabs vs spaces FAQ out of date

2017-02-04 Thread Martin Panter
Martin Panter added the comment: Marco: I agree “Python reports an error” would have been simpler. That is what I meant to say. Anyway, perhaps we should put Python raises :exc:`IndentationError` if mixed tabs and spaces are causing problems in leading whitespace. In general, the exception

[issue20927] Different behaviour on Posix and Windows when using subprocess.Popen(..., cwd=path)

2017-02-04 Thread Martin Panter
Changes by Martin Panter <vadmium...@gmail.com>: -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> subprocess.Popen(cwd) documentation ___ Python tracker <rep...@bugs.python.org>

[issue13196] subprocess: undocumented if shell=True is necessary to find executable in Windows PATH

2017-02-03 Thread Martin Panter
Martin Panter added the comment: It is hard to make sense of this without decoding your URLs, downloading the repository and finding the relevant commit. Anyway, what you have posted sounds like a duplicate of Issue 8557. -- nosy: +martin.panter resolution: -> duplicate st

[issue18069] Subprocess searches special directories before PATH on Windows

2017-02-03 Thread Martin Panter
Changes by Martin Panter <vadmium...@gmail.com>: -- title: Subprocess picks the wrong executable on Windows -> Subprocess searches special directories before PATH on Windows ___ Python tracker <rep...@bugs.python.org> <http

[issue27867] various issues due to misuse of PySlice_GetIndicesEx

2017-02-03 Thread Martin Panter
Martin Panter added the comment: Not a big deal, but the change produces compiler warnings with GCC 6.1.1: /home/proj/python/cpython/Objects/bytesobject.c: In function ‘bytes_subscript’: /home/proj/python/cpython/Objects/bytesobject.c:1701:13: warning: ‘slicelength’ may be used uninitialized

<    2   3   4   5   6   7   8   9   10   11   >