lp:~cjwatson/meliae/py3-declare-support

Created by Colin Watson and last modified
Get this branch:
bzr branch lp:~cjwatson/meliae/py3-declare-support
Only Colin Watson can upload to this branch. If you are Colin Watson please log in for upload directions.

Branch merges

Related bugs

Related blueprints

Branch information

Owner:
Colin Watson
Project:
Meliae
Status:
Merged

Recent revisions

225. By Colin Watson

Declare support for Python 3.4-3.8.

224. By Colin Watson

Store type_str as an interned str rather than bytes.

Type strings are likely to be drawn from a relatively small pool, so this
still saves memory for large dumps while being more convenient to deal with
than bytes on Python 3.

223. By Colin Watson

Merge trunk.

222. By Colin Watson

Use more compact representations when loading dumps.

The natural representations of the "type_str", "name", and (in some cases)
"value" fields of objects loaded from dumps would be str, but on Python 3
this is a somewhat less efficient representation of ASCII strings, and for
dumps of large processes a compact representation may well matter. To that
end, use bytes where possible.

In general I've tried to confine this to just the highest-volume objects.
For example, meliae.loader._TypeSummary doesn't need to be as dense, so
convenience makes more sense there and _TypeSummary.type_str is a str.

Some methods gain affordances to encode from or decode to str where
appropriate for convenience, where doing so doesn't cause other problems.

I extended meliae.tests.test_loader._example_dump to include both bytes and
text objects, in order to test the slightly different representations of
each.

221. By Colin Watson

Ensure coherent bytes/text handling of sources in meliae.loader.

meliae.files.open_file (called by load if given a string file name) opens
files in binary mode, so it seems most appropriate for the loader tests to
pass in dumps as bytes. However, parsing is easier with text, so decode
lines at the boundary before parsing them.

220. By John A Meinel

Update _scanner for Python 3 types.

PyDict, PyUnicode, PyLong all are different in 3.*, and have even changed a bit
during the 3.x lifetime. But these all pass the new test suite, and avoid
allocating a PyLong for every object that we know about.

219. By John A Meinel

Python 3 doesn't have the old FILE interface.

Now we just use raw write() to file descriptors. It may mean we aren't doing
buffered IO, which is a bit of a shame, but at least it works on both Python2
and Python3 and still allows us to take a memory dump with fewer allocations.

218. By John A Meinel

Remove _format_list and _set_default as they were no longer used.

217. By John A Meinel

Use six.string_types instead of basestring.

216. By John A Meinel

Use cleaner import statements, since cython does it in a nicer way.

Branch metadata

Branch format:
Branch format 7
Repository format:
Bazaar repository format 2a (needs bzr 1.16 or later)
Stacked on:
lp:meliae
This branch contains Public information 
Everyone can see this information.

Subscribers