| 1 |
diff -dur a/mac_alias/alias.py b/mac_alias/alias.py |
| 2 |
--- a/mac_alias/alias.py 2015-10-19 12:12:48.000000000 +0200 |
| 3 |
+++ b/mac_alias/alias.py 2016-04-03 12:13:12.037159417 +0200 |
| 4 |
@@ -243,10 +243,10 @@ |
| 5 |
alias = Alias() |
| 6 |
alias.appinfo = appinfo |
| 7 |
|
| 8 |
- alias.volume = VolumeInfo (volname.replace('/',':'), |
| 9 |
+ alias.volume = VolumeInfo (volname.decode().replace('/',':'), |
| 10 |
voldate, fstype, disktype, |
| 11 |
volattrs, volfsid) |
| 12 |
- alias.target = TargetInfo (kind, filename.replace('/',':'), |
| 13 |
+ alias.target = TargetInfo (kind, filename.decode().replace('/',':'), |
| 14 |
folder_cnid, cnid, |
| 15 |
crdate, creator_code, type_code) |
| 16 |
alias.target.levels_from = levels_from |
| 17 |
@@ -261,9 +261,9 @@ |
| 18 |
b.read(1) |
| 19 |
|
| 20 |
if tag == TAG_CARBON_FOLDER_NAME: |
| 21 |
- alias.target.folder_name = value.replace('/',':') |
| 22 |
+ alias.target.folder_name = value.decode().replace('/',':') |
| 23 |
elif tag == TAG_CNID_PATH: |
| 24 |
- alias.target.cnid_path = struct.unpack(b'>%uI' % (length // 4), |
| 25 |
+ alias.target.cnid_path = struct.unpack('>%uI' % (length // 4), |
| 26 |
value) |
| 27 |
elif tag == TAG_CARBON_PATH: |
| 28 |
alias.target.carbon_path = value |
| 29 |
@@ -298,9 +298,9 @@ |
| 30 |
alias.target.creation_date \ |
| 31 |
= mac_epoch + datetime.timedelta(seconds=seconds) |
| 32 |
elif tag == TAG_POSIX_PATH: |
| 33 |
- alias.target.posix_path = value |
| 34 |
+ alias.target.posix_path = value.decode() |
| 35 |
elif tag == TAG_POSIX_PATH_TO_MOUNTPOINT: |
| 36 |
- alias.volume.posix_path = value |
| 37 |
+ alias.volume.posix_path = value.decode() |
| 38 |
elif tag == TAG_RECURSIVE_ALIAS_OF_DISK_IMAGE: |
| 39 |
alias.volume.disk_image_alias = Alias.from_bytes(value) |
| 40 |
elif tag == TAG_USER_HOME_LENGTH_PREFIX: |
| 41 |
@@ -422,13 +422,13 @@ |
| 42 |
# (so doing so is ridiculous, and nothing could rely on it). |
| 43 |
b.write(struct.pack(b'>h28pI2shI64pII4s4shhI2s10s', |
| 44 |
self.target.kind, |
| 45 |
- carbon_volname, voldate, |
| 46 |
+ carbon_volname, int(voldate), |
| 47 |
self.volume.fs_type, |
| 48 |
self.volume.disk_type, |
| 49 |
self.target.folder_cnid, |
| 50 |
carbon_filename, |
| 51 |
self.target.cnid, |
| 52 |
- crdate, |
| 53 |
+ int(crdate), |
| 54 |
self.target.creator_code, |
| 55 |
self.target.type_code, |
| 56 |
self.target.levels_from, |
| 57 |
@@ -449,12 +449,12 @@ |
| 58 |
|
| 59 |
b.write(struct.pack(b'>hhQhhQ', |
| 60 |
TAG_HIGH_RES_VOLUME_CREATION_DATE, |
| 61 |
- 8, long(voldate * 65536), |
| 62 |
+ 8, int(voldate * 65536), |
| 63 |
TAG_HIGH_RES_CREATION_DATE, |
| 64 |
- 8, long(crdate * 65536))) |
| 65 |
+ 8, int(crdate * 65536))) |
| 66 |
|
| 67 |
if self.target.cnid_path: |
| 68 |
- cnid_path = struct.pack(b'>%uI' % len(self.target.cnid_path), |
| 69 |
+ cnid_path = struct.pack('>%uI' % len(self.target.cnid_path), |
| 70 |
*self.target.cnid_path) |
| 71 |
b.write(struct.pack(b'>hh', TAG_CNID_PATH, |
| 72 |
len(cnid_path))) |