New submission from pashkasan <pa...@pmbox.biz>:

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 ~]#

----------
components: Interpreter Core
messages: 326764
nosy: pashkasan
priority: normal
severity: normal
status: open
title: python core in string substring search
versions: Python 2.7, Python 3.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue34859>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to