[issue21071] struct.Struct.format is bytes, but should be str

2014-12-17 Thread Martin Panter
Martin Panter added the comment: I originally assumed it would be a text string from the existing documentation, so changing the behaviour to match also seems reasonable -- ___ Python tracker <http://bugs.python.org/issue21

[issue19548] 'codecs' module docs improvements

2014-12-17 Thread Martin Panter
Martin Panter added the comment: Here is a patch addressing many of the points raised. Please have a look and give any feedback. Beware I am not very familiar with the Restructured Text markup and haven’t tried compiling it. 1. Mentioned bytes-to-bytes and text-to-text in general right at the

[issue20132] Many incremental codecs don’t handle fragmented data

2014-12-17 Thread Martin Panter
Martin Panter added the comment: The “unicode-escape” and “utf-7” cases affect the more widely-used TextIOWrapper interface: >>> TextIOWrapper(BytesIO(br"\u2013" * 2000), "unicode-escape").read(1) Traceback (most recent call last): File "", line 1, i

[issue19539] The 'raw_unicode_escape' codec buggy + not appropriate for Python 3.x

2014-12-17 Thread Martin Panter
Martin Panter added the comment: I included the proposed doc fix in my patch for Issue 19548 -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue19

[issue23071] codecs.__all__ incomplete

2014-12-17 Thread Martin Panter
Martin Panter added the comment: Here is the patch (against the default branch) -- keywords: +patch Added file: http://bugs.python.org/file37486/codecs-all.patch ___ Python tracker <http://bugs.python.org/issue23

[issue23062] test_argparse --version test cases

2014-12-17 Thread Martin Panter
Martin Panter added the comment: Patch looks sensible enough to me -- ___ Python tracker <http://bugs.python.org/issue23062> ___ ___ Python-bugs-list mailin

[issue21279] str.translate documentation incomplete

2014-12-17 Thread Martin Panter
Martin Panter added the comment: Here is a new patch based on John’s suggestion -- Added file: http://bugs.python.org/file37487/issue21279.patch ___ Python tracker <http://bugs.python.org/issue21

[issue21071] struct.Struct.format is bytes, but should be str

2014-12-17 Thread Martin Panter
Martin Panter added the comment: Here is a patch that changes over to a str() type. Is it safe to assume PyUnicode_AsUTF8() is null-terminated (like PyBytes_AS_STRING() is)? My documentation doesn’t say. -- Added file: http://bugs.python.org/file37488/format-str.patch

[issue16349] Document whether it's safe to use bytes for struct format string

2014-12-17 Thread Martin Panter
Martin Panter added the comment: Assuming it is intended to support byte strings, here is a patch that documents them being allowed, and adds a test case -- keywords: +patch Added file: http://bugs.python.org/file37489/format-bytes.patch ___ Python

[issue19176] DeprecationWarning for doctype() method when subclassing _elementtree.XMLParser

2014-12-17 Thread Martin Panter
Martin Panter added the comment: Here is another patch that removes the method instead, as suggested in the review -- Added file: http://bugs.python.org/file37490/doctype-remove.patch ___ Python tracker <http://bugs.python.org/issue19

[issue23071] codecs.__all__ incomplete

2014-12-17 Thread Martin Panter
Martin Panter added the comment: This patch includes a new test; although this kind of testing won’t detect when someone adds a new API and forgets to add it to __all__. -- Added file: http://bugs.python.org/file37491/codecs-all.patch ___ Python

[issue23001] Accept mutable bytes-like objects

2014-12-18 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue23001> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22350] nntplib file write failure causes exception from QUIT command

2014-12-18 Thread Martin Panter
Martin Panter added the comment: Here is a patch with a fix and a test -- keywords: +patch Added file: http://bugs.python.org/file37501/fail-close.patch ___ Python tracker <http://bugs.python.org/issue22

[issue23088] Document that PyUnicode_AsUTF8() returns a null-terminated string

2014-12-18 Thread Martin Panter
New submission from Martin Panter: As discussed in msg232863, and later confirmed in the code -- assignee: docs@python components: Documentation files: utf8-null.patch keywords: patch messages: 232925 nosy: docs@python, vadmium priority: normal severity: normal status: open title

[issue22341] Python 3 crc32 documentation clarifications

2014-12-18 Thread Martin Panter
Martin Panter added the comment: Here is a patch that fixes the binascii, zlib.crc32() and adler32() documentation as I suggested. I’m still interested why there are two ways to do a CRC-32, each equally non-obvious as the other. -- keywords: +patch Added file: http://bugs.python.org

[issue9694] argparse required arguments displayed under "optional arguments"

2014-12-18 Thread Martin Panter
Martin Panter added the comment: Updated my patch with a “version changed” notice -- Added file: http://bugs.python.org/file37505/option-internal.patch ___ Python tracker <http://bugs.python.org/issue9

[issue22896] Don't use PyObject_As*Buffer() functions

2014-12-19 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue22896> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22836] Broken "Exception ignored in:" message on exceptions in __repr__

2014-12-19 Thread Martin Panter
Martin Panter added the comment: Here is a patch that substitutes an explanation if the repr() fails. Output now looks like this, terminated with a newline: === BrokenObj === Exception ignored in: Traceback (most recent call last): File "", line 3, in __del__ Exception: in del $ .

[issue5319] stdout error at interpreter shutdown fails to return OS error status

2014-12-19 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue5319> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue5319] stdout error at interpreter shutdown fails to return OS error status

2014-12-20 Thread Martin Panter
Martin Panter added the comment: Here is a patch that changes Py_Finalize() to return -1 on error, and then sets the exit status to 1. It did not introduce any failures in the test suite for me. However I suspect it deserves more consideration about backwards compatibility etc, which is

[issue22671] Typo in class io.BufferedIOBase docs

2014-12-20 Thread Martin Panter
Martin Panter added the comment: The documentation was technically correct but too scanty. RawIOBase.read(-1) does defer to readall(), but with a proper size passed, it defers to readinto() instead. Here is a patch which hopefully clarifies this, and also explains which methods have a usable

[issue23093] repr() on detached stream objects fails

2014-12-20 Thread Martin Panter
New submission from Martin Panter: Patch to fix the underlying issue I mentioned in msg230955. After calling detach() on one of the BufferedIOBase wrappers or a TextIOWrapper, most operations will raise an exception. My patch ensures the following operations are still usable, because they are

[issue1763] Get path to shell/known folders on Windows

2014-12-20 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue1763> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23093] repr() on detached stream objects fails

2014-12-20 Thread Martin Panter
Martin Panter added the comment: Damn, detaching the intermediate buffered stream is a bit more awkward. The difference between the “io” and “_pyio” implementations boils down to: * io.BufferedReader/Writer/RWPair.name properties raise a ValueError if the stream is detached * _pyio

[issue12600] Add example of using load_tests to parameterise Test Cases

2014-12-20 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue12600> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue7897] Support parametrized tests in unittest

2014-12-20 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue7897> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22673] document the special features (eg: fdclose=False) of the standard streams

2014-12-20 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue22673> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue19051] Unify buffered readers

2014-12-20 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue19051> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12053] Add prefetch() for Buffered IO (experiment)

2014-12-20 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue12053> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22854] Documentation/implementation out of sync for IO

2014-12-20 Thread Martin Panter
Martin Panter added the comment: Some of the docstrings already mention UnsupportedOperation. This patch updates the rest of the documentation. Also adds some tests to verify this on all the concrete classes I could think of. Some discoveries in the process: * BufferedWriter.readable() and

[issue21279] str.translate documentation incomplete

2014-12-21 Thread Martin Panter
Martin Panter added the comment: Patch v4 with John’s doc string wording -- Added file: http://bugs.python.org/file37522/issue21279.v4.patch ___ Python tracker <http://bugs.python.org/issue21

[issue23093] repr() on detached stream objects fails

2014-12-21 Thread Martin Panter
Martin Panter added the comment: Here is patch v2, which ignores any exception derived from the Exception base class when reading the self.name etc properties. I’m interested what people think of this approach. -- Added file: http://bugs.python.org/file37523/detach-indep.v2.patch

[issue21279] str.translate documentation incomplete

2014-12-21 Thread Martin Panter
Martin Panter added the comment: Serhiy can you point out which bits are too verbose? Perhaps you prefer it without the bullet list like in the earlier 2014-12-13 version of the patch. Looking at the C API, I see a couple problems there: * Omits mentioning that an ordinal can map to a

[issue6294] Improve shutdown exception ignored message

2014-12-21 Thread Martin Panter
Martin Panter added the comment: Not sure what the original method to cause this message is. I’m guessing some code was trying to call a function that was set to None by the shutdown process, causing the exception message, and that repr() was also failing, causing the broken wording. Like

[issue22836] Broken "Exception ignored in:" message on exceptions in __repr__

2014-12-21 Thread Martin Panter
Martin Panter added the comment: Patch v2 revises the unit tests so they are cleaner. Also now tests that the placeholders are in the exception reports. -- Added file: http://bugs.python.org/file37524/unraisable-continue.v2.patch ___ Python tracker

[issue19539] The 'raw_unicode_escape' codec buggy + not appropriate for Python 3.x

2014-12-21 Thread Martin Panter
Martin Panter added the comment: [Edit Error: 'utf8' codec can't decode byte 0xe2 in position 212: invalid continuation byte] Re-reading the suggested description, it struck me that for encoding, this is redundant with the “backslashreplace” error handler: >>> test

[issue23099] BytesIO and StringIO values unavailable when closed

2014-12-22 Thread Martin Panter
New submission from Martin Panter: IOBase.close() doc says file operations raise ValueError, but it is not obvious to me that reading back the “file” buffer is a file operation. >>> with BytesIO() as b: ... b.write(b"123") ... 3 >>> b.getvalue() Traceback (mo

[issue19548] 'codecs' module docs improvements

2014-12-22 Thread Martin Panter
Martin Panter added the comment: Adding patch v2 after learning how to compile the docs and fixing my errors. I also simplified the descriptions of the CodecInfo attributes by defering the constructor signatures to where they are fully defined under “Codec base classes”, and merged the list

[issue21279] str.translate documentation incomplete

2014-12-22 Thread Martin Panter
Martin Panter added the comment: The problem with mappings and sequences is that they both require len() and iter() implementations, but str.translate() only requires __getitem__(). Perhaps a qualifier could work, like: The table must implement the __getitem__() method of mappings and

[issue22671] Typo in class io.BufferedIOBase docs

2014-12-22 Thread Martin Panter
Martin Panter added the comment: Adding patch v2 with readinto1() as a “mixin method” and dropped many of my earlier changes for better consistency with the introduction of the classes (which I never really read before :P) -- Added file: http://bugs.python.org/file37528/read

[issue19548] 'codecs' module docs improvements

2014-12-22 Thread Martin Panter
Martin Panter added the comment: New patch version addressing many of the comments; thanks for reviewing! Also adds and extends some unit tests to confirm some of the corner cases I am documenting. -- Added file: http://bugs.python.org/file37530/codecs-doc.v3.patch

[issue23135] import searchpaths as arguments

2014-12-31 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue23135> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23134] datetime.strptime at the turn of the year

2014-12-31 Thread Martin Panter
Martin Panter added the comment: Issue 23136 looks like a duplicate, but has a potential patch -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue23

[issue22680] Blacklist FunctionTestCase from test discovery

2014-12-31 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue22680> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22680] Blacklist FunctionTestCase from test discovery

2014-12-31 Thread Martin Panter
Martin Panter added the comment: Assuming that FunctionTestCase inherits from TestCase, a fix for Issue 14534 would be useful here. That bug is about avoiding TestCase subclasses being automatically run, which is useful for abstract base test classes

[issue23142] Integration of unittest.FunctionTestCase with automatic discovery and loading

2014-12-31 Thread Martin Panter
New submission from Martin Panter: It is not clear how you are meant to use unittest.FunctionTestCase with automatic test running. Unless a simple way to do this already exists, I wonder if it would be okay to automatically discover and run predefined test instances, such as the

[issue23144] html.parser.HTMLParser: setting 'convert_charrefs = True' leads to dropped text

2015-01-01 Thread Martin Panter
Martin Panter added the comment: You “forgot” to call close(): >>> parser.close() Encountered some data : eggs Perhaps this is a documentation bug, since there is a lot of example code given, but none of the examples call close(). -- assignee: -> docs@pytho

[issue13248] deprecated in 3.2/3.3, should be removed in 3.5 or ???

2015-01-01 Thread Martin Panter
Martin Panter added the comment: See Issue 19167 for a patch to remove the xml.etree.XMLParser.doctype() method. I’m happy for it to be removed, since the logic for generating the DeprecationWarning is buggy. -- nosy: +vadmium ___ Python tracker

[issue13248] deprecated in 3.2/3.3, should be removed in 3.5 or ???

2015-01-01 Thread Martin Panter
Martin Panter added the comment: Make that Issue 19176 for XMLParser.doctype() -- ___ Python tracker <http://bugs.python.org/issue13248> ___ ___ Python-bugs-list m

[issue22128] patch: steer people away from codecs.open

2015-01-02 Thread Martin Panter
Martin Panter added the comment: Just pointing out there is a patch for Issue 19548 for Python 3 which also adds a pointer to the builtin open() function and updates the codecs.open() caveats. That issue doesn’t touch Python 2 though. -- nosy: +vadmium

[issue23161] collections.abc.MutableSet missing methods

2015-01-04 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue23161> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23161] collections.abc.MutableSet missing methods

2015-01-04 Thread Martin Panter
Martin Panter added the comment: For what it’s worth, every now and then I have to stop and remember that I can’t do this sort of thing: unsupported_keys = config_dict.keys().difference(supported_list) though it is not a big problem to rewrite it as unsupported_keys = config_dict.keys

[issue13248] deprecated in 3.2/3.3, should be removed in 3.5 or ???

2015-01-04 Thread Martin Panter
Martin Panter added the comment: Another one to deal with one way or the other: html.parser.HTMLParser.unescape() It is apparently due to be removed in 3.5. It was meant to be an undocumented internal function, and there is now an public alternative. However I would be inclined to leave it

[issue23001] Accept mutable bytes-like objects

2015-01-04 Thread Martin Panter
Martin Panter added the comment: If this goes ahead, it would be nice adding notes to the documentation saying that bytearray() or whatever was previously not supported. There are APIs in Python 2.6 that had similar treatment with no documentation updates, and I keep being bitten by it

[issue19548] 'codecs' module docs improvements

2015-01-05 Thread Martin Panter
Martin Panter added the comment: Adding patch v5, for the 3.4 branch. There is at least one reference that still needs fixing in the default branch that is not applicable to the 3.4 branch. Main changes from Nick’s patch: * Removed sentence now redundant with introduction to open() and

[issue23099] BytesIO and StringIO values unavailable when closed

2015-01-05 Thread Martin Panter
Martin Panter added the comment: Updated patch, to also document the BytesIO buffer is no longer available when closed. The StringIO documentation actually already says this, but I rarely use StringIO. :) -- Added file: http://bugs.python.org/file37611

[issue19548] 'codecs' module docs improvements

2015-01-06 Thread Martin Panter
Martin Panter added the comment: Thanks Nick. Here is a small followup patch for the default (3.5) branch to keep things consistent. -- Added file: http://bugs.python.org/file37618/default-branch-followup.patch ___ Python tracker <h

[issue15955] gzip, bz2, lzma: add option to limit output size

2015-01-08 Thread Martin Panter
Martin Panter added the comment: It turns out that GzipFile.read() etc is also susceptible to decompression bombing. Here is a patch to test and fix that, making use of the existing “max_length” parameter in the “zlib” module. -- Added file: http://bugs.python.org/file37644/gzip

