This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pashkasan
Recipients pashkasan, rhettinger, ronaldoussoren
Date 2018-10-01.10:42:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1538390564.66.0.545547206417.issue34859@psf.upfronthosting.co.za>
In-reply-to
Content
str2 = open('sample.txt', 'rU').read()


if "\n" in str2:
        print ("\\n found")
else:
        print ("\\n not found")

if "\r" in str2:
        print ("\\r found")
else:
        print ("\\r not found")


if "\r\n" in str2:
        print ("\\r\\n found")
else:
        print ("\\r\\n not found")

print str2

output
http://prntscr.com/l0sc11

strange that print() has \r\n
do i have to open file in binary mode or something to have \r not stripped?
History
Date User Action Args
2018-10-01 10:42:44pashkasansetrecipients: + pashkasan, rhettinger, ronaldoussoren
2018-10-01 10:42:44pashkasansetmessageid: <1538390564.66.0.545547206417.issue34859@psf.upfronthosting.co.za>
2018-10-01 10:42:44pashkasanlinkissue34859 messages
2018-10-01 10:42:44pashkasancreate