code: def test_invalid_paths(self):
      for attr in GenericTest.common_attributes:
          # os.path.commonprefix doesn't raise ValueError
          if attr == "commonprefix":
              continue
          func = getattr(self.pathmodule, attr)
          with self.subTest(attr=attr):
              if attr in ("exists", "isdir", "isfile"):
                  func("/tmp\udfffabcds")
                  func(b"/tmp\xffabcds")
                  func("/tmp\x00abcds")
                  func(b"/tmp\x00abcds")
              else:
                  with self.assertRaises((OSError, UnicodeEncodeError)):
                      func("/tmp\udfffabcds")
                  with self.assertRaises((OSError, UnicodeDecodeError)):
                      func(b"/tmp\xffabcds")
                  with self.assertRaisesRegex(
                      ValueError, "embedded null"
                  ):
                      func("/tmp\x00abcds")
                  with self.assertRaisesRegex(
                      ValueError, "embedded null"
                  ):
                      func(b"/tmp\x00abcds")
  
imports: import genericpath
  import os
  import sys
  import unittest
  import warnings
  from test.support import is_emscripten
  from test.support import os_helper
  from test.support import warnings_helper
  from test.support.script_helper import assert_python_ok
  from test.support.os_helper import FakePath
label_desc: Use image node_id 1 for calling the TestGenericTest obj's underlying member method code with example usage: obj.test_invalid_paths() without return types