Message10446

Author asalabaev
Recipients asalabaev, helix84, public.marvin, zyasoft
Date 2015-11-10.05:44:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1447134279.2.0.180236337256.issue2392@psf.upfronthosting.co.za>
In-reply-to
Content
Jim, 
That was quite fast..

I followed your suggestion and modified the sre_compile code like as follows (a few cases shown only):

        elif op is IN or op == IN:
            print "op is IN or op == IN %s %s" % (op is IN, op == IN)


        elif op is ANY or op == ANY:
            print "op is ANY or op == ANY %s %s " %(op is ANY, op == ANY) 


        elif op is SUBPATTERN or op == SUBPATTERN:
            print "op is SUBPATTERN or op == SUBPATTERN %s %s " % (op is SUBPATTERN, op == SUBPATTERN)


        elif op is AT or op == AT:
            print "op is AT or op == AT %s %s" % (op is AT,  op == AT) 


At the first test I got in the system out:

[11/10/15 8:22:51:307 MSK] 00000033 SystemOut     O op is BRANCH or op == BRANCH True True
[11/10/15 8:22:51:307 MSK] 00000033 SystemOut     O op is SUBPATTERN or op == SUBPATTERN True True
[11/10/15 8:22:51:307 MSK] 00000033 SystemOut     O op is SUBPATTERN or op == SUBPATTERN True True
[11/10/15 8:22:51:307 MSK] 00000033 SystemOut     O op is IN or op == IN True True
[11/10/15 8:22:51:308 MSK] 00000033 SystemOut     O op is IN or op == IN True True
[11/10/15 8:22:51:310 MSK] 00000033 SystemOut     O op is SUBPATTERN or op == SUBPATTERN True True
[11/10/15 8:22:51:310 MSK] 00000033 SystemOut     O op is IN or op == IN True True
[11/10/15 8:22:51:311 MSK] 00000033 SystemOut     O op is IN or op == IN True True
[11/10/15 8:22:51:313 MSK] 00000033 SystemOut     O op is SUBPATTERN or op == SUBPATTERN True True
[11/10/15 8:22:53:456 MSK] 00000033 SystemOut     O op is SUBPATTERN or op == SUBPATTERN True True
[11/10/15 8:22:53:457 MSK] 00000033 SystemOut     O op is ANY or op == ANY True True
[11/10/15 8:22:53:741 MSK] 00000036 SystemOut     O op is SUBPATTERN or op == SUBPATTERN True True
[11/10/15 8:22:53:741 MSK] 00000036 SystemOut     O op is BRANCH or op == BRANCH True True
[11/10/15 8:22:53:741 MSK] 00000036 SystemOut     O op is SUBPATTERN or op == SUBPATTERN True True
[11/10/15 8:22:53:742 MSK] 00000036 SystemOut     O op is SUBPATTERN or op == SUBPATTERN True True
[11/10/15 8:22:53:742 MSK] 00000036 SystemOut     O op is IN or op == IN True True
[11/10/15 8:22:53:742 MSK] 00000036 SystemOut     O op is IN or op == IN True True
[11/10/15 8:22:53:744 MSK] 00000036 SystemOut     O op is SUBPATTERN or op == SUBPATTERN True True
[11/10/15 8:22:53:744 MSK] 00000036 SystemOut     O op is IN or op == IN True True
[11/10/15 8:22:53:744 MSK] 00000036 SystemOut     O op is IN or op == IN True True
[11/10/15 8:22:53:746 MSK] 00000036 SystemOut     O op is SUBPATTERN or op == SUBPATTERN True True
[11/10/15 8:22:54:094 MSK] 00000032 SystemOut     O op is IN or op == IN True True
[11/10/15 8:22:55:458 MSK] 00000032 SystemOut     O op is IN or op == IN True True
[11/10/15 8:22:55:458 MSK] 00000032 SystemOut     O op is AT or op == AT True True
[11/10/15 8:22:55:460 MSK] 00000032 SystemOut     O op is SUBPATTERN or op == SUBPATTERN True True
[11/10/15 8:22:55:460 MSK] 00000032 SystemOut     O op is ANY or op == ANY True True
[11/10/15 8:22:55:461 MSK] 00000032 SystemOut     O op is IN or op == IN True True
[11/10/15 8:22:55:461 MSK] 00000032 SystemOut     O op is SUBPATTERN or op == SUBPATTERN True True
[11/10/15 8:22:55:461 MSK] 00000032 SystemOut     O op is IN or op == IN True True
[11/10/15 8:22:55:462 MSK] 00000032 SystemOut     O op is IN or op == IN True True
[11/10/15 8:22:55:462 MSK] 00000032 SystemOut     O op is SUBPATTERN or op == SUBPATTERN True True
[11/10/15 8:22:56:721 MSK] 00000036 SystemOut     O op is SUBPATTERN or op == SUBPATTERN False True
[11/10/15 8:22:56:721 MSK] 00000036 SystemOut     O op is SUBPATTERN or op == SUBPATTERN False True
[11/10/15 8:22:56:721 MSK] 00000036 SystemOut     O op is ANY or op == ANY False True
[11/10/15 8:22:57:038 MSK] 00000036 SystemOut     O op is SUBPATTERN or op == SUBPATTERN False True
[11/10/15 8:22:57:038 MSK] 00000036 SystemOut     O op is SUBPATTERN or op == SUBPATTERN False True
[11/10/15 8:22:57:039 MSK] 00000036 SystemOut     O op is ANY or op == ANY False True

so all of a sudden  "op is SUBPATTERN" and "op is ANY" (actually everything) started evaluating to False, while still being  ==. this is a full log I got at that time. Those log lines could come from different threads, so then I added

import threading 

before the def _compile(

and the threading.currentThread() in the the printed output and as you can imagine, the issue since then did not reproduce. I am happy to spend more time attempting getting a "False" if you think it might be helpful to you.

I tried searching the difference between is and == and could not find anything yet, could you provide a hint where I can educate myself?

and the more important questions:
- Is this solution is robust enough? 
- if yes,  should / can I use the modified the sre_compile version? The issue I am having is that the I am limited with the java version enforced by websphere so I cannot switch to the 2.7, any chance it will be fixed in 2.5.X ?

Thank you very much anyways!
History
Date User Action Args
2015-11-10 05:44:39asalabaevsetmessageid: <1447134279.2.0.180236337256.issue2392@psf.upfronthosting.co.za>
2015-11-10 05:44:39asalabaevsetrecipients: + asalabaev, zyasoft, public.marvin, helix84
2015-11-10 05:44:39asalabaevlinkissue2392 messages
2015-11-10 05:44:37asalabaevcreate