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
Date 2018-10-01.05:55:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1538373343.13.0.545547206417.issue34859@psf.upfronthosting.co.za>
In-reply-to
Content
find substring in string 
its correct behavior?
sample code

str = """
Content-Length: 3192
Connection: close
Cookie: _secure_admin_session_id=2a5dc26329de17ca4eafxxxxxxxxxxxxe;

-----------------------------1477319126846
Content-Disposition: form-data; name="utf8"
"""
str2 = """
xxxx

zzzzz


tttttt
"""

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


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


if str.find("\n\r"):
        print ("str found")
else:
        print ("str not found")

output

[root@scw-6ec0de ~]# python a.py
str not found
str2 not found
str found
[root@scw-6ec0de ~]# python3 a.py
str not found
str2 not found
str found
[root@scw-6ec0de ~]# python --version
Python 2.7.15
[root@scw-6ec0de ~]# python3 --version
Python 3.6.4
[root@scw-6ec0de ~]#
History
Date User Action Args
2018-10-01 05:55:43pashkasansetrecipients: + pashkasan
2018-10-01 05:55:43pashkasansetmessageid: <1538373343.13.0.545547206417.issue34859@psf.upfronthosting.co.za>
2018-10-01 05:55:43pashkasanlinkissue34859 messages
2018-10-01 05:55:42pashkasancreate