@@ -2047,7 +2047,7 @@ def click_pushButtonSend(self):
2047
2047
# attempt register
2048
2048
if email [- 14 :] != "@mailchuck.com" :
2049
2049
# 12 character random email address
2050
- email = '' .join (
2050
+ email = u '' .join (
2051
2051
random .SystemRandom ().choice (
2052
2052
string .ascii_lowercase
2053
2053
) for _ in range (12 )
@@ -2063,78 +2063,77 @@ def click_pushButtonSend(self):
2063
2063
" an email gateway. Sending registration"
2064
2064
" now as {0}, please wait for the registration"
2065
2065
" to be processed before retrying sending."
2066
- ).format (email )
2067
- )
2066
+ ).format (email ))
2068
2067
return
2069
2068
status , addressVersionNumber , streamNumber , ripe = \
2070
2069
decodeAddress (toAddress )
2071
2070
if status != 'success' :
2072
2071
try :
2073
- toAddress = unicode (toAddress , 'utf-8' , 'ignore' )
2072
+ toAddress_value = unicode (
2073
+ toAddress , 'utf-8' , 'ignore' )
2074
2074
except :
2075
2075
logger .warning (
2076
- "Failed unicode(toAddress ):" ,
2077
- exc_info = True )
2076
+ "Failed unicode(toAddress ):" , exc_info = True )
2078
2077
logger .error (
2079
2078
'Error: Could not decode recipient address %s: %s' ,
2080
- toAddress , status )
2079
+ toAddress_value , status )
2081
2080
2082
2081
if status == 'missingbm' :
2083
2082
self .updateStatusBar (_translate (
2084
2083
"MainWindow" ,
2085
2084
"Error: Bitmessage addresses start with"
2086
2085
" BM- Please check the recipient address {0}"
2087
- ).format (toAddress ))
2086
+ ).format (toAddress_value ))
2088
2087
elif status == 'checksumfailed' :
2089
2088
self .updateStatusBar (_translate (
2090
2089
"MainWindow" ,
2091
2090
"Error: The recipient address {0} is not"
2092
2091
" typed or copied correctly. Please check it."
2093
- ).format (toAddress ))
2092
+ ).format (toAddress_value ))
2094
2093
elif status == 'invalidcharacters' :
2095
2094
self .updateStatusBar (_translate (
2096
2095
"MainWindow" ,
2097
2096
"Error: The recipient address {0} contains"
2098
2097
" invalid characters. Please check it."
2099
- ).format (toAddress ))
2098
+ ).format (toAddress_value ))
2100
2099
elif status == 'versiontoohigh' :
2101
2100
self .updateStatusBar (_translate (
2102
2101
"MainWindow" ,
2103
2102
"Error: The version of the recipient address"
2104
2103
" {0} is too high. Either you need to upgrade"
2105
2104
" your Bitmessage software or your"
2106
2105
" acquaintance is being clever."
2107
- ).format (toAddress ))
2106
+ ).format (toAddress_value ))
2108
2107
elif status == 'ripetooshort' :
2109
2108
self .updateStatusBar (_translate (
2110
2109
"MainWindow" ,
2111
2110
"Error: Some data encoded in the recipient"
2112
2111
" address {0} is too short. There might be"
2113
2112
" something wrong with the software of"
2114
2113
" your acquaintance."
2115
- ).format (toAddress ))
2114
+ ).format (toAddress_value ))
2116
2115
elif status == 'ripetoolong' :
2117
2116
self .updateStatusBar (_translate (
2118
2117
"MainWindow" ,
2119
2118
"Error: Some data encoded in the recipient"
2120
2119
" address {0} is too long. There might be"
2121
2120
" something wrong with the software of"
2122
2121
" your acquaintance."
2123
- ).format (toAddress ))
2122
+ ).format (toAddress_value ))
2124
2123
elif status == 'varintmalformed' :
2125
2124
self .updateStatusBar (_translate (
2126
2125
"MainWindow" ,
2127
2126
"Error: Some data encoded in the recipient"
2128
2127
" address {0} is malformed. There might be"
2129
2128
" something wrong with the software of"
2130
2129
" your acquaintance."
2131
- ).format (toAddress ))
2130
+ ).format (toAddress_value ))
2132
2131
else :
2133
2132
self .updateStatusBar (_translate (
2134
2133
"MainWindow" ,
2135
2134
"Error: Something is wrong with the"
2136
2135
" recipient address {0}."
2137
- ).format (toAddress ))
2136
+ ).format (toAddress_value ))
2138
2137
elif fromAddress == '' :
2139
2138
self .updateStatusBar (_translate (
2140
2139
"MainWindow" ,
@@ -4343,6 +4342,8 @@ def tableWidgetInboxItemClicked(self):
4343
4342
except NameError :
4344
4343
message = u""
4345
4344
except IndexError :
4345
+ # _translate() often returns unicode, no redefinition here!
4346
+ # pylint: disable=redefined-variable-type
4346
4347
message = _translate (
4347
4348
"MainWindow" ,
4348
4349
"Error occurred: could not load message from disk."
0 commit comments