Cyril Martin <mcool...@gmail.com> added the comment:
Hi Stéphane,
I ask you a question about the change you suggest.
The PR has not progress. Do you wait something from me?
--
___
Python tracker <rep...@bugs.python.org>
<https://
Martin Panter <vadmium...@gmail.com> added the comment:
This looks like the same assertion failure as described in Issue 16360. Paul
pointed to a patch in Issue 11874, so that may also be relevant.
However I agree that embedding newlines in a metavar doesn’t make much sense.
What’s t
Martin Panter <vadmium...@gmail.com> added the comment:
Maybe already discussed in Issue 24795?
--
nosy: +martin.panter
superseder: -> Make event loops with statement context managers
___
Python tracker <rep...@bugs.python
New submission from Cyril Martin <mcool...@gmail.com>:
- LoggerAdapter processes only extra kwargs given during its __init__
So extra kwargs, given to Logger#log are ignored when we configure a
LoggerAdapter (same for: debug, info, warning etc).
- I expect extras are merged. More precis
Martin Panter <vadmium...@gmail.com> added the comment:
Your assumption about calling “file_actions_destroy” would be okay if the
posix_spawn_file_actions_t object was a simple object or structure. But I
imagine most implementations would allocate memory when you call one of the
“add” m
Martin Panter <vadmium...@gmail.com> added the comment:
TypeError if “posix_spawn_file_actions_init” fails doesn’t seem right. I
suggest OSError, MemoryError, or even plain Exception instead.
“File_actionsp” is set to point to a local variable “_file_actions”, but the
variable go
Martin Panter <vadmium...@gmail.com> added the comment:
Does the PySequence_Fast result need releasing if the following “for” loop
fails? There is a Py_DECREF only in the successful case, which seems
inconsistent.
Does Python still support non-UTF-8 locales and bytes filenames? I haven’
Martin Panter <vadmium...@gmail.com> added the comment:
Pablo’s code looked unfinished to me. As well as missing documentation, I
suspect there may be memory leaks and poor error handling.
The two calls above the “fail:” label look like dead code. The “parse_envlist”
result a
Martin Panter <vadmium...@gmail.com> added the comment:
According to the documentation, you can use the lower-level GzipFile
constructor’s “filename” argument:
>>> with open(output_path, 'wb') as f_out, \
... gzip.GzipFile(fileobj=f_out, mode='wb', filename=input
Martin Panter <vadmium...@gmail.com> added the comment:
See Issue 32337
--
nosy: +martin.panter
___
Python tracker <rep...@bugs.python.org>
<https://bugs.python
New submission from Martin Kolman <mkol...@redhat.com>:
We (the Anaconda OS intaller team) are in the process of switching to a new
version of a library (Pykickstart), which among other things switched from
using optparse to argparse. And during this endeavour we found that it's
appa
Martin Panter <vadmium...@gmail.com> added the comment:
Looks like a dupe of Issue 27321
--
nosy: +martin.panter
resolution: -> duplicate
superseder: -> Email parser creates a message object that can't be flattened
___
Python
Martin Panter <vadmium...@gmail.com> added the comment:
It may also be worth implementing BufferedIOBase and TextIOBase. (It seems
buffering=0 isn’t reliable, e.g. rollover with limited disk space, so it may
not be worth implementing RawIOBase.)
To implement BufferedIOBase,
Martin Panter <vadmium...@gmail.com> added the comment:
There is apparently some work done on this already in Issue 26175.
--
nosy: +martin.panter
resolution: -> duplicate
stage: -> resolved
status: open -> closed
superseder: -> Fully implement IOBase abstract on Sp
Change by Martin Panter <vadmium...@gmail.com>:
--
dependencies: +Add ability to query number of buffered bytes available on
buffered I/O
___
Python tracker <rep...@bugs.python.org>
<https://bugs.python
Martin Panter <vadmium...@gmail.com> added the comment:
BufferedIOBase is an abstract class and, despite the name, doesn’t necessitate
a buffer or cache. Adding methods and properties might break compatibility with
third-party implementations, or get ugly with optional methods and mu
Martin Panter <vadmium...@gmail.com> added the comment:
If I remember the implementation of “peek” right, it may do what you want. But
the documentation doesn’t guarantee much about its behaviour; see Issue 5811.
Anyway, I agree that a “getbuffn” method (or property) would be nice. (P
Martin Panter <vadmium...@gmail.com> added the comment:
This was supposed to be fixed in 3.6+ by Issue 31304. In general, 3.5 only gets
security fixes at this stage. I’m not sure if it is easy or worth back porting
this.
--
nosy: +martin.
Martin Panter <vadmium...@gmail.com> added the comment:
Looks like you want to use a "readinto" method to reduce data copying.
One problem is that it is not specified exactly what kind of object
"copyfileobj" supports reading from. The documentation only sa
Change by Martin Panter <vadmium...@gmail.com>:
--
superseder: HTTPServer can't deal with persistent connection properly ->
http.server and SimpleHTTPServer hang after a few requests
___
Python tracker <rep...@bugs.python
Martin Panter <vadmium...@gmail.com> added the comment:
Perhaps this can be treated as a duplicate of Issue 31639.
--
nosy: +martin.panter
___
Python tracker <rep...@bugs.python.org>
<https://bugs.python
Martin Panter <vadmium...@gmail.com> added the comment:
FWIW there was documentation in the README about the Setup files, removed in
Subversion r57681 (= Git revision 1c896e3). It looks like it still survives in
the 2.7 version.
--
nosy: +martin.
Martin Panter <vadmium...@gmail.com> added the comment:
Thanks, although the fact that “Content-Length: 0” doesn’t work kills my theory
about the proxy.
The “close_connection” flag is also a documented public API of Python:
<https://docs.python.org/3/library/http.se
Martin Panter <vadmium...@gmail.com> added the comment:
Sorry William, I forgot the client was waiting to read. But I don’t understand
why your Connection field (which comes after the status line) allows the Python
client to read the status line. Perhaps there is some malware s
Martin Panter <vadmium...@gmail.com> added the comment:
In the server, the send_header("Connection", "close") call sets the
“close_connection” flag. This shuts down the connection once “do_GET” returns.
Without the flag set, the server will wait and read ano
Martin Panter <vadmium...@gmail.com> added the comment:
I wrote an incremental base-64 decoder for the "codecs" module in Issue 27799,
which you could use. It just does some preprocessing using a regular expression
to pick four-character chunks before passing the data to a2b_
Martin Panter <vadmium...@gmail.com> added the comment:
FWIW a few years ago I wrote a patch for Issue 17546 that documents three
personalities of “locals”, including:
* At the module level, the dictionary returned is the global symbol table, also
returned by :func:`globals`.
-
Martin Panter <vadmium...@gmail.com> added the comment:
My guess is there is no message because in Python 3, errors are encoded
according to PYTHONIOENCODING. Perhaps it works as you expect if you bypass
sys.excepthook:
$ PYTHONIOENCODING=undefined python -c 'import sys, os; sys.exce
New submission from Martin Liska <jugg...@gmail.com>:
The documentation for pathlib.Path.resolve says: "Make the path absolute,
resolving any symlinks."
On Windows, the behavior doesn't always match the first part of the statement.
Example:
On a system with an existing, but e
Martin Panter <vadmium...@gmail.com> added the comment:
This was documented for the “getfullargspec” function in Issue 7422 (long
before “signature” existed). The error message was also clarified in Issue
6905. However IMO the term “Python function” is too subtle and amb
Martin Panter <vadmium...@gmail.com> added the comment:
Not if the time is associated with a particular day. Imagine implementing
datetime.fromisoformat by separately calling date.fromisoformat and
time.fromisoformat. The date will be off by one day if you naively rounded
2017-12-18 23:
Martin Panter <vadmium...@gmail.com> added the comment:
Regarding Matthieu’s RFC 3339 parser, Victor wanted to use the
round-half-to-even rule to get a whole number of microseconds. But considering
the “time” class cannot represent 24:00, how do you round up in the extreme
case past
Martin <mdelij...@gmail.com> added the comment:
I used Python on other machines, I know how it's supposed to work. I'm using
Windows 7 and this problem happened with 2.7.14, 2.7.13 and 2.7.9. I didn't
bother trying all other versions because it looked like it didn't matter what
v
New submission from Martin <mdelij...@gmail.com>:
When I try to run a really simple script like:
def fun(a):
print a
return
I get this error:
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python27\lib\lib-tk\Tkinter.py", line 1541, in __c
Change by Martin Panter <vadmium...@gmail.com>:
--
dependencies: +Online doc does not include inspect.classify_class_attrs
___
Python tracker <rep...@bugs.python.org>
<https://bugs.python
Change by Martin Panter <vadmium...@gmail.com>:
--
superseder: -> add exist_ok to shutil.copytree
___
Python tracker <rep...@bugs.python.org>
<https://bugs.pyt
Martin Panter <vadmium...@gmail.com> added the comment:
Similar changes were made in Issue 32150 and PR 3892 (tabs) and Mercurial
revision 98d1788c905c (trailing space and indentation). All the other tabs in
these patches appear to have been removed with other work: #29524, #31891,
Martin Panter <vadmium...@gmail.com> added the comment:
The other difference is Mattieu guarantees ValueError for invalid input
strings, which I think is good.
--
___
Python tracker <rep...@bugs.python.org>
<https://bugs.python
Martin Panter <vadmium...@gmail.com> added the comment:
P-ganssle seems to be proposing to limit parsing to exactly what
“datetime.isoformat” produces; i.e. whole number of seconds, milliseconds or
microseconds. Personally I would prefer it without this limitation, like in
Mathieu’s p
Martin Panter <vadmium...@gmail.com> added the comment:
FWIW I find Mark’s suggestion pretty good:
“Each bitwise operation has the same result as though carried out in two's
complement using a bit-width that's large enough to represent the
Martin Panter <vadmium...@gmail.com> added the comment:
The new “finditer” behaviour seems to contradict the documentation about
excluding empty matches if they touch the start of another match.
>>> list(re.finditer(r"\b|:+", "a::bc"))
[, , , , ]
An empty m
Martin Panter <vadmium...@gmail.com> added the comment:
Michael Felt: if you still want the code compatible with Python 2 and 3 (and
others are happy with that), I suggest documenting that in a code comment.
--
___
Python tracke
Martin Panter <vadmium...@gmail.com> added the comment:
Issue 32185 proposes to stop sending IP addresses in the TLS SNI protocol.
Maybe this will help; it depends if it will catch IP address strings with with
whitespace or if there are other ways to inject invalid hos
Martin Richard <mart...@martiusweb.net> added the comment:
FWIW, PyOpenSSL allows to load certificates and keys from a memory buffer and
much more. It's also fairly easy to switch from ssl to PyOpenSSL.
It's probably a viable alternative in many
Martin Panter <vadmium...@gmail.com> added the comment:
The doc string for the result object, and the main Python 2 documentation, both
say that the result is a 10-tuple. So perhaps any new field should only be an
attribute, and the tuple should stay the same size, to maintain compati
Martin Panter <vadmium...@gmail.com> added the comment:
I read in PEP 11 that Mac OS 9 support was dropped in Python 2.4.
I agree that eliminating “.” and “..” components makes sense, since that is how
they should be handled when resolving relative URLs. But it seems low priority,
Martin Panter <vadmium...@gmail.com> added the comment:
Maybe a good fix would be to “escape” the double slash with “/.”:
if os.path.isdir(path):
url = self.path
if url.startswith('//'): # E.g. "//www.python.org/%2f.."
url = "/." + url # Becom
Martin Panter <vadmium...@gmail.com> added the comment:
The first two bugs ("foo/dir?baz" and "foo/dir?baz/") were solved by Issue
23112. The third (".../foo.html/") was solved by Issue 17324.
That leaves the fourth complaint, which I don’t understand
Martin Panter <vadmium...@gmail.com> added the comment:
Actually, the CRLF + space can be injected via percent encoding, so just
dealing with literal CRLFs and spaces wouldn’t be enough. You would have to
validate the hostname after it is decoded.
urlopen("http://127.0.0.1%0D%0
Martin Panter <vadmium...@gmail.com> added the comment:
The square □ in the strings represents a space.
Issue 1 (CRLF in HTTP request path): it looks like the %0D%0A would have to be
decoded by an earlier step in the chain to "http://127.0.0.1:25/\r\nHELO . .
.". This becomes
Change by Martin Panter <vadmium...@gmail.com>:
--
type: -> security
___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue30458>
___
__
New submission from Martin <martin.bend...@gmail.com>:
>>> x = {"x":123}.update({"abc":123})
>>> type(x)
--
messages: 306977
nosy: thedemz
priority: normal
severity: normal
status: open
title: Dict creation with update will result to
Martin Panter <vadmium...@gmail.com> added the comment:
Issue 11671 is closely related and has a patch proposing to ban control
characters including CRLF (but not spaces).
Also see Issue 22928 which added header field validation to the HTTP client
module.
--
dependencies: +Se
Martin Panter <vadmium...@gmail.com> added the comment:
Victor opened Issue 32128 with the same complaint. I think I found the
offending article:
>>> server = NNTP_SSL("nntp.aioe.org")
>>> [response, count, first, last, name] = server.group("comp.l
Martin Panter <vadmium...@gmail.com> added the comment:
If it helps, here is a basic test case I wrote for “pty.spawn”. I hope that it
exposes the problem on Free BSD, but I have only tested it on Linux.
parent = r'''\
import pty, sys
pty.spawn((sys.executable, "-c", sys.arg
New submission from Martin Drawitsch <martin.drawit...@gmail.com>:
I think I found a bug in the new print syntax suggestion introduced by
https://bugs.python.org/issue30597.
When the following code is executed by Python 3.6.3 inside of a .py file:
def f():
print '%
Martin Panter <vadmium...@gmail.com> added the comment:
This looks the same as Issue 25259. The trigger is that multiple lines are
generated at the same time, but Python only expects the first line.
--
nosy: +martin.panter
resolution: -> duplicate
stage: -> resolved
Martin Panter <vadmium...@gmail.com> added the comment:
Perhaps you can compress the tar file using the “gzip.GzipFile” class. It
accepts a custom “mtime” parameter (see Issue 4272, added in 2.7 and 3.1+):
>>> gztar = BytesIO()
>>> tar = GzipFile(fileobj=
Change by Martin Panter <vadmium...@gmail.com>:
--
nosy: +serhiy.storchaka
resolution: wont fix -> not a bug
stage: -> resolved
___
Python tracker <rep...@bugs.python.org>
<https://bugs.
Martin Panter <vadmium...@gmail.com> added the comment:
The documentation says “On . . . destruction of the temporary directory object
the newly created temporary directory and all its contents are removed”. If you
had enabled warnings, you may have seen a hint:
$ python -Wdefault -c '
Martin Panter <vadmium...@gmail.com> added the comment:
https://github.com/python/cpython/pull/4283 adds a secondary timeout, which
defaults to 1 s when there is no main timeout. But this seems complicated and
arbitrary. As I understand, the main use case discussed here was waiting
w
Martin Panter <vadmium...@gmail.com> added the comment:
I find the model in terms of “bit_length” hard to understand. You have to
understand what bit_length returns, and why you added 1. Bit_length is awkward
for negative numbers. It only uses the absolute value, which would give
off-
Martin Panter <vadmium...@gmail.com> added the comment:
Issue 31945 proposes adding a “blocksize” parameter to HTTPConnection objects,
so I suggest to closing in favour of that one.
--
resolution: -> rejected
superseder: -> Configurable blocksize in HTTP(
Martin Panter <vadmium...@gmail.com> added the comment:
This proposal sounds like a race condition. Closing the output pipe as a child
exits means you risk missing recent output. On the other hand, if you don’t
care about the output any more, close the pipe first and then wait for the
New submission from Martin Ritter <mce.rit...@gmail.com>:
Hi,
I tried to use
subprocess.run(..., stdout=subprocess.PIPE, timeout=N)
to run some test scripts with a given timeout.
This works as expected with simple scripts. However if the script itself
creates other children
Martin Panter <vadmium...@gmail.com> added the comment:
Are you sure it is a “system” bug? As far as I understand, at least Posix does
not require support for local time before 1970. See
<http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16>.
But why
Martin Panter <vadmium...@gmail.com> added the comment:
Ken Kundert started a related discussion a while back on Python-ideas:
<https://www.mail-archive.com/search?l=mid=20160830203427.ge2...@kundert.designers-guide.com>.
This was about SI-prefixed units in general; not restric
Martin Panter <vadmium...@gmail.com> added the comment:
I’m unlikely to soon, but I don’t mind if someone else uses my patch.
--
___
Python tracker <rep...@bugs.python.org>
<https://bugs.python
Martin Panter <vadmium...@gmail.com> added the comment:
Closing because I understand it is too late to do anything for 3.5 now.
--
resolution: -> out of date
stage: patch review -> resolved
status: open -> closed
___
Pyth
Martin Panter <vadmium...@gmail.com> added the comment:
The patches would mask an OSError raised by the “readfp” call, which would be a
change in behaviour. But moving the call does not seem to be necessary; why not
leave it outside the “try” statement?
--
nosy: +martin.
Martin Panter <vadmium...@gmail.com> added the comment:
FWIW it looks like “strptime” in glibc, and Open and Free BSD support parsing
this and even more formats (RFC 822 and RFC 3339; includes “Z”, U.S. time
zones, ±HH). Also, there is Issue 24954 for adding “%:z” like Gnu
Martin Panter <vadmium...@gmail.com> added the comment:
Sorry, I meant Net BSD not Free BSD
--
___
Python tracker <rep...@bugs.python.org>
<https://bugs.python
Martin Panter <vadmium...@gmail.com> added the comment:
Looks the same as Issue 31374
--
nosy: +martin.panter
resolution: -> duplicate
stage: -> resolved
status: open -> closed
superseder: -> expat: warning: "_POSIX_C_SOURCE" redefined
__
Martin Panter <vadmium...@gmail.com> added the comment:
Scanning over the Open SSH commits for 7.3p1
https://github.com/openssh/openssh-portable/compare/V_7_2_P2...V_7_3_P1
it looks like this commit
https://github.com/openssh/openssh-portable/commit/d2d6bf864e52af8491a60dd507f85b7436
Martin Panter <vadmium...@gmail.com> added the comment:
Presumuing your file descriptor 3 is the read end of the pipe to the child’s
output, then there is probably a process somewhere that could still write to
the write end. Normally “check_output” waits until it has read all possible
Martin Panter <vadmium...@gmail.com> added the comment:
There’s already a bug open for this: Issue 19251. Only equal-length strings
should be supported.
--
nosy: +martin.panter
___
Python tracker <rep...@bugs.python.org>
<https://
Change by Martin Panter <vadmium...@gmail.com>:
--
Removed message: https://bugs.python.org/msg303440
___
Python tracker <rep...@bugs.python.org>
<https://bugs.python
Martin Panter <vadmium...@gmail.com> added the comment:
.
Actually take back a lot of what I wrote above. I forgot that
SimpleHTTPRequestHandler only supports HTTP 1.0; I don’t think it uses
keep-alive or persistent connections, so it should close its TCP connections
promptly. The
Martin Panter <vadmium...@gmail.com> added the comment:
The change in handling KeyboardInterrupt was my intention in Issue 23430. I
hope it isn’t a problem on its own :)
Running the module with “python -m http.server” uses the HTTPServer class,
based on socketserver.TCPServer. Thi
Martin Panter <vadmium...@gmail.com> added the comment:
I prefer Cornelius’s current proposal (rev 4f8137b) because it fixes both
sites, rather than just patching the immediate problem site.
I don’t think read(1) is a big problem, just less efficient. But if you prefer
to do larger
Martin Panter <vadmium...@gmail.com> added the comment:
Regarding the compressed data generator, it would be better if there were no
restrictions on the generator yielding empty chunks. This would match how the
upload “body” parameter for HTTPConnection.request can be an iterator w
Martin Panter added the comment:
I’m curious how you manage to trigger the warning in the “closed” state. The
Python I have handy is half a year out of date, but all my attempts to trigger
the warning either produce the less confusing version,
ResourceWarning: unclosed
Martin Vielsmaier added the comment:
I guess this is also the root cause for the problem I reported on virtualenv:
https://github.com/pypa/virtualenv/issues/1074
--
nosy: +Martin Vielsmaier
___
Python tracker <rep...@bugs.python.org>
Martin Panter added the comment:
The behaviour for searching for empty strings in Python is inconsistent; see
Issue 24243. IMO the behaviour for the (r)find/index methods is sensible, but
it is worth making the documentation explicit.
The returned indexes you have given (5, 1, and 0
Martin Panter added the comment:
>>> f"{number:#0x}" # using integer format specifier
It’s not clear what your purpose was adding the above line, but the zero flag
(0) does nothing because there is no “width” field. I think it could be
misleading, because it is actu
Martin Panter added the comment:
Some relevant info I wrote in Issue 25677:
‘The caret points to the character _before_ offset. . . . In some cases (e.g.
the line “1 +”), the offset is the string index _after_ the error. But in the
case of “1;1 + 1 = 2”, offset is the index where the error
Martin Panter added the comment:
.
Isn’t your use of “cmd” similar enough to shell=True? I.e. isn’t that a “cmd”
parent process spawning a “waitfor” child? If your 4 s “subprocess.run” call
times out, does it kill the “waitfor” process, or leave it running?
Could the “waitfor” process write
Martin Panter added the comment:
FWIW a similar change to the Struct constructor message was also proposed in
Issue 19985.
--
___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/i
Martin Panter added the comment:
For Python 2.7, this change doesn’t seem important enough for a bug fix.
--
___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/i
Martin Panter added the comment:
I’m not familiar with Windows commands or processes enough, but going by Erik’s
comment, this sounds similar to Issue 26534 and Issue 30154. Doesn’t your
“waitfor” command inherit the same parent process’s stdout etc pipes?
--
nosy: +martin.panter
Martin Panter added the comment:
Even if some use cases depend on suppress_ragged_eofs=True, I think it is best
to avoid that as the default. There could be a deprecation period if necessary.
I tested some HTTP clients I had handy. In summary, most seemed to handle a
truncation attack
Martin Panter added the comment:
I agree it would be good to document when the Readline library is invoked. Yes,
the “readline” module is only designed to work with the original sys.stdin and
sys.stdout. Python’s “open” function does not use FILE objects, but
Python does use FILE objects
Martin Panter added the comment:
The socket.makefile(newline=...) parameter only affects text mode, but
StreamRequestHandler’s “rfile” attribute works in byte mode. You could call
makefile or TextIOWrapper yourself, but neither of these options support
reading null-terminated “lines
Martin Panter added the comment:
I think the difference between Python 2 and 3 here is that Python 2’s file
objects, including sys.stdin, wrap C library FILE objects, which is supported
by the Readline library. However Python 3 has its own kind of file objects,
independent of standard C
Martin Panter added the comment:
The floating-point numbers are only accurate to about 16 digits. You probably
just found a value that cannot be exactly represented.
https://docs.python.org/3.3/faq/design.html#why-are-floating-point-calculations-so-inaccurate
--
nosy: +martin.panter
Martin Panter added the comment:
Seems the same as two other open bugs: Issue 25882 and Issue 16807.
--
nosy: +martin.panter
resolution: -> duplicate
stage: -> resolved
status: open -> closed
superseder: -> argparse help error: arguments created by
add_mutually_exc
Martin Panter added the comment:
Not sure if you just want to hide the presence of the exception and traceback.
But regarding the exception itself (OSError with errno 0), this is not ideal.
From memory, you tend to get this when the connection is shut down insecurely
at the TCP level
Martin Richard added the comment:
Yes, the goal is to isolate the blocking IO in __init__ into other methods so
Popen can be subclassed in asyncio.
The end goal is to ensure that when asyncio calls Popen(), it doesn't block the
process. In the context of asyncio, there's no need to make Popen
Martin Panter added the comment:
Assuming this is about the Classes section in the tutorial, you seem to be
going down the same track as <https://github.com/python/cpython/pull/2696>
--
nosy: +martin.panter
___
Python tracker <rep...@bugs.p
Martin Panter added the comment:
In 3.5, “await” is an ordinary identifier outside of “async def” functions. You
have to use the “async def” syntax to enable it as a special keyword.
>>> async def foo(): # “Async def” enables “await” as a keyword
... return await coro() # Val
401 - 500 of 9608 matches
Mail list logo