Menu

#3 DOPAL incompatibility with BitTyrant

open
nobody
DOPAL (2)
5
2009-01-04
2009-01-04
dragon788
No

I'm attempting to use the BitTyrant client with torrentflux-b4rt, they are using version 0.60 of DOPAL. The error thrown by the original code in the Python console is below:
ValueError: invalid literal for int() with base 10: '0BitTyrant'

I tracked it down to lines 87-105 of utils.py included with the DOPAL they provided. Line 94 is the troublesome one.

87 def parse_azureus_version_string(ver_string):
88 ver_bits = ver_string.split('_', 2)
89 if len(ver_bits) == 1:
90 major_ver, minor_ver = ver_string, None
91 else:
92 major_ver, minor_ver = ver_bits
93
94 ver_segments = [int(bit) for bit in major_ver.split('.')]
95 if minor_ver:
96 if minor_ver[0].lower() == 'b':
97 ver_segments.append('b')
98 try:
99 beta_ver = int(minor_ver[1:])
100 except ValueError:
101 pass
102 else:
103 ver_segments.append(beta_ver)
104
105 return tuple(ver_segments)

Could this be rewritten/updated to allow for the BitTyrant client, or is there a simple if statement I could add to make it work (not throwing the error that upsets the apple cart?).

Discussion


Log in to post a comment.