Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
installsystems
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Seblu
installsystems
Commits
9498271d
Commit
9498271d
authored
12 years ago
by
Sébastien Luttringer
Browse files
Options
Downloads
Patches
Plain Diff
fix python2.6 doesn"t allow keywords args for str.encode
parent
01c677ab
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
installsystems/image.py
+2
-2
2 additions, 2 deletions
installsystems/image.py
installsystems/printer.py
+1
-1
1 addition, 1 deletion
installsystems/printer.py
with
3 additions
and
3 deletions
installsystems/image.py
+
2
−
2
View file @
9498271d
...
...
@@ -803,13 +803,13 @@ class PackageImage(Image):
if
gendescription
:
arrow
(
u
"
Generating description file in %s
"
%
directory
)
with
open
(
os
.
path
.
join
(
directory
,
"
description
"
),
"
w
"
)
as
f
:
f
.
write
((
istemplate
.
description
%
self
.
_metadata
).
encode
(
'
utf
-8
'
))
f
.
write
((
istemplate
.
description
%
self
.
_metadata
).
encode
(
"
UTF
-8
"
))
# launch payload extraction
if
payload
:
for
payname
in
self
.
payload
:
# here we need to decode payname which is in unicode to escape
# tarfile to encode filename of file inside tarball inside unicode
dest
=
os
.
path
.
join
(
directory
,
"
payload
"
,
payname
.
encode
(
"
utf
-8
"
))
dest
=
os
.
path
.
join
(
directory
,
"
payload
"
,
payname
.
encode
(
"
UTF
-8
"
))
arrow
(
u
"
Extracting payload %s in %s
"
%
(
payname
,
dest
))
self
.
payload
[
payname
].
extract
(
dest
,
force
=
force
)
...
...
This diff is collapsed.
Click to expand it.
installsystems/printer.py
+
1
−
1
View file @
9498271d
...
...
@@ -59,7 +59,7 @@ def out(message="", fd=sys.stdout, endl=os.linesep, flush=True):
# convert unicode into str before write
# this can cause issue on python 2.6
if
type
(
message
)
==
unicode
:
message
=
message
.
encode
(
locale
.
getpreferredencoding
(),
errors
=
'
replace
'
)
message
=
message
.
encode
(
locale
.
getpreferredencoding
(),
"
replace
"
)
# printing
fd
.
write
(
"
%s%s
"
%
(
message
,
endl
))
if
flush
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment