[issue41964] difflib SequenceMatcher get_matching_blocks returns non-matching blocks in some cases
New submission from Snidhi Sofpro : -- Demo case with unexpected results starting from matching block 3 (result of code that follows): sys.version_info(major=3, minor=6, micro=9, releaselevel='final', serial=0) Matches between: http://local:56067/register/200930162135700";> http://local:53813/register/20100517282450281";> Match(a=0, b=0, size=39) same-> http://local:5 same=> http://local:5 Match(a=43, b=43, size=12) same-> /register/20 same=> /register/20 Match(a=59, b=55, size=1) same-> 1 same=> 0 Match(a=66, b=56, size=2) same-> 00 same=> 93 Match(a=68, b=70, size=2) same-> "> same=> # -- code that results in the above: def get_mblk(dpiy_Frst, dpiy_Scnd): import difflib; sqmn_o = difflib.SequenceMatcher(None, dpiy_Frst, dpiy_Scnd); mblk_ls = [ block for block in sqmn_o.get_matching_blocks()]; for mblk in mblk_ls[:-1]: #exclude the last dummy block print(mblk); mtch_a = dpiy_Frst[mblk.a : mblk.a + mblk.size]; mtch_b = dpiy_Frst[mblk.b : mblk.b + mblk.size]; print('same->', mtch_a); print('same=>', mtch_b, '\n'); #endfor #endef get_mblk # --- main -- s1='http://local:56067/register/200930162135700";>' s2='http://local:53813/register/20100517282450281";>' import sys; print(sys.version_info, '\n'); print("Matches between:"); print(s1); print(s2); print('\n'); get_mblk(s1, s2); -- messages: 378149 nosy: Snidhi priority: normal severity: normal status: open title: difflib SequenceMatcher get_matching_blocks returns non-matching blocks in some cases versions: Python 3.6 ___ Python tracker <https://bugs.python.org/issue41964> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41964] difflib SequenceMatcher get_matching_blocks returns non-matching blocks in some cases
Snidhi Sofpro added the comment: Hello Tim Peters, Like you pointed out: (1) The test code clearly has a mistake. (2) With the mistake corrected, difflib.SequenceMatcher.get_matching_blocks() returns results as expected for the given test data. I'm unable to readily recreate the issue where it was first observed because the application code from which the test code was derived has meanwhile gotten changed to make use of get_opcodes(). Will update this ticket if I find this to be an issue at all. Thank you for looking into this so quickly & for the feedback. Contributors like you make working in the python ecosystem a professional pleasure. Thanks again. -- ___ Python tracker <https://bugs.python.org/issue41964> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36759] datetime: astimezone() results in OSError: [Errno 22] Invalid argument
New submission from Snidhi Sofpro : With: Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 17:54:52) [MSC v.1900 32 bit (Intel)] on win32 import datetime; d_Time = datetime.datetime.strptime('03:30 PM', '%I:%M %p'); d_Time = d_Time.astimezone(datetime.timezone.utc); # RESULTS IN OSError: [Errno 22] Invalid argument # WHEREAS the foll. does not have the issue! d_Time = datetime.datetime(year= d_Time.year, month = d_Time.month, day = d_Time.day, hour= d_Time.hour, minute = d_Time.minute, second = d_Time.second, tzinfo = datetime.timezone.utc); print(d_Time); -- components: Library (Lib) messages: 341149 nosy: Snidhi priority: normal severity: normal status: open title: datetime: astimezone() results in OSError: [Errno 22] Invalid argument type: behavior versions: Python 3.6 ___ Python tracker <https://bugs.python.org/issue36759> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6766] Cannot modify dictionaries inside dictionaries using Managers from multiprocessing
Snidhi Sofpro added the comment: Hi team, Looks like this issue remains per code below: import multiprocessing, sys, time, traceback; if __name__ == '__main__': print(sys.version); mpd = multiprocessing.Manager().dict(); mpd['prcss'] = {'q' : 'queue_1', 'ctlg' : 'ctlg_1' }; # update 1 - doesn't work! mpd['prcss'].update( { 'name': 'concfun_1'} ); print('Result of failed update 1:', mpd['prcss']); # update 2 - doesn't work! mpd['prcss']['name'] = 'concfun_1'; print('Result of failed update 2:', mpd['prcss']); # update 3 - works! mpd_prcss = mpd['prcss']; mpd_prcss['name'] = 'concfun_1'; mpd['prcss'] = mpd_prcss; print('Result of successful update 3:', mpd['prcss']); ### --- output ### 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 17:54:52) [MSC v.1900 32 bit (Intel)] Result of failed update 1: {'q': 'queue_1', 'ctlg': 'ctlg_1'} Result of failed update 2: {'q': 'queue_1', 'ctlg': 'ctlg_1'} Result of successful update 3: {'q': 'queue_1', 'ctlg': 'ctlg_1', 'name': 'concfun_1'} -- nosy: +Snidhi versions: -Python 2.7, Python 3.4, Python 3.5 ___ Python tracker <https://bugs.python.org/issue6766> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com