Python Forum
pickle docs say bytes in one place, strings in another
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pickle docs say bytes in one place, strings in another
#1
for pickle documentation i read "The pickle and marshal modules can turn many Python data types into a stream of bytes and then recreate the objects from the bytes." and '“Pickling” is the process whereby a Python object hierarchy is converted into a byte stream, and “unpickling” is the inverse operation, whereby a byte stream is converted back into an object hierarchy.' and i also read "file must have a write() method that accepts a single string argument."

which can i use, bytes and/or strings?

i want to send picked data to a subprocess over a pipe, but the pipe wants data only in bytes. do i need to encode it before sending it? is there a way to send it over the pipe, directly?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
pickle docs say bytes in one place, strings in another - by Skaperen - Jul-29-2019, 02:17 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  TypeError: cannot pickle ‘_asyncio.Future’ object Abdul_Rafey 1 457 Mar-07-2024, 03:40 PM
Last Post: deanhystad
  Trying to understand strings and lists of strings Konstantin23 2 816 Aug-06-2023, 11:42 AM
Last Post: deanhystad
  place 2 windows exactly above each other janeik 3 968 Jul-23-2023, 03:12 AM
Last Post: deanhystad
  pickle problem DPaul 13 4,962 Sep-27-2022, 05:25 PM
Last Post: DPaul
  Splitting strings in list of strings jesse68 3 1,818 Mar-02-2022, 05:15 PM
Last Post: DeaD_EyE
  TypeError: cannot pickle n00sferatu 1 2,688 Dec-14-2021, 03:52 PM
Last Post: yakkaligiri
  Multiprocessing Can't pickle local object law 1 16,171 Aug-30-2021, 02:49 PM
Last Post: law
  Cannot 'break' from a "for" loop in a right place tester_V 9 4,042 Feb-17-2021, 01:03 AM
Last Post: tester_V
  Save/Loading using pickle Scordomaniac 4 3,084 Nov-24-2020, 06:11 PM
Last Post: Scordomaniac
  Where should I place GPIO.cleanup() shallanq 2 2,198 Apr-11-2020, 05:02 AM
Last Post: shallanq

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020