GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Potential Issue with moduleCache Key Handling in _utils.py · Issue #585 · html5lib/html5lib-python Open DescriptionWhile reviewing the moduleCache handling logic in _utils.py, I noticed a potential inconsistency in how keys are being checked and used. Specifically, the code appears to check for the presence of "kwargs", "name", and "args" as string keys in the moduleCache dictionary. However, it seems the variables themselves (e.g., kwargs, name, args) are being used elsewhere as keys. For example, in the code snippet: if "name" not in moduleCache: moduleCache[name] = {} if "args" not in moduleCache[name]: moduleCache[name][args] = {} if "kwargs" not in moduleCache[name][args]: moduleCache[name][args][kwargs_tuple] = {} moduleCache[name][args][kwargs_tuple] = mod The checks for "name", "args", and "kwargs" are strings, but the subsequent access and assignment use the variables name, args, and kwargs_tuple as keys. Potential Issues Steps to Reproduce Expected Behavior The moduleCache should consistently use either string literals or variables as keys. Proposed Solution if name not in moduleCache: moduleCache[name] = {} if args not in moduleCache[name]: moduleCache[name][args] = {} if kwargs_tuple not in moduleCache[name][args]: moduleCache[name][args][kwargs_tuple] = {} This potential issue might lead to unexpected results, especially in edge cases where the string and variable keys overlap or differ. Activity
MetadataMetadataAssigneesLabelsNo labels TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |