Martin Panter added the comment:
Looks like Issue 9374 already covers most of this, with fixes in 2.7, 3.2 and
3.3.
$ python3.3
Python 3.3.2 (default, May 16 2013, 23:40:52)
[GCC 4.6.3] on linux
Type "help", "copyright", "credits" or "license" for
Changes by Martin Panter :
--
nosy: +vadmium
___
Python tracker
<http://bugs.python.org/issue15009>
___
___
Python-bugs-list mailing list
Unsubscribe:
Martin Panter added the comment:
The updated text to “suprocess.rst” is better, but now it looks like the whole
paragraph fails to render at
http://docs.python.org/dev/library/subprocess#subprocess.Popen. I have no idea
about the syntax but maybe the blank line separating “versionchanged
Changes by Martin Panter :
--
nosy: +vadmium
___
Python tracker
<http://bugs.python.org/issue19758>
___
___
Python-bugs-list mailing list
Unsubscribe:
Martin Panter added the comment:
For the record, this issue seemed to forget about the effect of buffering the
pipe to the subprocess’s input stream. Buffering an input pipe means that data
is hidden away until it is flushed, and the close() method can raise a broken
pipe error. I have
Changes by Martin Panter :
--
nosy: +vadmium
___
Python tracker
<http://bugs.python.org/issue17232>
___
___
Python-bugs-list mailing list
Unsubscribe:
Martin Panter added the comment:
How about swapping the two sentences for globals() then:
“Returns the dictionary of the module . . . This represents the symbol table .
. .”
I thought the current locals() entry is fairly clear. It actually says _not_ to
modify the dictionary
Changes by Martin Panter :
--
nosy: +vadmium
___
Python tracker
<http://bugs.python.org/issue18879>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Martin Panter:
I think the documentation is rather vague about closing the underlying OS
socket. Can someone verify if the following is true (*asterisked* bits are my
additions), and maybe update the documentation?
socket.close(): Close the socket *object*. *The underlying
Martin Panter added the comment:
I think the fix for this bug only works if it gets the server to respond with a
“Connection: close” header itself. I opened Issue 19524 because I was seeing
keep-alive responses using chunked encoding that still trigger a socket leak.
--
nosy: +vadmium
Changes by Martin Panter :
--
nosy: +vadmium
___
Python tracker
<http://bugs.python.org/issue13797>
___
___
Python-bugs-list mailing list
Unsubscribe:
Martin Panter added the comment:
Here are two patches: a test case, and a fix for my issue. They were done
against an installed version of Python 3.3.3.
I’m not entirely happy with the fix because it is accessing the private
HTTPConnection.sock attribute from the urllib.request module, which
Changes by Martin Panter :
Added file: http://bugs.python.org/file33005/urlopen-sock-close.diff
___
Python tracker
<http://bugs.python.org/issue19524>
___
___
Python-bug
Martin Panter added the comment:
Confirmed that this happens when the server sends a chunked response, or sends
a Content-Length header, but not when the server just sends “Connection:
close”. So this looks like the same as Issue 19524, and my patch for that seems
to fix the issue here
Changes by Martin Panter :
--
nosy: +vadmium
___
Python tracker
<http://bugs.python.org/issue19842>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Martin Panter :
--
nosy: +vadmium
___
Python tracker
<http://bugs.python.org/issue13736>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Martin Panter :
--
nosy: +vadmium
___
Python tracker
<http://bugs.python.org/issue6631>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Martin Panter:
This isn’t a particularly important problem for me but when reading the code I
noticed some bit rot in this function, where a host name in a “file:” URL would
be handled differently than intended.
* The url[:2] == '//' check is probably wrong bec
Changes by Martin Panter :
--
nosy: +vadmium
___
Python tracker
<http://bugs.python.org/issue21793>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Martin Panter :
Added file: http://bugs.python.org/file35980/test2.patch
___
Python tracker
<http://bugs.python.org/issue19524>
___
___
Python-bugs-list mailin
Martin Panter added the comment:
Added a new test for the invalid response case. Now both tests are included in
test2.patch.
I separated the actual fix into a separate close3.4.patch (refreshed for the
3.4 branch). This way it is easier for me to make sure the tests work before
applying the
Martin Panter added the comment:
A file called “package/__main__.py” is executed as a script by “python -m
package”. See <https://docs.python.org/dev/library/__main__.html>.
I’ve came across this issue myself. You don’t even need the __main__.py file to
be doing anything special, as l
New submission from Martin Panter:
It looks like if you pass a “fileobj” argument to “gettarinfo”, it assumes it
can use the “name” as a text string.
>>> import tarfile
>>> with tarfile.open("/dev/null", "w") as tar, open("/bin/sh",
Martin Panter added the comment:
Opened Issue 21996 for the “gettarinfo” method.
Also, Serhiy, I think you may have got me mixed up with someone else. I don’t
think I did any patches here, so I probably shouldn’t be credited for them
Martin Panter added the comment:
I experimented with various redirections to /dev/null, files, and other
terminal windows on Linux. Current behaviour I am seeing seems to be something
like this:
* Prefers prompting to stderr if both stdout and stderr are terminals
* Prefers prompting to
Changes by Martin Panter :
--
nosy: +vadmium
___
Python tracker
<http://bugs.python.org/issue1152248>
___
___
Python-bugs-list mailing list
Unsubscribe:
Martin Panter added the comment:
For Posix (dunno about Windows), calling terminate or kill at the OS level
after a poll or wait has already succeeded is a bad idea, because the PID may
have been recycled. It is essentially operating on a released resource, similar
to calling “os.close” on a
Changes by Martin Panter :
--
nosy: +vadmium
___
Python tracker
<http://bugs.python.org/issue22021>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Martin Panter :
--
nosy: +vadmium
___
Python tracker
<http://bugs.python.org/issue1025395>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Martin Panter :
--
nosy: +vadmium
___
Python tracker
<http://bugs.python.org/issue11429>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Martin Panter :
--
nosy: +vadmium
___
Python tracker
<http://bugs.python.org/issue15986>
___
___
Python-bugs-list mailing list
Unsubscribe:
Martin Panter added the comment:
This issue was linked from
<https://mail.python.org/pipermail/python-dev/2012-September/121781.html>. I
was looking for ways to pass read-only memory views into “ctypes” without
copying memory, and came across that thread. Assuming this “buf” attribute
Martin Panter added the comment:
For the record, I have been (ab?)using the “c_char_p” type to get the address
of immutable byte strings without copying memory:
>>> from ctypes import *
>>> data = b"123\x00abc"
>>> pubyte = cast(c_char_p(data), POIN
Martin Panter added the comment:
Interesting that “cast” accepts a byte string. If this is intended behaviour,
it would be good to document that. Currently it says it takes “an object that
can be interpreted as a pointer”.
--
___
Python tracker
Changes by Martin Panter :
--
nosy: +vadmium
___
Python tracker
<http://bugs.python.org/issue6259>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Martin Panter :
--
nosy: +vadmium
___
Python tracker
<http://bugs.python.org/issue10803>
___
___
Python-bugs-list mailing list
Unsubscribe:
Martin Panter added the comment:
Here is the patch stripped of all the noise and the structure and union stuff,
so you can see just the changes related to arrays and pointers. However I have
not attempted to apply the patch, nor addressed Georg’s comment about the
“contents” attribute
Changes by Martin Panter :
--
nosy: +vadmium
___
Python tracker
<http://bugs.python.org/issue22123>
___
___
Python-bugs-list mailing list
Unsubscribe:
Martin Panter added the comment:
I could be wrong, but isn’t this error raised when expecting a response from
any command, not just during “connection establishment”? Perhaps change the
docstring to say something like “Connection closed unexpectedly” instead.
--
nosy: +vadmium
Changes by Martin Panter :
--
nosy: +vadmium
___
Python tracker
<http://bugs.python.org/issue19645>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Martin Panter :
--
nosy: +vadmium
___
Python tracker
<http://bugs.python.org/issue14534>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Martin Panter :
--
nosy: +vadmium
___
Python tracker
<http://bugs.python.org/issue11664>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Martin Panter:
The documentation for "unittest.TestCase" says "the standard implementation of
the default 'methodName', runTest(), will run every method starting with 'test'
as an individual test". However:
>>> from unitte
New submission from Martin Panter:
The only documentation on “createfilehandle” and friends that I can find looks
like it needs updating:
https://docs.python.org/release/3.4.0/faq/gui.html#can-i-have-tk-events-handled-while-waiting-for-i-o
I have been using the equivalent of this instead, for
Changes by Martin Panter :
--
title: Out of date code example for tkinter's createfilehandle -> Out of date
code example for tkinter's createfilehandler
___
Python tracker
<http://bugs.pytho
Martin Panter added the comment:
See Issue 22155 for fixing the createfilehandler FAQ documentation
--
nosy: +vadmium
___
Python tracker
<http://bugs.python.org/issue3
Martin Panter added the comment:
Just about the broken docs link: I was trying to find a permanent version of
the docs to link to. The usual docs page links to “Old versions”
<https://www.python.org/doc/versions/>, but top link there, 3.4.1, does not
seem to be ava
Changes by Martin Panter :
--
nosy: +vadmium
___
Python tracker
<http://bugs.python.org/issue22165>
___
___
Python-bugs-list mailing list
Unsubscribe:
Martin Panter added the comment:
This is more or less a dupe of Issue 6973, which also has a potential patch.
--
___
Python tracker
<http://bugs.python.org/issue17
Martin Panter added the comment:
It seems to me that raising OSError isn’t quite right. Either the error is more
of an internal programmer error, like how writing to a closed file object
raises ValueError, or there should not be an error, like when the process has
terminated but has not been
Changes by Martin Panter :
--
components: +Library (Lib) -Interpreter Core
___
Python tracker
<http://bugs.python.org/issue6973>
___
___
Python-bugs-list mailin
Martin Panter added the comment:
I ran into this today, trying to do “help(os)”. The workaround was to do
“import posix; help(posix)”.
--
nosy: +vadmium
___
Python tracker
<http://bugs.python.org/issue18
Changes by Martin Panter :
--
nosy: +vadmium
___
Python tracker
<http://bugs.python.org/issue22234>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Martin Panter :
--
nosy: +vadmium
___
Python tracker
<http://bugs.python.org/issue22239>
___
___
Python-bugs-list mailing list
Unsubscribe:
Martin Panter added the comment:
It looks like a fork of that how-to is actually part of the documentation:
<https://docs.python.org/release/3.4.0/howto/sorting.html>. Perhaps the two
should be linked better.
If “sorted” is indeed meant to be stable, that makes the docstring f
Martin Panter added the comment:
NNTPConnectError does still seem a slightly awkward name. I would go for
NNTPConnectionError instead, but I’m also happy to put my bikeshed paint away
let this patch be applied as is :)
Handling of NNTPTemporaryError with a code of 400 is similar to handling
New submission from Martin Panter:
The nntplib.NNTPError exception is documented, but missing from __all__. I ran
across another one the other day, but I can’t remember what it was now.
Is there a practical way to automatically test for some of these, perhaps by
scanning the documentation for
Martin Panter added the comment:
Some more points:
* I suggest adding something like this to the documentation:
exception nntplib.NNTPConnect[ion]Error
Exception raised when the server unexpectedly shuts down the connection.
* The tests should use BytesIO rather than StringIO. Other than
Martin Panter added the comment:
PPS: Documentation should probably have the “New in version 3.5” tag as well
--
___
Python tracker
<http://bugs.python.org/issue1186
Martin Panter added the comment:
Any reason why characters 1C–1E are excluded?
--
nosy: +vadmium
___
Python tracker
<http://bugs.python.org/issue12855>
___
___
Changes by Martin Panter :
--
nosy: +vadmium
___
Python tracker
<http://bugs.python.org/issue12067>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Martin Panter :
--
nosy: +vadmium
___
Python tracker
<http://bugs.python.org/issue21611>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Martin Panter :
--
nosy: +vadmium
___
Python tracker
<http://bugs.python.org/issue12319>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Martin Panter :
--
nosy: +vadmium
___
Python tracker
<http://bugs.python.org/issue12707>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Martin Panter :
--
nosy: +vadmium
___
Python tracker
<http://bugs.python.org/issue4733>
___
___
Python-bugs-list mailing list
Unsubscribe:
Martin Panter added the comment:
I think the patch is indeed a bit short, for instannce it looks like calling
read() without a size limit could bypass the decoding.
Also, I wonder if Content-Encoding handling is better done at a higher level.
What if someone wants to download a *.tar.gz file
Changes by Martin Panter :
--
nosy: +vadmium
___
Python tracker
<http://bugs.python.org/issue22253>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Martin Panter :
--
nosy: +vadmium
___
Python tracker
<http://bugs.python.org/issue17083>
___
___
Python-bugs-list mailing list
Unsubscribe:
Martin Panter added the comment:
Related:
* Issue 563491: 2002 proposal for parameter to readline, rejected at the time
* Issue 17083: Newline is hard coded for binary file readline
Fixing this issue for binary files would probably also satisfy Issue 17083
Martin Panter added the comment:
Agreed, this issue is not a duplicate of the marked “gzip” seek issue, however
it _does_ duplicate Issue 1508475.
--
___
Python tracker
<http://bugs.python.org/issue1243
Martin Panter added the comment:
Related: Issue 1243678, which includes a patch for “httplib” (now known as
“http.client”?). That patch looks like it sets Accept-Encoding and decodes
according to Content-Encoding. However I suspect it is also trying to be too
“transparent” at the wrong level
Martin Panter added the comment:
With this patch, there is no longer any implication that the returned object
implements the “addinfourl” interface. Perhaps that should be added back. Or
maybe add it to the HTTPResponse class documentation itself? There is a comment
that says the methods are
New submission from Martin Panter:
This is regarding the Python 3 documentation for binascii.crc32(),
<https://docs.python.org/dev/library/binascii.html#binascii.crc32>. It
repeatedly recommends correcting the sign by doing crc32() & 0x, but it
is not immediately clear why.
Changes by Martin Panter :
--
nosy: +vadmium
___
Python tracker
<http://bugs.python.org/issue19280>
___
___
Python-bugs-list mailing list
Unsubscribe:
Martin Panter added the comment:
See also <https://bugs.python.org/issue6626#msg91205>, which mentions using a
list of tuples instead of a dictionary, which sounds like it might help with
this issue. Doing it that way you might be able avoid some duplication in the
lists.
-
New submission from Martin Panter:
The documentation says that guess_type() takes a URL, but:
>>> mimetypes.guess_type("http://example.com";)
('application/x-msdownload', None)
I suspect the MS download is a reference to *.com files (like DOS's
command.com).
Martin Panter added the comment:
The point about “a != b” deferring to “not a.__eq__(b)” is not documented
anywhere that I am aware of. In fact the opposite is currently documented at
<https://docs.python.org/release/3.4.0/reference/datamodel.html#richcmpfuncs>,
so maybe this needs
New submission from Martin Panter:
The following code triggers an NNTPProtocolError, as long as the body is large
enough to cause an intermediate flush of the output file. The reason I think is
that the body() method aborts in the middle of reading the BODY response, and
when the context
Martin Panter added the comment:
Perhaps this is similar to Issue 22350 which I just raised. Whenever the NNTP
context manager exits, a QUIT command is called, and if the context manager is
exiting due to a protocol error or some other exception not handled by the
protocol, the code will try
New submission from Martin Panter:
If the nntplib.NNTP constructor fails, it often leaves the connection and
socket open until the garbage collector cleans them up and emits a
ResourceWarning:
>>> try:
... NNTP("localhost")
... except Exception as err:
...
Martin Panter added the comment:
Stream reader interfaces suffer the same problem. Test cases:
codecs.getreader("unicode-escape")(BytesIO(br"\u2013")).read(1)
codecs.getreader("hex-codec")(BytesIO(b"33")).read(1)
codecs.getreader("base64-codec"
Martin Panter added the comment:
The corresponding stream reader has a related issue which I mentioned in Issue
20132
--
___
Python tracker
<http://bugs.python.org/issue13
Martin Panter added the comment:
Even if all these issues aren’t worth fixing, I think the documentation should
at least say which codecs work fully (e.g. most text encodings), which ones
work suboptimally (e.g. UTF-7), and which ones only work for single-shot
encoding and decoding
Martin Panter added the comment:
I wrote some code that does something like this for a hacky custom readline
completer. See the import_list() method at
<https://github.com/vadmium/etc/blob/6ac333f/python/pythonstartup.py#L222>. It
looks like I’m using a combinat
Martin Panter added the comment:
If people are worried about the best low-level decompressor API, maybe leave
that as a future enhancement, and just rely on using the existing file reader
APIs. I would expect them to have a sensible decompressed buffer size limit,
however “bzip2” and LZMA
Martin Panter added the comment:
You should probably use try / finally in your context manager to always restore
the attribute. Having said that, I recently wrote a similar context manager,
and then later discovered there is already “unittest.mock.patch” and/or
“unittest.mock.patch.object
Changes by Martin Panter :
--
nosy: +vadmium
___
Python tracker
<http://bugs.python.org/issue16830>
___
___
Python-bugs-list mailing list
Unsubscribe:
Martin Panter added the comment:
By removing the “addinfourl” methods for HTTP responses, you are making it
unnecessarily hard to handle header fields and metadata from the response. I do
not know of any other documented way of getting the eventual redirect target,
other than geturl(). And
Martin Panter added the comment:
Fair enough, challenge accepted! Here is my attempt. I have explicitly made the
info(), geturl() and getcode() methods available for all cases, and used
Evens’s wording for the modified “msg” attribute, but dropped mentioning the
“url” attribute
Martin Panter added the comment:
Although it is not documented, inspect.getdoc() may return None instead of a
documentation string. In patch 2, inspect.splitdoc() only accepts a string;
perhaps it should also accept None? Otherwise you might have to use it like
this:
[summary, body
New submission from Martin Panter:
The handler for the “Trailing garbage” error for “uu-codec” uses Python 2 code,
while the copy in the "uu” module has the correct Python 3 code.
Please change the line at
https://hg.python.org/cpython/file/775453a7b85d/Lib/encodings/uu_codec.py#l57
to
New submission from Martin Panter:
I noticed that the newline translation in the io.StringIO class does not behave
as I would expect:
>>> text = "NL\n" "CRLF\r\n" "CR\r" "EOF"
>>> s = StringIO(text, newline="\r\n")
>>
Martin Panter added the comment:
Some more use cases for temporarily switching error handler in the middle of
writing to a stream:
* Possibly simplify the implementation of sys.displayhook()
* I have done a similar hack at
<https://bitbucket.org/Gfy/pyrescene/comm
Changes by Martin Panter :
Added file: http://bugs.python.org/file36619/uu_codec
___
Python tracker
<http://bugs.python.org/issue22406>
___
___
Python-bugs-list mailin
Martin Panter added the comment:
Here are two patches: a test and a fix. I’m not sure if it is okay to add a
test for the “codecs” module with the tests for the “uu” module; it was easier
that way because I am basically running the same test over the two different
APIs.
--
Added file
Changes by Martin Panter :
--
nosy: +vadmium
___
Python tracker
<http://bugs.python.org/issue22431>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Martin Panter:
Bind method may easily fail on Unix if there is no permission to bind to a
privileged port:
>>> try: TCPServer(("", 80), ...)
... except Exception as err: err
...
PermissionError(13, 'Permission denied')
>>> gc.collect()
Martin Panter added the comment:
My original demonstration was distilled from a real world case. I get this
issue with other real world cases too, so I am expanding the title to reflect
what I think is going on. This problem seems to be caused by a ResourceWarning
triggered from a garbage
Martin Panter added the comment:
I suspect the $PATH example is a bad example. On my Linux setup, my initial
PATH value is a customized path. After popping it and calling system(), I see a
simpler default path, which is probably re-initialized somewhere else.
I suspect there is no environ.pop
Changes by Martin Panter :
--
nosy: +vadmium
___
Python tracker
<http://bugs.python.org/issue1159>
___
___
Python-bugs-list mailing list
Unsubscribe:
601 - 700 of 4320 matches
Mail list logo