@@ -226,12 +226,14 @@ def get_setup_arguments_with_context(setup_py, env):
226226 pkg_path = str (pkg_path ).replace (os .sep , os .altsep )
227227 setup_py = str (setup_py ).replace (os .sep , os .altsep )
228228 code_lines = [
229+ 'import pickle' ,
229230 'import sys' ,
230231 "sys.path.insert(0, '%s')" % pkg_path ,
231232 'from colcon_python_setup_py.package_identification.python_setup_py'
232233 ' import get_setup_arguments' ,
233- "output = repr(get_setup_arguments('%s'))" % setup_py ,
234- "sys.stdout.buffer.write(output.encode('utf-8'))" ]
234+ "output = get_setup_arguments('%s')" % setup_py ,
235+ 'pickle.dump(output, sys.stdout.buffer)'
236+ ]
235237
236238 # invoke get_setup_arguments() in a separate interpreter
237239 cmd = [sys .executable , '-c' , ';' .join (code_lines )]
@@ -294,7 +296,7 @@ def _get_setup_information(setup_py, *, env=None):
294296 # skip values with custom type OrderedSet
295297 " if k not in ('license_files', 'provides_extras')}" ,
296298
297- 'pickle.dump(data, sys.stdout)' ]
299+ 'pickle.dump(data, sys.stdout.buffer )' ]
298300
299301 # invoke distutils.core.run_setup() in a separate interpreter
300302 cmd = [
0 commit comments