Martin Panter added the comment:
Checking for short writes is worthwhile, but in Issue 29070 it looks like
Cornelius identified the main problem was short _reads_. See the parts of his
patch to do with “_os_read_exactly” and related functions.
--
nosy: +Cornelius Diekmann
Martin Panter added the comment:
Issue 13256 contains a patch documenting socket options, but was closed because
the author lost interest.
Issue 27409 is a proposal to list the symbols available without documenting
what each one is for.
--
dependencies: +Document and test new socket
Martin Panter added the comment:
The general rule for documenting availability seems to be to only list the
special cases. Many of the socket options are specified by Posix, and seem to
be available on Linux, Windows, BSD and other OSes. If you say “Availability:
Linux, Windows”, it could
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
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
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
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. A
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_exclusive
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:
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 and
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” or
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:
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 on the
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:
For Python 2.7, this change doesn’t seem important enough for a bug fix.
--
___
Python tracker
<https://bugs.python.org/issue19
Martin Panter added the comment:
FWIW a similar change to the Struct constructor message was also proposed in
Issue 19985.
--
___
Python tracker
<https://bugs.python.org/issue30
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:
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:
>>> 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 actually
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) are
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
<https://bugs.python.org/issue31
New submission from Martin DeMello :
It would be useful for lib2to3.refactor to return which files were actually
changed. Right now that information is logged but not returned.
--
components: 2to3 (2.x to 3.x conversion tool)
messages: 330149
nosy: martindemello
priority: normal
Change by Martin DeMello :
--
keywords: +patch
pull_requests: +9866
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue35282>
___
___
Py
Martin Panter added the comment:
For the record, the more recent bug I mentioned was a complaint from 2015 (one
and a half years before Victor’s comment). Even if it is not worth supporting
writing after reading, the problem could be documented.
--
resolution: out of date -> wont
Martin Panter added the comment:
This is the same as Issue 26158. Truncating text files is not clearly
documented for a start, and truncating after reading doesn’t seem to be
considered much in the implementations.
Your question is answered at <https://bugs.python.org/issue26158#msg258
Martin Panter added the comment:
I added the Py_FinalizeEx API in Issue 5319, but was relying on input from
others about dealing with Py_LIMITED_API. After reading the documentation
<https://docs.python.org/3.6/c-api/stable.html>, I now see that the function
would be considered part
Martin Panter added the comment:
Regarding the first point, “finish” is no longer called after an exception.
This was apparently changed in 2.7.4 (see Issue 14574), but Geoffrey was
referring to older documentation.
Regarding the second point, about ECONNRESET vs graceful shutdown, this
Martin Panter added the comment:
The changes at <https://github.com/python/cpython/pull/10714/files/11ca0f0>
have various other behaviour changes which are not discussed here. They seem to
be there just so that you can use the TCP socket from “urlopen” with
“gettarinfo”. But “gettarin
Martin Panter added the comment:
Sounds very similar to Issue 25894, discussing how to deal with tests where
different subtests errored, failed, skipped and passed.
--
nosy: +martin.panter
___
Python tracker
<https://bugs.python.org/issue35
Martin Panter added the comment:
If something like your “addbuffer” method existed, then you won’t need to get
the size first, right? We don’t need the changes in “gettarinfo” for
“addbuffer” to be useful.
BTW have you considered returning a file writer rather than accepting a file
reader
Martin Panter added the comment:
The missing “crypt” symbol is probably this function:
<http://pubs.opengroup.org/onlinepubs/9699919799/functions/crypt.html>. It is
defined by the OS or a separate library, not by Python. You may need to link
the “_crypt” Python module to the librar
Martin Panter added the comment:
Yeah, the TarFile class would fix up the header when the user calls “close”. I
think this is how it was done for ZipFile (implemented in Issue 26039).
Yes currently you would have to build the tarinfo object by hand. I think a
helper function would be nice
Martin Panter added the comment:
This problem is common to structure fields in general, not just "c_void_p". I
recently encountered it with a different type (don't remember the type now, but
I notice plain types like c_int share the problem). I found
<https://stackover
Martin Panter added the comment:
Previous related reports:
* Issue 35260: “2to3” doesn’t parse Python 3’s “print” function by default
because it is supposed to translate Python 2 syntax
* Issue 2412: “2to3” should support “from __future__ import print_function”.
That frees up the “print
Martin Panter added the comment:
Code in question:
try:
# non-sequence items should not work with len()
# non-empty strings will fail this
if len(query) and not isinstance(query[0], tuple):
raise TypeError
# [. . .]
except TypeError:
ty, va, tb = sys.exc_info
Martin Panter added the comment:
That would not include the custom error message for the first two cases I
listed. I suggest closing this.
--
___
Python tracker
<https://bugs.python.org/issue35
Martin Panter added the comment:
It doesn’t make sense to move the “except” line without moving the matching
“print” line. According to
<https://docs.python.org/3.7/reference/compound_stmts.html#index-1>, “A clause
consists of a header and a ‘suite’.” So when it talks about reversi
Martin Panter added the comment:
The only problem with the 3.7+ documentation is the note about 3.2. Several
paragraphs under
<https://docs.python.org/release/3.7.1/library/subprocess.html#subprocess.Popen>,
it still says
“Changed in version 3.2: The default for ‘close_fds’ was change
Martin Panter added the comment:
The problem with WindowsError should only exist in 3.4+. 2.7 doesn’t support
creating symlinks on Windows.
Michael’s fix is the same as already done in 2.7 for Issue 10761 and (part of)
Issue 12088. However I’m not sure that is the best approach for a bug fix
Martin Panter added the comment:
I’m not sure if this should be considered a bug fix, but if it goes into 2.7 it
would overlap with Issue 10761 and Issue 12088. In 2.7 existing directory
entries (including broken symlinks, but not including subdirectories) may be
replaced by symbolic and
Martin Panter added the comment:
The first aspect, incorrectly assuming the OS does not support symlinks, is
described at <https://bugs.python.org/issue23228#msg265146>. Lars proposed a
fix <https://bugs.python.org/file42780/windowserror.diff> which will let the OS
exception e
Martin Panter added the comment:
Are you aware of the “add_unredirected_header” method? Maybe that is enough to
avoid your problem.
https://docs.python.org/dev/library/urllib.request.html#urllib.request.Request.add_unredirected_header
--
nosy: +martin.panter
title: urllib may leak
Martin Panter added the comment:
It is documented that buffering=0 is not supported in text mode. Look a handful
of paragraphs down from
<https://docs.python.org/release/3.7.2/library/functions.html#open>:
“Pass 0 to switch buffering off (only allowed in binary mode)”
Amaury’s proble
Martin Panter added the comment:
FWIW this happens with the built-in IDNA codec, and Amaury gave a demonstration
under <https://bugs.python.org/issue17404#msg184045>.
I don’t think the “TextIOWrapper.flush” method should use final=True, but
“close” and “detach” probably
Martin Panter added the comment:
Seems to be a lot of overlap with Issue 26859 by Xavier. Looks like Xavier
included a test case, but Bassemʼs changes on Git Hub seem more thorough in the
impementation and doc strings.
--
nosy: +martin.panter
Martin Panter added the comment:
Is this related to Issue 23882? That one is about making discovery work when
“__init__.py” files are removed.
--
nosy: +martin.panter
___
Python tracker
<https://bugs.python.org/issue35
Martin Panter added the comment:
This was changed in Python 3.2+ in Issue 16723. The response object no longer
sets the “closed” attribute when it runs out of data; it is only set when the
“close” method is called. Perhaps the example should be amended so that it
checks if “read” returned an
Martin Panter added the comment:
About “lexists”, I meant using it instead of “os.path.exits” (not “islink”). On
Linux:
>>> targetpath = 'target'
>>> os.symlink('nonexistant', dst=targetpath) # Make a broken symlink
>>> os.system('ls -l
Change by Martin Panter :
--
resolution: -> duplicate
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue35483>
___
___
Martin Panter added the comment:
FWIW I understand the backslash should be percent-encoded in URLs, otherwise
the URL is not valid.
This reminds me of a few other bugs:
* Issue 30500: Made the behaviour of fragment (#. . .) versus userinfo (. . .@)
consistent, e.g. in //www.google.com
Martin Panter added the comment:
Today I read RFC 3986, and I think the URLs in the bug reports are valid, and
are already parsed correctly. The path is allowed to have a literal “at” symbol:
path-abempty = *( "/" segment )
segment = *pchar
pchar = unreserved / pct-encoded /
Martin Panter added the comment:
The “urllib.parse” module generally follows RFC 3986, which does not allow a
literal backslash in the “userinfo” part:
userinfo = *( unreserved / pct-encoded / sub-delims / ":" )
unreserved = ALPHA / DIGIT / "-" / "." / &quo
Martin Panter added the comment:
Issue 35762 was opened specifically about Izbyshev’s case: TextIOWrapper
behaviour with a non-blocking file. Calling “os.fdopen” with mode='r' (text
mode) returns a TextIOWrapper object.
--
___
Pyth
Martin Panter added the comment:
Yes, universal newlines mode uses the TextIOWrapper class to read the pipe,
which isn’t really designed for non-blocking mode. This is the same problem
described by Izbyshev at <https://bugs.python.org/issue13322#msg307763>.
Raising TypeError isn’t idea
Martin Panter added the comment:
I think making a comma start a new cookie is dangerous, and perhaps this
proposal should be rejected.
I’m not an expert on web programming, but this reminds me of some security
problems that already affected Python:
<https://translate.google.com/translat
Martin Panter added the comment:
I presume MeiK wants to use BaseCookie to parse the Set-Cookie header field, as
in
>>> BaseCookie('Hello=World; Expires=Thu, 31 Jan 2019 05:56:00 GMT;')
>>> BaseCookie('Hello=World; Expires=Thu,31 Jan 2019 05:56:00 GMT;')
Martin Panter added the comment:
I suspect Idle just passes control characters directly to an underlying Text or
similar TK widget. As far as I know, TK only documents behaviour for tabs and
newlines, not other control characters.
Last time this was brought up, Terry added a sentence under
Martin Panter added the comment:
Ment to point to previous bug report: Issue 23220
--
___
Python tracker
<https://bugs.python.org/issue35833>
___
___
Python-bug
Martin Panter added the comment:
I think the solution here is to document what “SimpleCookie.value_encode”
really does: RFC 2109 quoted-string escaping. If you want to a generate
RFC-6265-compliant Set-Cookie string, do not include non-compliant characters
in the cookie value, and consider
Martin Panter added the comment:
Sorry, but changing to bytes after ten years of using str in this module in
Python 3 is not going to happen. Let’s just document the state of Python 2 (see
Éric: https://bugs.python.org/issue11315#msg129448).
--
assignee: -> docs@python
compone
Martin Panter added the comment:
Same as Issue 11315, where Éric suggested documenting the behaviour.
--
nosy: +martin.panter
resolution: -> duplicate
superseder: -> unicode support in Cookie module
___
Python tracker
<https://bugs.p
Change by Martin Panter :
--
stage: test needed -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue2212>
___
___
Pyth
Martin Panter added the comment:
The main cause of this behaviour is that whitespace (matching the ASCII RE
“\s”) is treated as separation between cookie “morsels”. It looks like this has
always been the behaviour, but I’m not sure it was intended.
>>> print(BaseCookie('first
Martin Panter added the comment:
I think it would be more practical to fix the documentation (option 1). Do you
have a use case for “TextIOBase.readinto” raising ValueError (something more
concrete than someone having expectations)?
--
nosy: +martin.panter
Martin Panter added the comment:
I agree that the documentation should be clearer about the first two points.
Considering that the "input" function and by default the "str.splitlines"
method both behave differently, I often had to re-learn this when I had less
Pyt
Martin Panter added the comment:
This is covered by Issue 13322. There are a few other BufferedReader methods
that contradict the documentation for non-blocking mode.
A while ago I posted a patch to change the implementation to match the
documentation, but nobody reviewed it or gave their
Martin Panter added the comment:
Maybe related to Victor's "Issue 1" described in Issue 32085. That is also a
security bug about CRLF in the URL's path, but was opened before Issue 30500
was opened and the code changed, so I'm not sure if it is the same as this or
Martin Panter added the comment:
Looking over the changelog, my guess (untested) is this is caused by commit
d6a283b3 for Issue 25862. That change looks like it drops the internal
TextIOWrapper decoding buffer for each successful write.
I don't have the right version of Python to test
Martin Panter added the comment:
I haven’t confirmed, but it looks like the original change here broke
bidirectional reading and writing with a single TextIOWrapper object; see Issue
35928.
--
___
Python tracker
<https://bugs.python.
Change by Martin Panter :
--
dependencies: +Remove urllib.parse._splittype from mimetypes.guess_type
___
Python tracker
<https://bugs.python.org/issue22
Martin Panter added the comment:
For 3.7+ (where iterable objects are supported), I suggest:
1. Document the problem as a limitation of handlers like
AbstractBasicAuthHandler, and consider raising an exception instead of trying
to upload a file or iterable a second time.
2. Clarify the
Martin Panter added the comment:
Suggest closing this assuming it is a duplicate, unless Jarry can give more
information.
--
resolution: -> duplicate
status: open -> pending
superseder: -> pty.spawn hangs on FreeBSD 9.3, 10.x
___
Pytho
Martin Panter added the comment:
I'm not sure it is wise for the Python documentation to suggest inserting null
bytes in general. This seems more like an application-specific hack. There is
nothing in Python that handles these null bytes specially, and I expect they
will be seen i
Change by Martin Panter :
--
resolution: -> not a bug
status: open -> pending
title: urllib.request.urlopen error -> urllib.request.urlopen
CERTIFICATE_VERIFY_FAILED error
___
Python tracker
<https://bugs.python.or
Martin Panter added the comment:
I agree the documentation is insufficient. It should have said if “data” is
iterated, it must yield bytes-like objects.
I agree it is unwise to yet more special cases for the uploaded data types.
When Lye passed the dictionary of three keys and values, I
Martin Panter added the comment:
See also Issue 26264 about the “keyword” module
--
nosy: +martin.panter
___
Python tracker
<http://bugs.python.org/issue29
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
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
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
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 sp
Changes by Martin Panter :
--
resolution: -> duplicate
stage: -> resolved
status: open -> closed
superseder: -> asyncio.wrap_future undocumented
___
Python tracker
<http://bugs.python
Changes by Martin Panter :
--
components: +asyncio
stage: -> patch review
versions: +Python 3.6, Python 3.7
___
Python tracker
<http://bugs.python.org/issu
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 is that the
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
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
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
<http://bugs.python.org/issue21
Changes by Martin Panter :
--
resolution: -> fixed
stage: -> test needed
status: open -> pending
___
Python tracker
<http://bugs.python.org/issue15082>
___
___
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
<http://bugs.python.org/issue7
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
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 is in
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
Changes by Martin Panter :
--
resolution: -> works for me
stage: needs patch -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.or
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
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
<http://bugs.python.org/issue29
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
<http://bugs.python.org/i
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.p
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
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
<http://bugs.python.org/issu
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
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
401 - 500 of 8156 matches
Mail list logo