code: def test__c_char_p(self):
      class X(Structure):
          _fields_ = [("str", c_char_p)]
  
      x = X()
  
      # c_char_p and Python string is compatible
      # c_char_p and create_string_buffer is NOT compatible
      self.assertEqual(x.str, None)
      x.str = b"Hello, World"
      self.assertEqual(x.str, b"Hello, World")
      b = create_string_buffer(b"Hello, World")
      self.assertRaises(TypeError, setattr, x, b"str", b)
  
file_path: cpython/Lib/test/test_ctypes/test_stringptr.py
imports: import _ctypes_test
  import sys
  import unittest
  from test import support
  from ctypes import CDLL, Structure, POINTER, create_string_buffer, c_char, c_char_p
label_desc: Use image node_id 2 for calling the StringPtrTestCase obj's underlying member method code with example usage: obj.test__c_char_p() without return types