Martin Panter <vadmium...@gmail.com> added the comment:
I presume this is about parsing a URL like
>>> urlsplit("//user:[@host")
Traceback (most recent call last):
File "", line 1, in
File "/home/proj/python/cpython/Lib/urllib/parse.py", line 4
Martin Panter <vadmium...@gmail.com> added the comment:
I don’t know; I haven’t tested it. I was anticipating that it is fixed, but
perhaps I should leave the resolution alone instead?
--
___
Python tracker <rep...@bugs.python.or
Martin Panter <vadmium...@gmail.com> added the comment:
Maybe worth checking if this is fixed due to the changes in Issue 31373 for
3.6+.
--
nosy: +martin.panter
resolution: -> out of date
superseder: -> demoting floating float values to unrepresentable types is
undefi
Martin Panter <vadmium...@gmail.com> added the comment:
Perhaps your “ctypes” problems may be helped by my ctypes_v2.patch in Issue
1621. Or perhaps they are already documented in Issue 15119 and/or Issue 28169.
--
nosy: +martin.panter
___
Martin Panter <vadmium...@gmail.com> added the comment:
Sorry I haven’t made a PR for ctypes_v2.patch, but I don’t mind if someone else
takes over. I understand the HAVE_LONG_LONG check may no longer necessary for
newer Python ve
Martin Panter <vadmium...@gmail.com> added the comment:
Don’t forget about updating __all__.
--
___
Python tracker <rep...@bugs.python.org>
<https://bugs.python
Martin Panter <vadmium...@gmail.com> added the comment:
Maybe this is the same as Issue 28584, about the ${CC} variable rather than
“sysroot”. In any case, the patch looks unrelated.
--
nosy: +martin.panter
___
Python tracker <rep...@bugs.p
Martin Panter <vadmium...@gmail.com> added the comment:
Looks like Issue 1410680 has a new function to merge comments with new config
values (among other things).
--
nosy: +martin.panter
___
Python tracker <rep...@bugs.python.or
Martin Panter <vadmium...@gmail.com> added the comment:
Maybe related to Issue 24712?
--
nosy: +martin.panter
___
Python tracker <rep...@bugs.python.org>
<https://bugs.python
Martin Panter <vadmium...@gmail.com> added the comment:
I suggested the “scheduler” tuple to bring the two related parameters
(scheduling policy and sched_param) together, similar to how they are paired as
the second and third parameters to “os.sched_setscheduler”, and because I
t
Martin Panter <vadmium...@gmail.com> added the comment:
Can you use the existing sched_param class?
https://docs.python.org/3/library/os.html#os.sched_param
--
___
Python tracker <rep...@bugs.python.org>
<https://bugs.python
Martin Panter <vadmium...@gmail.com> added the comment:
To wrap “posix_spawnattr_setschedparam” perhaps you could combine it with the
scheduler policy:
# Inherit current policy and parameters:
posix_spawn(..., scheduler=None)
# Set new policy with parameters:
posix_spawn(..., sch
Martin Panter <vadmium...@gmail.com> added the comment:
The exception message and stack trace is documented to go to stderr:
<https://docs.python.org/2/library/sys.html#sys.excepthook>.
Whether the prompt “>>>” goes to stderr or stdout depends on quirks of the
en
Martin Panter <vadmium...@gmail.com> added the comment:
This looks like it may be covered by Issue 31940, about the “shutil.copystat”
API. See Anthony’s initial proposal at
<https://bugs.python.org/issue31940#msg305528>.
Max: I think you need the “else” branch to reraise t
Martin Panter <vadmium...@gmail.com> added the comment:
It is supposed to be a function signature, similar to the syntax when you
define your own function, rather than a usage example of calling the function.
In this case, the slash notation is described by PEP 457. It is supposed to
in
Martin Panter <vadmium...@gmail.com> added the comment:
Sorry, I realize there is a problem remaining with the pointer types for
"Noddy_name" (Noddy vs PyObject pointers), so you can't remove the cast there.
But my suggestion should still apply to other places, for instance
Martin Panter <vadmium...@gmail.com> added the comment:
Siddhesh, it looks like your fixes make the C function signatures match the
signature expected in the PyMethodDef structure. If so, I suggest to remove the
(PyCFunction) casts from those structure definitions as well. For instanc
Martin Panter <vadmium...@gmail.com> added the comment:
Eryk Sun’s explanation makes this sound like a duplicate of Issue 15453, which
shows GCC on Linux packing structures into a single byte, and ctypes using the
size of the expanded integer type.
--
nosy: +martin.panter
reso
Martin Panter <vadmium...@gmail.com> added the comment:
There is no “open_fds” parameter as far as I know. I presume you meant
heritable descriptors are still closed with close_fds=True (not open_fds=False).
Are you sure about the second part? In my experiments on Linux, unless
Martin Panter <vadmium...@gmail.com> added the comment:
The close_fds= in that signature seems fine to me. If you read
the documentation, it says the default mode depends on the platform, and on
other parameters. However I think the signature at
<https://docs.python.org/release/3.6.
Change by Martin Panter <vadmium...@gmail.com>:
--
nosy: +martin.panter
___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32270>
___
Martin Panter <vadmium...@gmail.com> added the comment:
It does look similar. They probably could be merged. The main difference is in
Issue 5993 Eivind suggested to somehow use a “wait” system call, while here
Victor suggested “fork” (perhaps to orphan a grandchild p
Martin Panter <vadmium...@gmail.com> added the comment:
I have also wanted to force renegotation for testing with Python.
As a workaround, I have used the "openssl s_server" program, which I described
at <https://bugs.python.org/issue25919#msg257508> (use the lower-ca
Martin Panter <vadmium...@gmail.com> added the comment:
Hi Yao, I tend to agree with Ned. The support for “file:” URLs is by design. I
don’t see any security problems. I suggest to close this.
In Issue 11662, it was decided that a web server redirecting to a “file:” URL
was a security p
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
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
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
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
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 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>
___
__
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
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
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 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
201 - 300 of 4209 matches
Mail list logo