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:
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:
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:
What would your proposal do where an embedded backslash is currently valid?
>>> print(r'Backslash apostrophe: \'.')
Backslash apostrophe: \'.
>>> r'\' # Comment or string?'
"\
Martin Panter added the comment:
It might help if you explained what “atrocities” are happening on your network.
Is there a proxy or man-in-the-middle (or the remote peer) that shuts down TCP
connections?
If so, perhaps this is similar to Issue 10808. From my memory, in that case an
OS “recv
Martin Panter added the comment:
The trouble is you would also have to parse the Transfer-Encoding field, and
have special logic for responses where Content-Length is not needed or
irrelevant (certain combinations of method and status code). And even then you
risk breaking rare or custom
Martin Panter added the comment:
I think chunked encoding is only meant to be used for HTTP 1.1. For HTTP 1.0,
you have to either send Content-Length, or shut down the connection after
sending the body. See also Issue 21224 about improving HTTP 1.1 support.
Maybe you should add a “Vary
Martin Panter added the comment:
Can’t you use b.seek(0, SEEK_END)?
--
nosy: +martin.panter
versions: -Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6
___
Python tracker
<http://bugs.python.org/issue31
Martin Panter added the comment:
Serhiy, that is what Dong-hee already proposed in
<https://github.com/python/cpython/pull/1214>, but someone needs to decide if
we want to support RFC 2640, in which I understand LF on its own is legal, and
CR is escaped by adding
Martin Panter added the comment:
Thanks for the information. That narrows the problem down, but I still don’t
exactly know why it hangs.
A good workaround may be to put a timeout in the “select” call for a second or
so, and if it times out, raise an exception which will fail the test but let
Martin Panter added the comment:
Personally, I haven’t needed this feature. But I still think it may be a decent
solution for the “webbrowser” module, potentially your “asyncio” problem, and
other cases that could now trigger an unwanted ResourceWarning
Martin Panter added the comment:
Thanks for handling this Victor. To answer some of your earlier questions, this
is my understanding of the Free BSD behaviour (although I don't have Free BSD
to experiment with):
When writing to TCP sockets, I believe the data is buffered by the local O
Martin Panter added the comment:
It looks like I was fairly confident about my patch, but it was all theoretical
and I was never able to analyze the failure myself.
Sorry but I am unlikely to spend much time on this or open a pull request any
time soon
Martin Panter added the comment:
It might help if you explained why you want to make these changes. Otherwise I
have to guess. Is a compromise between strictly rejecting all non-URL
characters (not just control characters), versus leaving it up to user
applications to validate their URLs?
I
Martin Panter added the comment:
I doubt the Gnu Readline library nor Python’s readline module are relevant. The
input function only uses Readline if sys.stdin is the original stdin terminal;
I suspect Idle monkey-patches sys.stdin. The readline method reads directly
from the file object; it
Martin Panter added the comment:
These tests are supposed to:
1. Create a TCP server
2. Open a TCP connection
3. Run a custom connection handler (depending on the particular test) in a new
thread
4. When the handler returns, the new thread should call “shutdown_request”
5. Shutdown_request
Martin Panter added the comment:
I think fixing all affected calls to socket.close in the world (option 3) would
be too much. I just added two new reports (Issue 30652 and Issue 30391) as
dependencies. These are about testing socketserver.TCPServer. As an example, to
fix the socket.close call
Changes by Martin Panter :
--
dependencies: +test_threading_handled() of test_socketserver hangs randomly on
AMD64 FreeBSD 10.x Shared 3.6, test_threading_not_handled() of
test_socketserver hangs randomly on AMD64 FreeBSD 10.x Shared 3.6
___
Python
Martin Panter added the comment:
Don’t let my minus sign suggestion stop this, especially since a couple other
people said they don’t like it. The current pull request proposal is beneficial
without it.
Isn’t there a “Unicode writer” API that could be used? Maybe that’s another
alternative
Martin Panter added the comment:
Some people like to avoid indented blank lines, treating them the same as
trailing whitespace. I suspect this behaviour may be intentional.
--
nosy: +martin.panter
___
Python tracker
<http://bugs.python.
Martin Panter added the comment:
For existing “.gz” files, I wasn’t suggesting to compress them a second time,
just for the server report that they are already compressed, like how it
reports the Content-Type value based on the file name. Including
Content-Encoding would help browsers display
Martin Panter added the comment:
Sounds similar to Issue 27425. Did rc1 get built with mangled newlines or
something?
--
components: +Tests, Windows
nosy: +martin.panter, paul.moore, steve.dower, tim.golden, zach.ware
___
Python tracker
<h
Changes by Martin Panter :
--
dependencies: +tarfile add uses random order
title: Make tarfile have deterministic sorting -> Make shutil.make_archive have
deterministic sorting
___
Python tracker
<http://bugs.python.org/issu
Martin Panter added the comment:
I think neither Pierre’s nor Glenn’s implementations should be added to
SimpleHTTPRequestHandler. In fact I think most forms of content negotiation are
only appropriate for a higher-level server. It seems too far removed from the
intention of the class
Martin Panter added the comment:
Issue 24009 proposes deprecating y# (among other units).
IMO the documentation and error message aren’t specific enough regarding the
reference to “bytes-like”.
--
nosy: +martin.panter
___
Python tracker
<h
Changes by Martin Panter :
--
dependencies: +[security] urllib connects to a wrong host
___
Python tracker
<http://bugs.python.org/issue18140>
___
___
Python-bug
Martin Panter added the comment:
Maybe Issue 16124 is related; it mentions 64-bit values, but it sounds like an
obscure use case.
--
___
Python tracker
<http://bugs.python.org/issue25
Martin Panter added the comment:
Issue 29636 looks related
--
nosy: +martin.panter
___
Python tracker
<http://bugs.python.org/issue30669>
___
___
Python-bug
Martin Panter added the comment:
I don't think it is worth changing the implementations to be in terms of
urlsplit or urlparse. This is proposed for splithost in
<https://github.com/python/cpython/pull/1849>, but I suspect it would change
the behaviour in some corner cases. See
Martin Panter added the comment:
Also, even in the Py 3 docs, the ErrorCode parser attribute is said to be
numeric, but there is a suggestion to compare it with “constants” defined in
the “errors” (module) object. I guess it should be clarified that you can’t
compare it directly; perhaps
Martin Panter added the comment:
Yes I think I committed all the documentation. Someone needs to decide whether
to use Andy’s tests as they are, or perhaps modify or drop some or all of them.
--
___
Python tracker
<http://bugs.python.org/issue12
Martin Panter added the comment:
Why do you want to this? Encoding files on the fly seems out of scope of the
SimpleHTTPRequestHandler class to me, but perhaps a more flexible API that
could be plugged in by the user could be beneficial.
See
Martin Panter added the comment:
See <https://bugs.python.org/issue30319#msg295109> about the “socket.close”
exception, which should only affect 3.6+. But the 2.7 “recv” exception is a bit
different.
--
nosy: +martin.panter
___
Python t
Martin Panter added the comment:
Making this an index of related reports:
Issue 30319: test_imap
Issue 30315: test_ftplib
Issue 30543: test_timeout
Issue 30328: test_ssl
Issue 27784: test_asyncore.TestAPI_UseIPv6Select.test_handle_accept,
test_socketserver
Issue 30106
Martin Panter added the comment:
Did you see
<https://docs.python.org/3.6/library/stdtypes.html#set-types-set-frozenset>?
--
assignee: -> docs@python
components: +Documentation
nosy: +docs@python, martin.panter
status: open -> pending
__
Martin Panter added the comment:
You can also inject proper HTTP header fields (or do multiple requests) if you
omit the space after the CRLF:
urlopen("http://localhost:8000/ HTTP/1.1\r\nHEADER: INJECTED\r\nIgnore:")
Data sent to the server:
>>> server = socket(A
Martin Panter added the comment:
I think this could be merged with Issue 14826. Maybe it is sensible to handle
all control characters the same way.
--
nosy: +martin.panter
resolution: -> duplicate
superseder: -> urlopen URL with unescaped
Martin Panter added the comment:
The C "_datetime" implementation seems to handle this as documented. But either
way, the "timedelta" range is greater than the "datetime" range, so it seems to
be just a difference in OverflowError messages, not a big practi
Martin Panter added the comment:
Currently for the “buffer” destination, it says
Suppress . . ., write . . . to ``block``, and write everything else to ``file``.
Would it be more correct to change “file“ to “buffer”? I.e.
Suppress . . ., write . . . to ``block``, and write everything else to
Martin Panter added the comment:
See also Issue 18140, where it looks like people _want_ the hash (#) to be part
of the username and/or password.
Another option may be to raise an exception.
--
nosy: +martin.panter
___
Python tracker
<h
Martin Panter added the comment:
I think the simplest way forward would be to add the word “Unicode” back in.
You could look at making a Git Hub pull request for this if you want. Hopefully
somebody else can merge it though, because I probably won’t be in a position to
do so for a while
Martin Panter added the comment:
Perhaps if you ran the tests in verbose mode, that could narrow down which test
it hangs at. Also, if you can capture a KeyboardInterrupt stack trace, that may
help. Not sure if it works with your build setup, but maybe you can run
something like
./python -m
Changes by Martin Panter :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue30476>
___
___
Martin Panter added the comment:
Also discussed in Issue 13349
--
nosy: +martin.panter
superseder: -> Non-informative error message in index() and remove() functions
___
Python tracker
<http://bugs.python.org/issu
Martin Panter added the comment:
Previous report: Issue 25641. At least in Posix, the “putenv” function is not
required to be thread safe.
--
nosy: +martin.panter
___
Python tracker
<http://bugs.python.org/issue30
Martin Panter added the comment:
Maybe Issue 10808?
--
nosy: +martin.panter
___
Python tracker
<http://bugs.python.org/issue30437>
___
___
Python-bugs-list mailin
Martin Panter added the comment:
I backported Issue 12067 documentation, so hopefully this is fixed.
--
resolution: -> out of date
stage: -> resolved
status: open -> closed
superseder: -> Doc: remove errors about mixed-type comparisons.
__
Martin Panter added the comment:
Also, “-bb” turns it into an exception, and the same applies to bytes vs int:
>>> b"a" == "a"
Traceback (most recent call last):
File "", line 1, in
BytesWarning: Comparison between bytes and string
>>> b"
Martin Panter added the comment:
If you add “cwd” to Frequently Use Arguments, please try to keep the details in
one place. Otherwise you encourage a fix for Issue 15533 (cwd platform
specifics) to repeat the problem of Issue 20344 (args vs shell platform
specifics), where some details are
Martin Panter added the comment:
For the curious, Nick added the “frequently used arguments” in Issue 13237.
Before that the signatures were like
<https://docs.python.org/release/3.2.2/library/subprocess.html#convenience-functions>:
subprocess.call(*popenargs, **kwargs)
-
Martin Panter added the comment:
I think the benefit of the repr being easier to understand outweighs the pain
of breaking the old format. If the change is a problem, that might be mitigated
by adding an entry to the “Porting to Python 3.7” documentation.
I don’t think my option of factoring
Martin Panter added the comment:
Cheryl: see also Issue 25777 and Issue 20751, both about the “super binding”
under Invoking Descriptors.
Raymond: if you want to just pick parts of my patch, go for it. But I don’t
understand your concern about explaining the MRO. I think it is important to
Martin Panter added the comment:
Lower-case “a” is defined at the top of the list: “The starting point . . . is
‘a.x’.” The last entry may fit in better if it was written “If binding to an
instance of ‘super’ ”.
The problem with the m() call is also mentioned in Issue 25777, about the
Martin Panter added the comment:
I suspect the test won’t be effective with Editline (either fail, or silently
pass without testing the bug). From memory Editline uses an ~/.editrc file, not
INPUTRC, with different syntax and configuration
Martin Panter added the comment:
What is the advantage of compiling calls to both Long and LongLong converters?
Isn’t it simpler to blindly call PyLong_FromUnsignedLongLong or similar?
--
nosy: +martin.panter
___
Python tracker
<h
Martin Teichmann added the comment:
Hi, so where do we go from here? I could write the proposed allow_recreation
flag, but IMHO this adds only dead code, as it is of no need at all. I don't
think code gets more clear by adding dead code...
I opted for one line more of comment, I think
Martin Teichmann added the comment:
I personally prefer the current situation. The problem is the following: when
an @contextmanager is first called, we don't know yet whether the user wants to
use it directly, or as a decorator, so we have to have some kind of hybrid
class. Once it'
Martin Panter added the comment:
On Python 2, I'm guessing you are getting extra CRs on Windows? It looks like
you have to open in binary mode there to avoid newline translation. This is
documented for the "reader" and &qu
Martin Panter added the comment:
In Python 2, the "open" function doesn't have a "newline" parameter. Perhaps
you were looking at the wrong documentation version.
--
nosy: +martin.panter
resolution: -> not a bug
stage: ->
Martin Panter added the comment:
It is also pointless to shuffle a list object repeating the same item, but that
is no reason to add a special case. Is there a real problem with allowing
dictionaries and OrderedDict? It seems to behave sensibly if you give each item
a unique value:
>&
Martin Panter added the comment:
I understand hash randomization was added after this bug was opened. Here is a
demonstration with “video/mp4”, which only has the extension “.mp4” built in.
But my /etc/mime.types file lists “mp4 mp4v mpg4”, so after the second
initialization the behaviour
Martin Panter added the comment:
I suggest to discuss the non-determinism problem in Issue 1043134 (about
determining a canonical extension for each content type). I understood this bug
(Issue 4963) is about the behaviour of repeated initialization of the same
instance of mimetypes.
BTW an
Changes by Martin Panter :
--
resolution: -> duplicate
stage: -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue29823>
___
___
Changes by Martin Teichmann :
--
pull_requests: +1602
___
Python tracker
<http://bugs.python.org/issue30306>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Martin Teichmann:
The arguments of a function which was decorated to be a context manager are
stored inside the context manager, and are thus kept alive.
This is a memory leak.
Example:
@contextmanager
def f(a):
do_something_with(a)
a = None
New submission from Martin Panter:
In Mercurial revision 6e5b5d1b6714, the documentation for
“assertMultiLineEqual” was changed from
This method is used by default when comparing Unicode strings with
“assertEqual”.
to
This method is used by default when comparing strings with “assertEqual
Martin Panter added the comment:
This was discussed fairly recently:
<https://marc.info/?i=captjjmrbxpvyquyxshbc1j13m_h5or67cnbkrkysw4ef6rq...@mail.gmail.com>.
There seems to be a bit of support for changing this. It is not a bug fix, so
has to go into the next release, now 3.7.
I di
Martin Panter added the comment:
This proposal would be useful. My use case is for when an API suppresses an
external exception context:
>>> import os
>>> try:
... os.environ["NEW_VARIABLE"] = bug # Hidden exception
... finally:
... del os.environ
Martin Panter added the comment:
Raymond I suggest you unassign this and let others work on it.
--
stage: patch review -> needs patch
___
Python tracker
<http://bugs.python.org/issu
Changes by Martin Panter :
--
resolution: -> duplicate
stage: -> resolved
status: open -> closed
superseder: -> docs.python.org/3/howto/descriptor.html still refers to
"unbound methods"
___
Python tracker
<http://b
Martin Panter added the comment:
See Issue 23702 specifically about unbound methods in Python 3, and Issue 25435
about general problems with the how-to in Python 3.
--
nosy: +martin.panter
___
Python tracker
<http://bugs.python.org/issue12
Martin Panter added the comment:
Issue 10395 added “os.path.commonpath” in 3.5.
--
nosy: +martin.panter
resolution: -> duplicate
stage: patch review -> resolved
status: languishing -> closed
superseder: -> new os.path function to extract common prefix based on path
Changes by Martin Panter :
--
resolution: -> duplicate
stage: test needed -> resolved
status: open -> closed
superseder: -> _bsddb: else misleadingly indented
___
Python tracker
<http://bugs.python
Martin Panter added the comment:
For plain-text (non-SSL) HTTP uploads, perhaps using “socket.sendfile” would
help: Issue 13559.
Another idea would be to expose and document the low-level socket (or SSL
wrapper) and let the user copy data with whatever chunk size they desire.
--
nosy
Martin Panter added the comment:
See Issue 27579, where Victor wanted to focus on
<https://github.com/asyncio-doc/asyncio-doc> outside of Python.
--
nosy: +haypo, martin.panter
___
Python tracker
<http://bugs.python.org/i
Changes by Martin Panter :
--
dependencies: +No Documentation on tkinter dnd module
___
Python tracker
<http://bugs.python.org/issue15346>
___
___
Python-bug
Martin Panter added the comment:
I suggest to close this as a duplicate. The pull request itself looks like the
right direction to me, but let’s not split the discussion up more than
necessary.
--
nosy: +martin.panter
resolution: -> duplicate
superseder: -> urllib FTP pr
Martin Panter added the comment:
Is this a duplicate of Issue 21327? There is some discussion there and a patch
to add get_socket_type that excludes SOCK_NONBLOCK.
--
nosy: +martin.panter
superseder: -> socket.type value changes after using settime
Martin Panter added the comment:
I think changing FTPHandler may be more appropriate than urlsplit. But I
thought your other pull request <https://github.com/python/cpython/pull/1214>
in “ftplib” might be enough. Or are you trying to make it more user-friendly?
Also, FTPHandler is not u
Martin Panter added the comment:
I think I would prefer b2a_uu(data, grave=True), but am also happy with Xiang’s
backtick=True if others prefer that. :) In my mind “grave accent” is the pure
ASCII character; it just got abused for other things. Other options:
b2a_uu(data, space=False)
b2a_uu
Martin Panter added the comment:
I don’t think the API should be expanded to accept arbitrary bytes-like objects
as format strings. Struct formats are strings of ASCII-compatible characters,
but not arbitrary chunks of memory.
I think the main question is whether it is okay to break
Changes by Martin Panter :
--
dependencies: +struct.Struct.format is bytes, but should be str -Document
whether it's safe to use bytes for struct format string
___
Python tracker
<http://bugs.python.org/is
Martin Panter added the comment:
I think the direction to take for this depends on the outcome of Issue 21071.
First we have to decide if the “format” attribute is blessed as a byte string
(and not deprecated), or whether it is deprecated or changed to a text string.
Serhiy pointed out that
Martin Panter added the comment:
I understand this bug (as reported by ECBFTW) is about Python injecting
unexpected FTP commands when the “urllib” and “urllib2” modules are used. The
“httplib” module (“http.client” in Python 3) is unaffected. I only mentioned
HTTP as an example of a similar
Martin Panter added the comment:
FWIW I am using NXP LPC microcontrollers at the moment, whose bootloader uses
the grave/backtick instead of spaces. (NXP application note AN11229.) Although
in practice it does seem to accept Python's spaces instead of graves.
I wouldn't put too m
Martin Panter added the comment:
The “Proper adherence” sentence has always bothered me. Why does “wfile” have
to adhere, but not other other APIs (rfile, send_header, etc)? I wonder if the
sentence is useful at all. (Of course you have to use HTTP to operate with HTTP
clients.)
Perhaps it
Martin Panter added the comment:
Isn’t Issue 30119 a duplicate of this? In that bug Dong-hee you posted a pull
request that changes the “ftplib” module, which makes more sense to me than
adding a special case to “urlsplit” that understands FTP. See how this was
addressed for HTTP in Issue
Changes by Martin Panter :
--
nosy: -martin.panter
___
Python tracker
<http://bugs.python.org/issue28769>
___
___
Python-bugs-list mailing list
Unsubscribe:
Martin Panter added the comment:
Issue 5115 is already open with patch that has an alternative API to the
low-level “killpg” method. It also has a Windows implementation and tests. I
suggest to focus this bug on the higher-level “kill_group” option.
--
dependencies: +Extend
Martin Panter added the comment:
This is similar to the problem described in Issue 26534, which proposes
“kill_group” and “killpg” APIs as a solution.
(FYI you should put a shebang at the start of the shell script, or call it as
“sh -c test.sh”, to fix the “Exec format error
Martin Panter added the comment:
I don’t know enough about process groups and sessions to properly review, but
some things that stand out:
* Patch is missing documentation and tests
* If the “killpg” just wraps os.killpg, perhaps adding the method is not
justified
* Are there any race
Martin Panter added the comment:
A while ago I wrote a patch targetting Issue 22359 that may be a starting point
for “make regen”: <https://bugs.python.org/file42169/separate-regen.patch>. It
pulled out three recipes into separate “phony” targets: “make graminit
importlib importlib_ex
Martin Panter added the comment:
.
Issue 11681 is already open for the -b option, with a patch in progress.
If updating the doc string, also change “buffer” to “bytearray”. This is what
“bytearray” was originally called in Python 3, and “buffer” is something
different in Python 2
Martin Panter added the comment:
Do you mean a separate makefile rule to rebuild the generated files, rather
than rebuilding them in a normal “make all” build? I would support this; this
is what I meant with my “make regenerate” proposal in response to Nick linked
above
Martin Panter added the comment:
Last time I proposed removing the automatic rebuilding of checked-in generated
files, it seemed getting a consensus would not be trivial. Nick seemed strongly
against changing the status quo:
<https://mail-archive.com/search?l=mi
Changes by Martin Panter :
--
Removed message: http://bugs.python.org/msg291956
___
Python tracker
<http://bugs.python.org/issue30112>
___
___
Python-bugs-list m
Martin Panter added the comment:
This doesn’t seem like a bug to me. At least it is consistent with the rule for
making a tuple when there are commas versus returning the direct expression
when there are no commas:
>>> x = (1); type(x)
>>> x = (1,); type(x)
I don’t
Martin Panter added the comment:
Maybe this is related to Issue 29059. If so, there seems to be resistance to
enabling the feature by default, and preference to use existing APIs rather
than adding a new API that enables it.
--
components: +Windows
nosy: +martin.panter, paul.moore
Martin Panter added the comment:
This is as documented, but perhaps see Issue 20344 about clarifying the
documentation.
--
nosy: +martin.panter
resolution: -> not a bug
stage: -> resolved
status: open -> closed
superseder: -> subprocess.check_output() docs misrepresen
Martin Panter added the comment:
Looks like a there is already a patch discussed at Issue 26985.
--
nosy: +martin.panter
resolution: -> duplicate
stage: -> resolved
status: open -> closed
superseder: -> Information about CodeType in inspect documentation
501 - 600 of 9844 matches
Mail list logo