Skip to content

Python3 + PyQt6 port for Debian derived Linux #2227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 34 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
6dfecbe
try to migrate to Python3 + PyQt6
kashikoibumi May 12, 2024
057e856
try to migrate to Python3 + PyQt6; part 2
kashikoibumi May 13, 2024
16019d4
enable TLS connection
kashikoibumi May 13, 2024
e646377
fix GUIs to work with PyQt6
kashikoibumi May 14, 2024
741f8dd
fix some parts of inventory syncing
kashikoibumi May 14, 2024
88b1497
fix decryption to work in Python 3
kashikoibumi May 15, 2024
4f0e34b
make message sending work in Python 3
kashikoibumi May 15, 2024
cdbe5f8
fix exception from network status
kashikoibumi May 15, 2024
2109fc0
fix sending v4 pubkey
kashikoibumi May 15, 2024
ba9734e
fix pubkey check
kashikoibumi May 15, 2024
6a090e8
fix some bugs related to the migration to Python3
kashikoibumi May 15, 2024
ec91d9f
fix HTML display such as URL, email address and image
kashikoibumi May 16, 2024
1b3ce71
use bytes for key of hashtable in replacement of hexlified string
kashikoibumi May 16, 2024
24b83aa
run autopep8 on src
kashikoibumi May 16, 2024
60af410
fix complains from flake8
kashikoibumi May 16, 2024
ab9fc0b
run autopep8 on src/bitmessageqt
kashikoibumi May 16, 2024
bcf02ff
fix complains from flake8; part 2
kashikoibumi May 16, 2024
3b37faf
change command from python2.7 to python3
kashikoibumi May 16, 2024
416463f
Revert "change command from python2.7 to python3"
kashikoibumi May 17, 2024
1077548
Revert "fix complains from flake8; part 2"
kashikoibumi May 17, 2024
1e53720
Revert "run autopep8 on src/bitmessageqt"
kashikoibumi May 17, 2024
a02ef70
Revert "fix complains from flake8"
kashikoibumi May 17, 2024
97c9b7e
Revert "run autopep8 on src"
kashikoibumi May 17, 2024
74bb876
fix small failures in migrating to Python3 + PyQt6
kashikoibumi May 18, 2024
8c2701c
Merge branch 'v0.6' into main
kashikoibumi May 18, 2024
bc254a9
eliminate semicolons
kashikoibumi May 18, 2024
3f808fb
fix to pass tests.py
kashikoibumi May 18, 2024
af52f80
fix to run with python3-prctl
kashikoibumi May 18, 2024
3368089
load data as 'bytes' instead of 'str' from SQLite
kashikoibumi May 18, 2024
75d2b36
fix UPnP support
kashikoibumi May 20, 2024
218cc97
make daemon mode runnable
kashikoibumi May 20, 2024
b12c7cd
replace remained arg() with format()
kashikoibumi May 22, 2024
149c90c
Merge branch 'v0.6'
kashikoibumi May 22, 2024
4c8bce4
fix type of literals that should be binary
kashikoibumi May 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ coverage.xml
**coverage.json
.buildozer
.tox
*.swp
typescript
24 changes: 12 additions & 12 deletions src/addresses.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def decodeAddress(address):
integer = decodeBase58(address)
if integer == 0:
status = 'invalidcharacters'
return status, 0, 0, ''
return status, 0, 0, b''
# after converting to hex, the string will be prepended
# with a 0x and appended with a L in python2
hexdata = hex(integer)[2:].rstrip('L')
Expand All @@ -200,31 +200,31 @@ def decodeAddress(address):

if checksum != double_sha512(data[:-4])[0:4]:
status = 'checksumfailed'
return status, 0, 0, ''
return status, 0, 0, b''

try:
addressVersionNumber, bytesUsedByVersionNumber = decodeVarint(data[:9])
except varintDecodeError as e:
logger.error(str(e))
status = 'varintmalformed'
return status, 0, 0, ''
return status, 0, 0, b''

if addressVersionNumber > 4:
logger.error('cannot decode address version numbers this high')
status = 'versiontoohigh'
return status, 0, 0, ''
return status, 0, 0, b''
elif addressVersionNumber == 0:
logger.error('cannot decode address version numbers of zero.')
status = 'versiontoohigh'
return status, 0, 0, ''
return status, 0, 0, b''

try:
streamNumber, bytesUsedByStreamNumber = \
decodeVarint(data[bytesUsedByVersionNumber:])
except varintDecodeError as e:
logger.error(str(e))
status = 'varintmalformed'
return status, 0, 0, ''
return status, 0, 0, b''

status = 'success'
if addressVersionNumber == 1:
Expand All @@ -242,21 +242,21 @@ def decodeAddress(address):
return status, addressVersionNumber, streamNumber, \
b'\x00\x00' + embeddedRipeData
elif len(embeddedRipeData) < 18:
return 'ripetooshort', 0, 0, ''
return 'ripetooshort', 0, 0, b''
elif len(embeddedRipeData) > 20:
return 'ripetoolong', 0, 0, ''
return 'otherproblem', 0, 0, ''
return 'ripetoolong', 0, 0, b''
return 'otherproblem', 0, 0, b''
elif addressVersionNumber == 4:
embeddedRipeData = \
data[bytesUsedByVersionNumber + bytesUsedByStreamNumber:-4]
if embeddedRipeData[0:1] == b'\x00':
# In order to enforce address non-malleability, encoded
# RIPE data must have NULL bytes removed from the front
return 'encodingproblem', 0, 0, ''
return 'encodingproblem', 0, 0, b''
elif len(embeddedRipeData) > 20:
return 'ripetoolong', 0, 0, ''
return 'ripetoolong', 0, 0, b''
elif len(embeddedRipeData) < 4:
return 'ripetooshort', 0, 0, ''
return 'ripetooshort', 0, 0, b''
x00string = b'\x00' * (20 - len(embeddedRipeData))
return status, addressVersionNumber, streamNumber, \
x00string + embeddedRipeData
Expand Down
2 changes: 1 addition & 1 deletion src/bitmessagemain.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@
import bitmessagecurses
bitmessagecurses.runwrapper()
else:
import bitmessageqt

Check failure on line 250 in src/bitmessagemain.py

View check run for this annotation

PyBitmessage Code Quality Checks / Code Quality - pylint

E0401 / import-error

Unable to import 'bitmessageqt' (invalid syntax (<string>, line 1603))
bitmessageqt.run()
else:
config.remove_option('bitmessagesettings', 'dontconnect')
Expand Down Expand Up @@ -325,7 +325,7 @@
if not sys.platform.startswith('win'):
si = open(os.devnull, 'r')
so = open(os.devnull, 'a+')
se = open(os.devnull, 'a+', 0)
se = open(os.devnull, 'ab+', 0)
os.dup2(si.fileno(), sys.stdin.fileno())
os.dup2(so.fileno(), sys.stdout.fileno())
os.dup2(se.fileno(), sys.stderr.fileno())
Expand Down
Loading
Loading