[issue6518] Enable 'with' statement in ossaudiodev module
Art Gillespie added the comment: Diff attached * Added the __enter__ and __exit__ methods to the ossaudio object. * Updated tests so they pass (attempt to access ossaudio.closed throws AttributeError instead of TypeError) My first patch. Please let me know if I did anything terrifically stupid. :-) -- keywords: +patch nosy: +agillesp Added file: http://bugs.python.org/file14767/issue6518.diff ___ Python tracker <http://bugs.python.org/issue6518> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6759] zipfile.ZipExtFile.read() is missing universal newline support
Art Gillespie added the comment: Patch for both zipfile.py and test_zipfile.py attached. * The universal newline logic is now in read instead of readline. * UniversalNewlineTests.read_test changed to check for \n rather than unchanged eol. -- keywords: +patch nosy: +agillesp type: -> behavior Added file: http://bugs.python.org/file14772/issue6759_1.diff ___ Python tracker <http://bugs.python.org/issue6759> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6759] zipfile.ZipExtFile.read() is missing universal newline support
Art Gillespie added the comment: Hi Ryan, Thanks for the feedback. I've attached a new patch that fixes the read(nbytes) behavior--It will now always return the requested number of bytes regardless of newline replacement. There's now a unit test for this as well. I also added the newlines attribute per PEP 278 and a corresponding test. I'm not sure I understood David's comment that read_test needed to be turned into a unit test: it's called by several of the unit tests (test_read_stored, test_read_deflated, et. al.) in that class. -- Added file: http://bugs.python.org/file14784/issue6759_2.diff ___ Python tracker <http://bugs.python.org/issue6759> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6759] zipfile.ZipExtFile.read() is missing universal newline support
Art Gillespie added the comment: Hi David, Thanks for the review. Patch attached. (1) I've moved that comment to the check's new location. (2) Fixed the bug and added tests for only one separator. Also added test data and tests for mixed eol files. (3) I changed this so that when the file is opened with universal newline support, read(size) makes multiple calls to _do_read until size bytes are read or EOF is reached. -- Added file: http://bugs.python.org/file14785/issue6759_3.diff ___ Python tracker <http://bugs.python.org/issue6759> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6518] Enable 'with' statement in ossaudiodev module
Art Gillespie added the comment: Hi Victor, I copied both the return NULL behavior in oss_exit and the oss_self naming from Objects/fileobject.c: http://paste.pocoo.org/show/136451/ Should they be changed there as well? -- ___ Python tracker <http://bugs.python.org/issue6518> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6759] zipfile.ZipExtFile.read() is missing universal newline support
Art Gillespie added the comment: Just found another bug in the code that sets the newlines attribute. Please disregard issue6759_3.diff -- ___ Python tracker <http://bugs.python.org/issue6759> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6759] zipfile.ZipExtFile.read() is missing universal newline support
Art Gillespie added the comment: Latest patch attached. * Fixed the code that populates the newlines attribute. I think I've covered all the cases... * Found another deviation from file object behavior in this module: Calling read with a negative size parameter does not always return the remainder of the file as described in http://docs.python.org/library/stdtypes.html#file.read I went ahead and fixed this--please let me know if I should open a separate issue and submit a separate patch. * Added more tests for mixed eol files, calling read with a negative size parameter, reading a file with only crlfs -- Added file: http://bugs.python.org/file14787/issue6759_4.diff ___ Python tracker <http://bugs.python.org/issue6759> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5148] gzip.open breaks with 'U' flag
Art Gillespie added the comment: The problem appears to be that the gzip module simply doesn't support universal newlines yet. I'm currently working on the zipfile module's universal newline support (issue6759) so if nobody else is working on this, I'll do it. I'm not sure if file object's open() behavior when presented with 'rUb' is correct or not. >>> f = open("test.txt", "w").write("blah\r\nblah\rblah\nblah\r\n") >>> f = open("test.txt", "rUb") >>> f.read() 'blah\nblah\nblah\nblah\n' Since 'U' and 'b' are conceptually mutually exclusive on platforms where 'b' matters, I can see this being confusing. -- nosy: +agillesp ___ Python tracker <http://bugs.python.org/issue5148> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com