Commits

Sylvain Thénault  committed 8752260

fix crash when using set in regexp for --generated-members option. Closes #88914

  • Participants
  • Parent commits b68f274

Comments (0)

Files changed (3)

 
     * #89092: don't emit E0202 (attribute hiding a method) on @property methods
 
-    * #92584 fix pylint-gui crash due to internal API change
+    * #92584: fix pylint-gui crash due to internal API change
 
-    * #87192 fix crash when decorators are accessed through more than one dot
+    * #87192: fix crash when decorators are accessed through more than one dot
       (for instance @a.b is fine, @a.b.c crash)
 
+    * #88914: fix parsing of --generated-members options, leading to crash
+      when using a regexp value set
+
     * fix potential crashes with utils.safe_infer raising InferenceError
 
 

File checkers/typecheck.py

         if isinstance(self.config.generated_members, str):
             gen = shlex.shlex(self.config.generated_members)
             gen.whitespace += ','
+            gen.wordchars += '[]-+'
             self.config.generated_members = tuple(tok.strip('"') for tok in gen)
         for pattern in self.config.generated_members:
             # attribute is marked as generated, stop here

File test/smoketest.py

         self._runtest([join(HERE, 'input', 'noext')], code=0)
 
     @tag('smoke')
+    def test_generated_members(self):
+        # XXX dual end quotation since optparse buggily remove one...
+        self._runtest(['--generated-members=objects,DoesNotExist,delay,retry,"[a-zA-Z]+_set{1,2}""', 'pylint.lint'])
+
+    @tag('smoke')
     def test_w0704_ignored(self):
         self._runtest([join(HERE, 'input', 'ignore_except_pass_by_default.py')], code=0)