[issue21872] LZMA library sometimes fails to decompress a file

2014-06-28 Thread Esa Peuha
Esa Peuha added the comment: This code import _lzma with open('22h_ticks_bad.bi5', 'rb') as f: infile = f.read() for i in range(8191, 8195): decompressor = _lzma.LZMADecompressor() first_out = decompressor.decompress(infile[:i]) first_len = len(first_out) last_out

[issue21876] os.rename(src, dst) does nothing when src and dst files are hard-linked

2014-06-27 Thread Esa Peuha
Esa Peuha added the comment: This looks like a documentation bug. Functions in module os are usually just thin wrappers around the underlying OS functions, and POSIX states that doing nothing is the correct thing to do here. (It is arguably a bug in early Unix implementations that got

[issue19335] codeop misclassifies incomplete code with 'nonlocal'

2013-10-22 Thread Esa Peuha
Esa Peuha added the comment: Someone needs to compare _maybe_compile to the equivalent C code used by the real interpreter. Well, _maybe_compile() just calls the built-in function compile() internally, so I'm not sure what sort of comparison you want... -- nosy: +Esa.Peuha title

[issue19325] _osx_support imports many modules

2013-10-22 Thread Esa Peuha
Esa Peuha added the comment: Actually Lib/_osx_support.py directly imports only five modules: os, re and sys at top level, and contextlib and tempfile in _read_output(). These last two aren't really needed at all, and there's no point even trying to avoid importing os and sys, so the only

[issue18650] intermittent test_pydoc failure on 3.4.0a1

2013-10-21 Thread Esa Peuha
Esa Peuha added the comment: The problem seems to be /Users/pyi/Library/Python/3.4/lib/python/site-packages/setuptools-0.9.8-py3.4.egg according to the error page. What is that file? The fact that the second run of the test succeeds implies that it could be a temporary file which

[issue19275] test_site is failing on AMD64 Snow Leopard

2013-10-17 Thread Esa Peuha
Esa Peuha added the comment: Apparently related to issue 19205 and issue 19209. Looks like _osx_support imports re which imports copyreg. -- nosy: +Esa.Peuha ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19275

[issue19275] test_site is failing on AMD64 Snow Leopard

2013-10-17 Thread Esa Peuha
Esa Peuha added the comment: Just by looking at the code, there still seems to be a problem: test_site.py was changed in 0b6052f2a8ee to test that the collections module isn't imported, but due to a bug it (re)tests the re module instead (re_mods needs to be changed to collection_mods

[issue19246] GC does not really free up memory in console

2013-10-14 Thread Esa Peuha
Esa Peuha added the comment: So best guess is that Microsoft's allocators have gotten fatally fragmented, but I don't know how to confirm/refute that. Let's test this in pure C. Compile and run the attached uglyhack.c on win32; if it reports something significantly less than 100%, it's

[issue12853] global name 'r' is not defined in upload.py

2013-10-12 Thread Esa Peuha
Esa Peuha added the comment: so I don't know where the global name 'r' is not defined message came from. It came from Python 2.7. There are two separate bugs here, one in 3.x and the other in 2.7: the 3.x bug has to do with bytes/string separation, while the 2.7 bug is that result

[issue19165] Change formatter warning to DeprecationWarning in 3.5

2013-10-09 Thread Esa Peuha
Esa Peuha added the comment: The wanted patch seems to be very simple: change PendingDeprecationWarning to DeprecationWarning on line 24 of Lib/formatter.py but only for Python 3.5 (i.e. no need to do anything until 3.4 is released). On a related note, should formatter be added to PEP 4

[issue19202] Additions to docs

2013-10-09 Thread Esa Peuha
New submission from Esa Peuha: Here are some additions to documentation of a few functions: all, any: alternative definitions using functools.reduce enumerate: alternative definition using zip and itertools.count sum: equivalent definition using functools.reduce and operator.add

[issue19202] Additions to docs

2013-10-09 Thread Esa Peuha
Esa Peuha added the comment: How would you give a single definition of reduce() that helps people to understand both 2-arg and 3-arg variants? The way it is implemented in C is impossible to duplicate in pure Python; the best you could do is a hack that works unless someone *tries* to break

[issue19182] Socket leak in logging.handlers

2013-10-06 Thread Esa Peuha
New submission from Esa Peuha: Running test_logging produces the following: /home/peuha/python/cpython/Lib/logging/handlers.py:550: ResourceWarning: unclosed socket.socket fd=4, family=1, type=2049, proto=0 self.retryTime = now + self.retryPeriod /home/peuha/python/cpython/Lib/logging

[issue19148] Minor issues with Enum docs

2013-10-02 Thread Esa Peuha
New submission from Esa Peuha: I noticed a couple of issues with the Enum documentation. First, there are some markup bugs which should be fixed by the attached file. Second, I think If the only change desired is no aliases allowed is very bad English and should be reworded; I would go