[issue1812] doctest _load_testfile function -- newline handling seems incorrect

2008-01-11 Thread Peter Donis
New submission from Peter Donis: When running doctest.testfile on a Linux machine, testing a txt file saved on a Windows machine, doctest raised a SyntaxError exception for each Windows newline in the txt file. On examining the code in the _load_testfile function, it looks to me like

[issue1812] doctest _load_testfile function -- newline handling seems incorrect

2008-01-11 Thread Peter Donis
Peter Donis added the comment: Edit: I should have said that the attached diff also includes changes to test_doctest.py to test for the correct newline behavior. Because the test setup is a little complex, I added an auxiliary script, doctest_testfile.py, and an accompanying text file

[issue1812] doctest _load_testfile function -- newline handling seems incorrect

2008-01-12 Thread Peter Donis
Peter Donis added the comment: I've uploaded a revised diff with two small improvements: (1) Removed a redundant os.isfile check in PackageLoaderTestImporter.get_data() in doctest_testfile.py. (The open() builtin already raises IOError if the file can't be opened.) (2) Added doctest.master

[issue1812] doctest _load_testfile function -- newline handling seems incorrect

2010-07-19 Thread Peter Donis
Peter Donis peterdo...@alum.mit.edu added the comment: I saw that this issue was bumped and re-tested against the current trunk (r82970). A further change in doctest_testfile.py was needed to make the test pass when called from regrtest.py: the test importer for the loader.get_data test case

[issue1812] doctest _load_testfile function -- newline handling seems incorrect

2010-07-19 Thread Peter Donis
Peter Donis peterdo...@alum.mit.edu added the comment: You'll probably want someone else to confirm, but for the record, my testing was on a Linux box (SuSE 11.2) using Python 2.7 built from the SVN trunk: pe...@powerspec:~/.local/lib/python2.7/test uname -a Linux Powerspec 2.6.31.12-0.2

[issue1812] doctest _load_testfile function -- newline handling seems incorrect

2010-07-19 Thread Peter Donis
Peter Donis peterdo...@alum.mit.edu added the comment: I realized on comparing doctest-fixes2.diff with doctest-fixes1.diff that doctest-fixes2.diff doesn't capture the different newlines correctly, so patch on my machine wouldn't apply the diff (I had done testing from the modified svn

[issue1812] doctest _load_testfile function -- newline handling seems incorrect

2010-07-19 Thread Peter Donis
Peter Donis peterdo...@alum.mit.edu added the comment: Uploaded a diff implementing the fix for the head of the py3k branch. Test passes on my Linux box: pe...@powerspec:~/.local/lib/python3.2/test python3.2 Python 3.2a0 (py3k:82984, Jul 19 2010, 16:03:06) [GCC 4.4.1 [gcc-4_4-branch revision

[issue1812] doctest _load_testfile function -- newline handling seems incorrect

2010-07-19 Thread Peter Donis
Peter Donis peterdo...@alum.mit.edu added the comment: Re msg110808, on thinking it over I realized it may not be so simple to get diff and patch to behave properly with a file like doctest_testfile.txt, where we want to intentionally mismatch newlines. We basically need to treat the file

[issue1812] doctest _load_testfile function -- newline handling seems incorrect

2010-07-19 Thread Peter Donis
Peter Donis peterdo...@alum.mit.edu added the comment: Uploading py3k version of doctest_testfile.txt as well, in case it's needed for testing. -- Added file: http://bugs.python.org/file18072/doctest_testfile.txt.py3k ___ Python tracker rep

[issue1812] doctest _load_testfile function -- newline handling seems incorrect

2010-07-19 Thread Peter Donis
Peter Donis peterdo...@alum.mit.edu added the comment: Also, can someone please clear the spam flag on my msg110813? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1812

[issue1812] doctest _load_testfile function -- newline handling seems incorrect

2010-07-21 Thread Peter Donis
Peter Donis peterdo...@alum.mit.edu added the comment: Re my msg110822, I think I have a better solution: have the test create a temporary txt file with intentionally mismatched newlines, and use that as the doctest. That means we can control the exact byte by byte content of the txt file

[issue1812] doctest _load_testfile function -- newline handling seems incorrect

2010-07-21 Thread Peter Donis
Peter Donis peterdo...@alum.mit.edu added the comment: Uploaded doctest-fixes5.diff with one minor correction: removed some comments that were reminders for the py3k version (which I'll upload shortly). -- Added file: http://bugs.python.org/file18118/doctest-fixes5.diff

[issue1812] doctest _load_testfile function -- newline handling seems incorrect

2010-07-21 Thread Peter Donis
Peter Donis peterdo...@alum.mit.edu added the comment: Uploaded doctest-fixes5-py3k.diff, diff against py3k branch implementing same improved test method as doctest-fixes5.diff. -- Added file: http://bugs.python.org/file18119/doctest-fixes5-py3k.diff

[issue1812] doctest _load_testfile function -- newline handling seems incorrect

2010-07-22 Thread Peter Donis
Peter Donis peterdo...@alum.mit.edu added the comment: I don't normally run Windows, so it will take a little time for me to set up a Windows build environment. However, I've made a number of other improvements as a result of further testing on Linux, and I've uploaded the improved patch

[issue1812] doctest _load_testfile function -- newline handling seems incorrect

2010-07-22 Thread Peter Donis
Peter Donis peterdo...@alum.mit.edu added the comment: Uploaded revised diff against py3k branch, doctest-fixes6-py3k.diff, with same improvements as doctest-fixes6.diff. Tests still pass on my Linux box. -- Added file: http://bugs.python.org/file18134/doctest-fixes6-py3k.diff

[issue1812] doctest _load_testfile function -- newline handling seems incorrect

2010-07-23 Thread Peter Donis
Peter Donis peterdo...@alum.mit.edu added the comment: @Mark, I'm probably stubborn, yes. :-) Could you post verbose output from your testing on Windows? I'd at least like to be able to duplicate your findings; it's possible there's something simple I'm missing

[issue1812] doctest _load_testfile function -- newline handling seems incorrect

2010-07-23 Thread Peter Donis
Peter Donis peterdo...@alum.mit.edu added the comment: @Mark, no problem, thanks for keeping up with all my patches. :-) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1812

[issue1812] doctest _load_testfile function -- newline handling seems incorrect

2012-07-24 Thread Peter Donis
Peter Donis peterdo...@alum.mit.edu added the comment: I recently noticed that there has been a minor code change in the _load_testfile function in doctest, so I generated a new patch against the latest pull from Mercurial (cpython). No actual changes to the issue fix, but this patch should

[issue1812] doctest _load_testfile function -- newline handling seems incorrect

2012-07-24 Thread Peter Donis
Peter Donis peterdo...@alum.mit.edu added the comment: Updated patch to ensure that tests pass when the -v flag is set running the test suite. This is done by having the helper script, doctest_testfile.py, call doctest.testfile with verbose=False to ensure there is no output if the test

[issue25045] smtplib throws exception TypeError: readline()

2015-10-07 Thread Peter Donis
Peter Donis added the comment: Investigating further, the problem appears to be with the SSLFakeFile object used for SSL/TLS connections. Here is a console session showing the issue (I have redacted the host name and port number used for privacy reasons): >>> import smtplib

[issue25045] smtplib throws exception TypeError: readline()

2015-10-07 Thread Peter Donis
Peter Donis added the comment: I am having the same problem; the error occurs in the call to the login method of the smtplib.SMTP object. That method takes two arguments, username and password, and that is what I am calling it with. -- nosy: +pdonis

[issue25045] smtplib throws exception TypeError: readline()

2015-10-07 Thread Peter Donis
Peter Donis added the comment: It looks like this was fixed some time in between my Python 3.2 version (3.2.3) and the current one (3.2.6); the code in the current 3.2 head in the repository has a size parameter in the readline function for SSLFakeFile: https://hg.python.org/cpython/file/3.2

[issue1812] doctest _load_testfile function -- newline handling seems incorrect

2019-11-25 Thread Peter Donis
Change by Peter Donis : -- pull_requests: +16867 pull_request: https://github.com/python/cpython/pull/17385 ___ Python tracker <https://bugs.python.org/issue1

[issue1812] doctest _load_testfile function -- newline handling seems incorrect

2019-11-25 Thread Peter Donis
Peter Donis added the comment: I have submitted pull request #17385 regarding this issue: https://github.com/python/cpython/pull/17385 -- ___ Python tracker <https://bugs.python.org/issue1

[issue1812] doctest _load_testfile function -- newline handling seems incorrect

2019-11-25 Thread Peter Donis
Change by Peter Donis : -- versions: +Python 3.9 -Python 2.7, Python 3.4, Python 3.5 ___ Python tracker <https://bugs.python.org/issue1812> ___ ___ Python-bug

[issue1812] doctest _load_testfile function -- newline handling seems incorrect

2020-01-21 Thread Peter Donis
Peter Donis added the comment: Pinging as a reminder that there is a pull request for this issue awaiting review. -- ___ Python tracker <https://bugs.python.org/issue1

[issue43049] Use io.IncrementalNewlineDecoder for doctest newline conversion

2021-01-27 Thread Peter Donis
Change by Peter Donis : -- keywords: +patch pull_requests: +23183 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24359 ___ Python tracker <https://bugs.python.org/issu

[issue1812] doctest _load_testfile function -- newline handling seems incorrect

2021-01-27 Thread Peter Donis
Change by Peter Donis : -- pull_requests: +23184 pull_request: https://github.com/python/cpython/pull/24359 ___ Python tracker <https://bugs.python.org/issue1

[issue43049] Use io.IncrementalNewlineDecoder for doctest newline conversion

2021-01-27 Thread Peter Donis
New submission from Peter Donis : This is a follow-up to issue 1812: https://bugs.python.org/issue1812 It was suggested in the discussion on that issue that the newline conversion in doctest that was corrected in that issue could be done using already defined resources in the io module

[issue43049] Use io.IncrementalNewlineDecoder for doctest newline conversion

2021-03-02 Thread Peter Donis
Peter Donis added the comment: Thanks for merging! -- ___ Python tracker <https://bugs.python.org/issue43049> ___ ___ Python-bugs-list mailing list Unsubscribe: