[issue6839] zipfile can't extract file
Jan Hosang added the comment: I added a patch to replace back slashes by forward slashes in three places, only one if them actually relevant to the errors in the attached .zip file. I kept the exception for mismatching filenames, but if you think it is appropriate to remove it I could do that as well. -- keywords: +patch nosy: +chuck Added file: http://bugs.python.org/file14934/zlib_forward_slash.patch ___ Python tracker <http://bugs.python.org/issue6839> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6071] no longer possible to hash arrays
Jan Hosang added the comment: I tried to implement the new buffer API, but as soon as I add bf_getbuffer/bf_releasebuffer to PyBufferProcs writing an array to a file breaks: f.write(a) TypeError: must be contiguous buffer, not array.array I searched through the file functions, but couldn't find the point where this happens. Has anybody a suggestion? Does file.write() use the old buffers? Doesn't it use reprfunc? -- nosy: +chuck ___ Python tracker <http://bugs.python.org/issue6071> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5395] array.fromfile not checking I/O errors
Jan Hosang added the comment: I attached a path for raising IOErrors in fromfile. I also added a testcase which failed before. The test opens a file and closes the file with os.close(fd) without telling the file object, so fromfile doesn't notice it's reading from a file that is actually closed. -- keywords: +patch nosy: +chuck Added file: http://bugs.python.org/file14963/array_ioerror.patch ___ Python tracker <http://bugs.python.org/issue5395> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6071] no longer possible to hash arrays
Jan Hosang added the comment: I added the two functions for the new buffer API. Having an exported memory view needs some handling elsewhere, so the array does not change. I also added tests for checking that behaviour. Mainly I copypasted code from py3k which involved redirecting to array_resize() instead of doing it manually and doing the checking there. -- keywords: +patch Added file: http://bugs.python.org/file14980/array_new_buffer.patch ___ Python tracker <http://bugs.python.org/issue6071> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6071] no longer possible to hash arrays
Jan Hosang added the comment: The patch breaks five unit tests from other modules, I'll look into it. -- ___ Python tracker <http://bugs.python.org/issue6071> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6071] no longer possible to hash arrays
Jan Hosang added the comment: > > The patch breaks five unit tests from other modules, I'll look into > > it. > > What are those tests? test_codecs, test_ioctl, test_multiprocessing, test_socket and test_struct. -- ___ Python tracker <http://bugs.python.org/issue6071> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6071] no longer possible to hash arrays
Jan Hosang added the comment: You asked "what" not "which" :) test test_codecs failed -- Traceback (most recent call last): File "/Users/jan/src/python-svn/Lib/test/test_codecs.py", line 531, in test_array codecs.readbuffer_encode(array.array("c", "spam")), TypeError: must be string or read-only buffer, not array.array test test_ioctl failed -- Traceback (most recent call last): File "/Users/jan/src/python-svn/Lib/test/test_ioctl.py", line 34, in test_ioctl_mutate r = fcntl.ioctl(tty, termios.TIOCGPGRP, buf, 1) TypeError: ioctl requires a file or file descriptor, an integer and optionally an integer or buffer argument test test_multiprocessing failed -- Traceback (most recent call last): File "/Users/jan/src/python-svn/Lib/test/test_multiprocessing.py", line 1269, in test_connection self.assertEqual(conn.send_bytes(arr), None) TypeError: must be string or read-only buffer, not array.array test test_socket failed -- errors occurred; run in verbose mode for details (have to recheck) test test_struct failed -- Traceback (most recent call last): File "/Users/jan/src/python-svn/Lib/test/test_struct.py", line 468, in test_unpack_with_buffer value, = struct.unpack('>I', data) error: unpack requires a string argument of length 4 -- ___ Python tracker <http://bugs.python.org/issue6071> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6071] no longer possible to hash arrays
Jan Hosang added the comment: I stumbled upon the following function: static Py_ssize_t convertbuffer(PyObject *arg, void **p, char **errmsg) in Python/getargs.c The first thing the function does is checking if the object implements the old buffer api, but also fails if pb->bf_releasebuffer != NULL. So I guess it's also making sure the new buffer api is not implemented. What's the thought behind this? Removing that condition fixes three of the failing tests but breaks none. -- ___ Python tracker <http://bugs.python.org/issue6071> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6071] no longer possible to hash arrays
Jan Hosang added the comment: I was looking at the remaining differences between Modules/arraymodule.c in python 2.7 and the 3k branch, in particular I was testing why including the changes to the function array_ass_slice into the patch breaks the unit test of the array module. The manual resizing of the memory basically was replaced by a call to array_resize with the advantage, that checking for exported memory views is done there (which is not necessary because it's already done in the function) and the code gets clearer. I think when PyMem_RESIZE is called the pointer to the memory might change. So in 3k this now happens in array_resize, so the array->ob_item pointer changes but not it's local copy in array_ass_slice. Isn't that potentially causing trouble in python 3k? -- ___ Python tracker <http://bugs.python.org/issue6071> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6071] no longer possible to hash arrays
Jan Hosang added the comment: I fixed the array_ass_slice for python 2.7 in the attached patch. The problem should apply to python 3k as well: firstly the above which might stay unnoticed and secondly the function moves to much memory if the array size is increased: (Py_SIZE(a)-d-ihigh) items should be moved, because Py_SIZE(a) was already modified by array_resize, but the function moves (Py_SIZE(a)-ihigh) items. The attached patch for python 2.7 passes all unit tests for me. -- Added file: http://bugs.python.org/file14999/hasharray.patch ___ Python tracker <http://bugs.python.org/issue6071> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7037] test_asynchat fails on os x 10.6
New submission from Jan Hosang : Loads of outputs like test_string_producer (test.test_asynchat.TestAsynchat_WithPoll) ... error: uncaptured python exception, closing channel (:[Errno 9] Bad file descriptor [/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/asyncor e.py|readwrite|107] [/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/asyncor e.py|handle_expt_event|441] [|getsockopt|1] [/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/socket. py|_dummy|165]) Test says it passes, though. Complete output is attached. -- files: test_asynchat.fail messages: 93452 nosy: chuck severity: normal status: open title: test_asynchat fails on os x 10.6 versions: Python 2.6 Added file: http://bugs.python.org/file15023/test_asynchat.fail ___ Python tracker <http://bugs.python.org/issue7037> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7038] test_curses fails on os x 10.6
New submission from Jan Hosang : test_curses test test_curses crashed -- : endwin() returned ERR Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/test/re grtest.py", line 549, in runtest_inner the_package = __import__(abstest, globals(), locals(), []) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/test/te st_curses.py", line 279, in curses.endwin() error: endwin() returned ERR 1 test failed: test_curses -- messages: 93453 nosy: chuck severity: normal status: open title: test_curses fails on os x 10.6 versions: Python 2.6 ___ Python tracker <http://bugs.python.org/issue7038> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7039] test_distutils fails on os x 10.6
New submission from Jan Hosang : FAIL: test_get_python_inc (distutils.tests.test_sysconfig.SysconfigTestCase) -- Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distuti ls/tests/test_sysconfig.py", line 54, in test_get_python_inc self.assert_(os.path.isdir(inc_dir), inc_dir) AssertionError: /Users/ronald/Projects/python/r263/Include -- -- components: Library (Lib), Tests messages: 93454 nosy: chuck severity: normal status: open title: test_distutils fails on os x 10.6 type: behavior versions: Python 2.7 ___ Python tracker <http://bugs.python.org/issue7039> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7040] test_smtplib fails on os x 10.6
New submission from Jan Hosang : Output like: testAUTH_PLAIN (test.test_smtplib.SMTPSimTests) ... error: uncaptured python exception, closing channel (:[Errno 9] Bad file descriptor [/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/asyncor e.py|readwrite|107] [/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/asyncor e.py|handle_expt_event|441] [|getsockopt|1] [/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/socket. py|_dummy|165]) Probably related to #7037 . Complete output attached. -- components: Library (Lib), Tests files: test_smtplib.fail messages: 93455 nosy: chuck severity: normal status: open title: test_smtplib fails on os x 10.6 type: behavior versions: Python 2.6 Added file: http://bugs.python.org/file15024/test_smtplib.fail ___ Python tracker <http://bugs.python.org/issue7040> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7041] test_macostools fails on os x 10.6
New submission from Jan Hosang : test_macostools test_copy (test.test_macostools.TestMacostools) ... ERROR test_mkalias (test.test_macostools.TestMacostools) ... ERROR test_mkalias_relative (test.test_macostools.TestMacostools) ... ERROR test_touched (test.test_macostools.TestMacostools) ... ok == ERROR: test_copy (test.test_macostools.TestMacostools) -- Traceback (most recent call last): File "/Users/jan/src/python26/Lib/test/test_macostools.py", line 65, in test_copy macostools.copy(test_support.TESTFN, TESTFN2) File "/Users/jan/src/python26/Lib/plat-mac/macostools.py", line 114, in copy srcfss = File.FSSpec(src) AttributeError: 'module' object has no attribute 'FSSpec' == ERROR: test_mkalias (test.test_macostools.TestMacostools) -- Traceback (most recent call last): File "/Users/jan/src/python26/Lib/test/test_macostools.py", line 73, in test_mkalias macostools.mkalias(test_support.TESTFN, TESTFN2) File "/Users/jan/src/python26/Lib/plat-mac/macostools.py", line 46, in mkalias dstfsr, dstfss = Res.FSCreateResourceFile(dstdirfsr, unicode(dstname), AttributeError: 'module' object has no attribute 'FSCreateResourceFile' == ERROR: test_mkalias_relative (test.test_macostools.TestMacostools) -- Traceback (most recent call last): File "/Users/jan/src/python26/Lib/test/test_macostools.py", line 88, in test_mkalias_relative macostools.mkalias(test_support.TESTFN, TESTFN2, sys.prefix) File "/Users/jan/src/python26/Lib/plat-mac/macostools.py", line 46, in mkalias dstfsr, dstfss = Res.FSCreateResourceFile(dstdirfsr, unicode(dstname), AttributeError: 'module' object has no attribute 'FSCreateResourceFile' -- Ran 4 tests in 0.006s FAILED (errors=3) test test_macostools failed -- errors occurred; run in verbose mode for details 1 test failed: test_macostools -- components: Library (Lib), Tests messages: 93456 nosy: chuck severity: normal status: open title: test_macostools fails on os x 10.6 versions: Python 2.6 ___ Python tracker <http://bugs.python.org/issue7041> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7042] test_signal fails on os x 10.6
New submission from Jan Hosang : == FAIL: test_itimer_virtual (test.test_signal.ItimerTest) -- Traceback (most recent call last): File "/Users/jan/src/python26/Lib/test/test_signal.py", line 368, in test_itimer_virtual self.assertEquals(signal.getitimer(self.itimer), (0.0, 0.0)) AssertionError: (0.179936001, 0.20001) != (0.0, 0.0) -- Complete output attached. -- components: Library (Lib), Tests files: test_signal.fail messages: 93457 nosy: chuck severity: normal status: open title: test_signal fails on os x 10.6 versions: Python 2.6 Added file: http://bugs.python.org/file15025/test_signal.fail ___ Python tracker <http://bugs.python.org/issue7042> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7042] test_signal fails on os x 10.6
Jan Hosang added the comment: This is a 64 bit machine and the test failed for the checkout of the python26-maint branch. I just configured and made it without any flags. (Does that produce a 64 bit build?) -- ___ Python tracker <http://bugs.python.org/issue7042> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7042] test_signal fails on os x 10.6
Jan Hosang added the comment: $ ./python.exe -c 'import sys; print sys.maxint' 9223372036854775807 -- ___ Python tracker <http://bugs.python.org/issue7042> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5395] array.fromfile not checking I/O errors
Jan Hosang added the comment: Ezio, I moved the test to a separate method. Also I couldn't find something to close the file if I don't care about errors. I thought an assertRises would be wrong, as I am not debugging files here, so I added a function to call a callable I expect to throw an exception (you said you don't like the try/close/except/pass). I don't know if it is okay to add functions to test_support, though. -- Added file: http://bugs.python.org/file15037/array_ioerror.patch ___ Python tracker <http://bugs.python.org/issue5395> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5395] array.fromfile not checking I/O errors
Jan Hosang added the comment: 1&2) I removed the try/except around the import. I have no clue if os might be unavailable. Maybe leave out handling that until we see that breaking. I added the try/except because I saw that in other tests in the same file when importing gc. 3) Done. 4) The EOFError exceptions are tested in test_tofromfile. > I tried to apply both the patches on the trunk but the tests don't > pass. With the latest patch I get an EOFError instead of IOError in > the assertRaises. That is the also behaviour before the patch, so the ferror(fp) does not fire. Either the test is inappropriate or your system doesn't regard reading a closed filehandle an error. I'm not able to investigate this as it works fine on my os x 10.6. What system did you test it on? Reliable ways of producing IOErrors are harder to find than I thought. Deleting the file between to reads makes it just look truncated. Another method I tried was crashing a process which holds the other end of a pipe, but that's messy and complicated. -- Added file: http://bugs.python.org/file15046/array_ioerror.patch ___ Python tracker <http://bugs.python.org/issue5395> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7042] test_signal fails on os x 10.6
Jan Hosang added the comment: I updated the checkout of the 26 branch, and the test runs fine now. I have no clue about virtual time as well. If this is about passing time, there should be better ways (than those which break if your computer gets faster). -- status: pending -> open ___ Python tracker <http://bugs.python.org/issue7042> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7038] test_curses fails on os x 10.6
Jan Hosang added the comment: I am not able to reproduce my own report :) I'm sure I installed the 2.6.3 release, opened Terminal.app, checked `which python` and ran `python -m test.regrtest -uall`. I remember that I saw a crash report when I came back and some failed tests, so I ran the tests again (in a different tab) in verbose mode to post reports. (Maybe that makes sense to you.) However, if I repeat what I did, the test does not fail anymore. So maybe just close it? :) -- ___ Python tracker <http://bugs.python.org/issue7038> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7063] Memory errors in array.array
New submission from Jan Hosang : While I was backporting the new buffer API to 2.7 I noticed some issues in array_ass_slice() in Modules/arraymodule.c in the python 3k branch. 1) Manual memory reallocation had been replaced by calls to array_resize. But I think when PyMem_RESIZE is called the pointer to the memory might change. So this now happens in array_resize, and the array->ob_item pointer changes but not it's local copy (item) in array_ass_slice(). 2) The function moves too much memory if the array size is increased: (Py_SIZE(a)-d-ihigh) items should be moved, because Py_SIZE(a) was already modified by array_resize, but the function moves (Py_SIZE(a)- ihigh) items. While 1) might go unnoticed, 2) definitely broke slice tests in a "segmentation fault"-way (in debug mode forbidden bits show the error). I tried to write a test, but I don't know how to trigger array_ass_slice() with a write access, as it is not in array_as_sequence anymore (like in 2.7). How is slicing handled now? -- components: Library (Lib), Tests messages: 93581 nosy: chuck severity: normal status: open title: Memory errors in array.array versions: Python 3.2 ___ Python tracker <http://bugs.python.org/issue7063> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7042] test_signal fails on os x 10.6
Jan Hosang added the comment: I think a timing out while loop explains much better what is happening. I mean we are trying to keep the cpu busy for 0.9 seconds (if I understand the definition of virtual time correctly) and not do 1 increments (which might be done faster than 0.9 seconds). -- ___ Python tracker <http://bugs.python.org/issue7042> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7063] Memory errors in array.array
Jan Hosang added the comment: The mp_ass_subscript function looks fine in contrast to array_ass_slice(). So if array_ass_slice() is not accessible from the outside and is only called with NULL as replacement parameter from the inside, I won't be able to cause trouble with those two issues. Still I think it's bad to keep buggy code around, even it is not used. Maybe array_ass_slice() should be changed to what it's used for: array_del_slice()? -- ___ Python tracker <http://bugs.python.org/issue7063> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5395] array.fromfile not checking I/O errors
Jan Hosang added the comment: > Maybe you could create a file without read permission (000) and try > to read from it. I just checked. If I don't have read permissions, I am not able to open the file. When I open a file and change permissions afterwards, I can read the complete file alright. (Checked with a 4mb file, I hope that's beyond buffering.) So I guess permissions are only checked when you open the file. -- ___ Python tracker <http://bugs.python.org/issue5395> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7069] inspect.isabstract to return boolean values only
Jan Hosang added the comment: The patch works, as this is what is implicitly happening anyway if you use the function. There seem to be no tests for this function, so there is nothing to break. I guess this is the right time to get some tests. Gabriel, would you like to write tests for this function? -- nosy: +chuck ___ Python tracker <http://bugs.python.org/issue7069> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5395] array.fromfile not checking I/O errors
Jan Hosang added the comment: Thanks Aduardo! (I could have sworn I tried that.) I changed the test to reading from a file in 'wb' mode, which raised a EOFError before and now raises IOErrors. -- Added file: http://bugs.python.org/file15055/array_ioerror.patch ___ Python tracker <http://bugs.python.org/issue5395> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7069] inspect.isabstract to return boolean values only
Jan Hosang added the comment: I changed the patch so it does not introduce new dependencies and fails before the patch of isabstract(). -- Added file: http://bugs.python.org/file15064/inspect.diff ___ Python tracker <http://bugs.python.org/issue7069> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7076] Documentation add note about SystemRandom
Jan Hosang added the comment: I think non-determinism is more then os.urandom can deliver. As far as I know the OS still does deterministic calculations, though they are maybe less obvious. Maybe call it "safer, OS dependent"? -- nosy: +chuck ___ Python tracker <http://bugs.python.org/issue7076> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7076] Documentation add note about SystemRandom
Jan Hosang added the comment: Maybe os.urandom is "more random" than the module random in the sense that it is harder to figure out what comes next, but still deterministic. The readings from the hardware are random and you usually don't know them, yet what comes out of urandom is determined by what urandom reads from the hardware and its state. I just want to warn not to drop wrong terms. -- ___ Python tracker <http://bugs.python.org/issue7076> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com