hope this fix your issue When you use cPickle.load() you are trying to unpickle (deserialize) a previously pickled file into a Python object. To pickle (serialize) an object to a file you should use cPickle.dump().
With these it helps Your problem is not with cmd and how it handles quote characters. It is with start and how it handles quote characters. If the first parameter to start is a quoted string, it is the title of the command window, rather than the command to execute. Usage looks like this
START ["title"] [/D path] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED]
[/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL]
[/NODE <NUMA node>] [/AFFINITY <hex affinity mask>] [/WAIT] [/B]
"title" Title to display in window title bar.
cmd /c start "" "C:\Program Files"
What causes the error "_pickle.UnpicklingError: invalid load key, ' '."?
help you fix your problem pickling is recursive, not sequential. Thus, to pickle a list, pickle will start to pickle the containing list, then pickle the first element… diving into the first element and pickling dependencies and sub-elements until the first element is serialized. Then moves on to the next element of the list, and so on, until it finally finishes the list and finishes serializing the enclosing list. In short, it's hard to treat a recursive pickle as sequential, except for some special cases. It's better to use a smarter pattern on your dump, if you want to load in a special way. The most common pickle, it to pickle everything with a single dump to a file -- but then you have to load everything at once with a single load. However, if you open a file handle and do multiple dump calls (e.g. one for each element of the list, or a tuple of selected elements), then your load will mirror that… you open the file handle and do multiple load calls until you have all the list elements and can reconstruct the list. It's still not easy to selectively load only certain list elements, however. To do that, you'd probably have to store your list elements as a dict (with the index of the element or chunk as the key) using a package like klepto, which can break up a pickled dict into several files transparently, and enables easy loading of specific elements.
wish helps you An update on this topic, for possible future reference to whoever will experience the same problem. The problem was not caused, as I initially thought, by a misconversion between Py2 and Py3 pickled byte stream. It was caused, instead, by the incorrect transmission of the data: I was interrupting the connection before all the packages had arrived. This is the block of code that solved my problem:
data_in = b''
block = self.socket.recv(4096)
data_in += block