-
Notifications
You must be signed in to change notification settings - Fork 576
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
Don't use "hello %1".arg("world") : arg() can't be used in Python 3 #2231
Comments
I found that this problem had been fixed in 'Porting bitmessageqt to Qt5 #1389', but it is not merged to v0.6 . |
Truth is a bit different. Example programs follows:
|
Simply replacing arg() to format() works well with PyQt5, but it does not work with PyQt4.
So in order to work with both PyQt5 and PyQt4, additional wrapping by str() is required.
This also works well with Python3.
The problem is that code becomes complex. |
|
I did not noticed it at all!! |
As far as my additional research, QString's arg() is able to be used in only Python2 + PyQt4. There is no solution that respects compatibility among Python versions nor PyQt versions. Then, what we should do? |
Don't use "hello %1".arg("world") : arg() can't be used in Python 3.
In my way to migrate PyBitmessage to the Python3 + PyQt6 environment, I found that arg() must be replaced to another method.
format() method can be used as the best replacement.
But format() uses a different format from arg().
Currently, arg() is used to translating strings.
I imagine If arg() is replaced to format(), all translation resources must be updated simultaneously.
Anyway, that can be a simple regex shell scripting work, but I don't know there are hidden obstacles to be exist or not.
Python 2.7 also support format(), so the migration can be done now.
Who prepares it?
...Me??
The text was updated successfully, but these errors were encountered: