[issue7076] Documentation add note about SystemRandom

2009-10-07 Thread Jan Hosang
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 urando

[issue7076] Documentation add note about SystemRandom

2009-10-06 Thread Jan Hosang
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"? -- no

[issue7069] inspect.isabstract to return boolean values only

2009-10-06 Thread Jan Hosang
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.

[issue5395] array.fromfile not checking I/O errors

2009-10-06 Thread Jan Hosang
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_ioe

[issue7069] inspect.isabstract to return boolean values only

2009-10-05 Thread Jan Hosang
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

[issue5395] array.fromfile not checking I/O errors

2009-10-05 Thread Jan Hosang
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 f

[issue7063] Memory errors in array.array

2009-10-05 Thread Jan Hosang
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 i

[issue7042] test_signal fails on os x 10.6

2009-10-05 Thread Jan Hosang
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

[issue7063] Memory errors in array.array

2009-10-05 Thread Jan Hosang
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

[issue7038] test_curses fails on os x 10.6

2009-10-05 Thread Jan Hosang
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 ra

[issue7042] test_signal fails on os x 10.6

2009-10-05 Thread Jan Hosang
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 -> o

[issue5395] array.fromfile not checking I/O errors

2009-10-05 Thread Jan Hosang
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)

[issue5395] array.fromfile not checking I/O errors

2009-10-04 Thread Jan Hosang
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 t

[issue7042] test_signal fails on os x 10.6

2009-10-03 Thread Jan Hosang
Jan Hosang added the comment: $ ./python.exe -c 'import sys; print sys.maxint' 9223372036854775807 -- ___ Python tracker <http://bugs.python.

[issue7042] test_signal fails on os x 10.6

2009-10-02 Thread Jan Hosang
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 <h

[issue7042] test_signal fails on os x 10.6

2009-10-02 Thread Jan Hosang
New submission from Jan Hosang : == FAIL: test_itimer_virtual (test.test_signal.ItimerTest) -- Traceback (most recent call last): File "/Users/ja

[issue7041] test_macostools fails on os x 10.6

2009-10-02 Thread Jan Hosang
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

[issue7040] test_smtplib fails on os x 10.6

2009-10-02 Thread Jan Hosang
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

[issue7039] test_distutils fails on os x 10.6

2009-10-02 Thread Jan Hosang
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/pyth

[issue7038] test_curses fails on os x 10.6

2009-10-02 Thread Jan Hosang
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

[issue7037] test_asynchat fails on os x 10.6

2009-10-02 Thread Jan Hosang
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

[issue6071] no longer possible to hash arrays

2009-09-29 Thread Jan Hosang
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

[issue6071] no longer possible to hash arrays

2009-09-29 Thread Jan Hosang
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

[issue6071] no longer possible to hash arrays

2009-09-26 Thread Jan Hosang
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_releasebuf

[issue6071] no longer possible to hash arrays

2009-09-26 Thread Jan Hosang
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"

[issue6071] no longer possible to hash arrays

2009-09-26 Thread Jan Hosang
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. -- __

[issue6071] no longer possible to hash arrays

2009-09-25 Thread Jan Hosang
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/i

[issue6071] no longer possible to hash arrays

2009-09-25 Thread Jan Hosang
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

[issue5395] array.fromfile not checking I/O errors

2009-09-24 Thread Jan Hosang
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 i

[issue6071] no longer possible to hash arrays

2009-09-21 Thread Jan Hosang
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

[issue6839] zipfile can't extract file

2009-09-19 Thread Jan Hosang
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