[issue23200] Clarify max_length and flush() for zlib decompression

2015-01-08 Thread Martin Panter
New submission from Martin Panter: This simple patch documents that max_length has to be non-zero. The implementation actually uses zero as a special value to indicate max_length was not specified. Also, I wonder what the point of the Decompressor.flush() method is. Reading the module code

[issue23200] Clarify max_length and flush() for zlib decompression

2015-01-08 Thread Martin Panter
Martin Panter added the comment: The processing of unconsumed_tail in flush() was introduced via Issue 16411. Before that I suspect flush() was assumed to only be called when max_length was not used. The decompress() method changed from Z_NO_FLUSH to Z_SYNC_FLUSH in Feb 2001; see revision

[issue19051] Unify buffered readers

2015-01-09 Thread Martin Panter
Martin Panter added the comment: For what it’s worth, it would be better if compressed streams did limit the amount of data they decompressed, so that they are not susceptible to decompression bombs; see Issue 15955. But having a flexible-sized buffer could be useful in other cases. I

[issue17003] Unification of read() and readline() argument names

2015-01-09 Thread Martin Panter
Martin Panter added the comment: Is there anything left for this bug or could it be closed? I can confirm my v3.4.2 docs say “size” instead of “n” :) -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue17

[issue5811] io.BufferedReader.peek(): Documentation differs from Implementation

2015-01-09 Thread Martin Panter
Martin Panter added the comment: Is the current documentation as accurate as it can be? “The number of bytes returned may be less or more than requested” To me this has always made this method practically useless. A valid implementation could just always return b"". I noticed the BZ

[issue23214] BufferedReader.read1(size) signature incompatible with BufferedIOBase.read1(size=-1)

2015-01-09 Thread Martin Panter
New submission from Martin Panter: I am trying to make LZMAFile (which implements BufferedIOBase) use a BufferedReader in read mode. However this broke test_lzma.FileTestCase.test_read1_multistream(), which calls read1() with the default size argument. This is because BufferedReader.read1

[issue23213] subprocess communicate() hangs when stderr isn't closed

2015-01-09 Thread Martin Panter
Martin Panter added the comment: I suspect this is not a bug but a misunderstanding of how communiate(), pipes, daemon processes, etc, work. If communicate() didn’t wait for stderr to be closed, then how would it know it had read all the data that was written into the pipe? I don’t have that

[issue15955] gzip, bz2, lzma: add option to limit output size

2015-01-09 Thread Martin Panter
Martin Panter added the comment: Here is a patch for the higher-level LZMAFile implementation to use Nikolaus’s “max_length” parameter. It depends on Nikolaus’s patch also being applied. I split out a _RawReader class that does the actual decompress() calls, and then wrapped that in a

[issue5811] io.BufferedReader.peek(): Documentation differs from Implementation

2015-01-09 Thread Martin Panter
Martin Panter added the comment: Here is a simple documentation patch to guarantee that at least one byte is normally returned. This would make the method much more useful, and compatible with the BZ2File and LZMAFile interfaces, allowing them to use BufferedReader, as I propose to do in

[issue20699] Behavior of ZipFile with file-like object and BufferedWriter.

2015-01-09 Thread Martin Panter
Martin Panter added the comment: I think the simplest thing to do here would be to update the documentation to match the usage. This patch does so, saying that all write() methods, as well as the BytesIO() constructor, have to accept bytes-like objects. It also expands some tests to verify

[issue19051] Unify buffered readers

2015-01-10 Thread Martin Panter
Martin Panter added the comment: Parts of the patch here actually do the same thing as my LZMAFile patch for Issue 15955. I wish I had looked at the patch earlier! The difference is I used a proposed max_length parameter for the decompressor rather than unlimited decompression, and I used the

[issue21408] delegation of `!=` to the right-hand side argument is not always done

2015-01-10 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue21408> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue21408] delegation of `!=` to the right-hand side argument is not always done

2015-01-10 Thread Martin Panter
Martin Panter added the comment: There is a bit of analysis of the object.__ne__() implementation in Issue 4395. If my understanding is correct, I think it is a bug that object.__ne__(self, other) evaluates “not self == other”. It should evaluate “not self.__eq__(other)” instead, so that

[issue23220] IDLE does not display \b backspace correctly.

2015-01-10 Thread Martin Panter
Martin Panter added the comment: As far as I understand, Idle doesn’t interpret any terminal control codes apart from a plain \n for a new line. I know it doesn’t do a carriage return for \r either. -- components: +IDLE nosy: +vadmium ___ Python

[issue4395] Document auto __ne__ generation; provide a use case for non-trivial __ne__

2015-01-10 Thread Martin Panter
Martin Panter added the comment: Here is a patch that documents the default object.__ne__() implementation. It also documents the subclass priority rules for the reflected comparison methods, which is raised in Issue 22052. I have made some more tests to verify the relationships exists from

[issue22052] Comparison operators called in reverse order for subclasses with no override.

2015-01-10 Thread Martin Panter
Martin Panter added the comment: I have included some rules about the priority for calling reflected operator methods in my patch to Issue 4395 -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue22

[issue21408] delegation of `!=` to the right-hand side argument is not always done

2015-01-10 Thread Martin Panter
Martin Panter added the comment: This patch should fix the problem I think. Before the __ne__() implementation was calling the “==” operator; now it calls the __eq__() method instead. Also includes extra test for Issue 4395 to avoid having conficting patches. -- keywords: +patch Added

[issue23214] BufferedReader.read1(size) signature incompatible with BufferedIOBase.read1(size=-1)

2015-01-11 Thread Martin Panter
Martin Panter added the comment: Looking at the test suite: * read1() of LZMAFile and GzipFile (both implementing BufferedIOBase) are asserted to return a non-zero result until EOF * LZMAFile.read1(0) is asserted to return an empty string * BufferedReader.read1(-1) is asserted to raise

[issue15955] gzip, bz2, lzma: add option to limit output size

2015-01-11 Thread Martin Panter
Martin Panter added the comment: We still need a patch for max_length in BZ2Decompressor, and to use it in BZ2File. Also, I think my GzipFile patch should be considered as a bug fix (rather than enhancement), e.g. the fix for Issue 16043 assumes GzipFile.read() is limited. I’m adding v4 of

[issue17239] XML vulnerabilities in Python

2015-01-11 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue17239> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23224] LZMADecompressor object is only initialized in __init__

2015-01-11 Thread Martin Panter
New submission from Martin Panter: Noticed in a patch review around LZMModules/_lzmamodule.c:1055 that the C-level LZMADecompressor object is being initialized in an __init__() method. It crashes if you create the object with __new__() and never call __init__(): >>> from lz

[issue21896] Unexpected ConnectionResetError in urllib.request against a valid website

2015-01-11 Thread Martin Panter
Martin Panter added the comment: Not a Python bug. The web site seems to be doing this based on the user agent; if you change it, it works: urlopen(Request("http://www.thomsonlocal.com/";, headers={"User-Agent": "https://bugs.python.org/issue21896"})) ---

[issue18003] lzma module very slow with line-oriented reading.

2015-01-11 Thread Martin Panter
Martin Panter added the comment: I haven’t done any tests, but my LZMAFile patch to Issue 15955 uses BufferedReader, so it might satisfy this issue -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue18

[issue22495] merge large parts of test_binop.py and test_fractions.py

2015-01-11 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue22495> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22495] merge large parts of test_binop.py and test_fractions.py

2015-01-11 Thread Martin Panter
Martin Panter added the comment: Yeah it would be good to put related tests in the one place. I was trying to find a good place to test how the comparison operators invoke the __eq__(), __gt__() etc methods, and the existing tests seem to be spread over test_compare.py and test_binop.py

[issue20285] Improve object.__doc__ and help(object) output

2015-01-11 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue20285> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22662] subprocess.Popen.communicate causing local tty terminal settings to change inconsistently

2015-01-11 Thread Martin Panter
Martin Panter added the comment: I tried in Python 2.7.9 on Linux, with env = "TERM=xterm", cmd = "date", and couldn’t get any of those seven terminal settings to be turned off -- nosy: +vadmium ___ Python tracker <http://bug

[issue22977] Unformatted “Windows Error 0x%X” exception message on Wine

2015-01-11 Thread Martin Panter
Martin Panter added the comment: Here’s a simple patch which should fix it, although I have not verified this because I don’t have a Windows compiler (and MINGW cross compiling sounds too tricky) -- keywords: +patch Added file: http://bugs.python.org/file37678/win-error-format.patch

[issue22286] Allow backslashreplace error handler to be used on input

2015-01-12 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue22286> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue15836] unittest assertRaises should verify excClass is actually a BaseException class

2015-01-12 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue15836> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue9587] unittest.assertRaises() return the raised exception

2015-01-12 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue9587> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22977] Unformatted “Windows Error 0x%X” exception message on Wine

2015-01-12 Thread Martin Panter
Martin Panter added the comment: This patch includes a test case, based on Eryksun’s exception code -- Added file: http://bugs.python.org/file37686/win-error-format-v2.patch ___ Python tracker <http://bugs.python.org/issue22

[issue23224] LZMADecompressor object is only initialized in __init__

2015-01-12 Thread Martin Panter
Martin Panter added the comment: A patch for this might conflict with the LZMA patch for Issue 15955, so it would be simplest to wait for that issue to be resolved first -- ___ Python tracker <http://bugs.python.org/issue23

[issue10552] Tools/unicode/gencodec.py error

2015-01-12 Thread Martin Panter
Martin Panter added the comment: Here is a new version of Kuchling’s patch. I restored some mapping files which do not give any errors (including the mac_turkish codec, which is actually documented), and removed both readme files. -- components: +Unicode nosy: +haypo, vadmium versions

[issue20739] PEP 463 (except expression) implementation

2015-01-13 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue20739> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23231] Fix codecs.iterencode/decode() by allowing data parameter to be omitted

2015-01-13 Thread Martin Panter
New submission from Martin Panter: As mentioned in Issue 20132, iterencode() and iterdecode() only work on text-to-byte codecs, because they assume particular data types when finalizing the incremental codecs. This patch changes the signature of the IncrementalEncoder and IncrementalDecoder

[issue23231] Fix codecs.iterencode/decode() by allowing data parameter to be omitted

2015-01-13 Thread Martin Panter
Martin Panter added the comment: Original patch has lots of whitespace changes, probably due to generated codec code not being regenerated for a long time. This diff ignores the space changes, so should be easier to review. -- Added file: http://bugs.python.org/file37692/final-no

[issue23232] 'codecs' module functionality + its docs -- concerning custom codecs, especially non-string ones

2015-01-13 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue23232> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12160] codecs doc: what is StreamCodec?

2015-01-13 Thread Martin Panter
Martin Panter added the comment: This patch looks simple and uncontroversial. I think it could be merged. -- nosy: +vadmium versions: +Python 3.4 ___ Python tracker <http://bugs.python.org/issue12

[issue13881] Stream encoder for zlib_codec doesn't use the incremental encoder

2015-01-13 Thread Martin Panter
Martin Panter added the comment: See Issue 23231 for a proposal which should make the incremental codec API compatible with a generic StreamReader/Writer class. I discovered that many of the codec files are generated by gencodec.py, not hand-written. However when I tried regenerating them, I

[issue14014] codecs.StreamWriter.reset contract not fulfilled

2015-01-13 Thread Martin Panter
Martin Panter added the comment: I don’t think this is appropriate. If you want to flush the underlying stream, then call its flush() method after calling reset(). The docstring only says it flushes the _codec’s_ buffers, not any buffers of the underlying stream, and it should not be the

[issue23234] refactor subprocess: use new OSError exceptions, factorize stdin.write() code

2015-01-13 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue23234> ___ ___ Python-bugs-list mailing list Unsubscribe:

<    12   13   14   15   16   17   18   19   20   21   >