Skip to content
This repository has been archived by the owner on Jul 10, 2022. It is now read-only.

utf8 characters prevent upload #115

Open
bitpusher-real opened this issue Jan 6, 2017 · 6 comments
Open

utf8 characters prevent upload #115

bitpusher-real opened this issue Jan 6, 2017 · 6 comments

Comments

@bitpusher-real
Copy link

bitpusher-real commented Jan 6, 2017

package.rb:283:in `block (2 levels) in parse_control': invalid byte sequence in UTF-8 (ArgumentError)

Ubuntu 14.04
deb-s3-0.8.0
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]

@krobertson
Copy link
Owner

I will take a look. Is the package you were working with public?

BTW, I remember BitPusher from back in the day when mhalligan was with you. Will take a look tomorrow afternoon when I'm near a comparable env.

@bitpusher-real
Copy link
Author

Thanks Ken :) The package is Wowza Streaming Server 4.1.2 ... I'm not sure if the .deb is publicly available... I can only seem to find the .bin executables. But I could make it available somewhere if you need.

@JedMeister
Copy link

Not 100% sure if this is exactly the same issue, but figured I'd post here as it seems incredibly close. I hope that's ok.

My error is similar but not quite identical:

package.rb:283:in `block (2 levels) in parse_control': invalid byte sequence in US-ASCII (ArgumentError)

When trying to upload a Debian backport deb to my local repo. I downloaded it direct from the Debian mirror. FWIW I am running Debian Jessie on my laptop.

The explicit package is: https://packages.debian.org/jessie-backports/dehydrated

FWIW here's a direct link: http://ftp.us.debian.org/debian/pool/main/d/dehydrated/dehydrated_0.3.1-3~bpo8+1_all.deb

@blamarvt
Copy link

I hit this today:

>> Examining package file shared-mime-info_1.2-0ubuntu3_amd64.deb
/var/lib/gems/1.9.1/gems/deb-s3-0.9.1/lib/deb/s3/package.rb:283:in `block (2 levels) in parse_control': invalid byte sequence in US-ASCII (ArgumentError)
	from /var/lib/gems/1.9.1/gems/deb-s3-0.9.1/lib/deb/s3/package.rb:282:in `each_line'
	from /var/lib/gems/1.9.1/gems/deb-s3-0.9.1/lib/deb/s3/package.rb:282:in `block in parse_control'
	from /var/lib/gems/1.9.1/gems/deb-s3-0.9.1/lib/deb/s3/package.rb:281:in `tap'
	from /var/lib/gems/1.9.1/gems/deb-s3-0.9.1/lib/deb/s3/package.rb:281:in `parse_control'
	from /var/lib/gems/1.9.1/gems/deb-s3-0.9.1/lib/deb/s3/package.rb:223:in `extract_info'
	from /var/lib/gems/1.9.1/gems/deb-s3-0.9.1/lib/deb/s3/package.rb:46:in `parse_file'
	from /var/lib/gems/1.9.1/gems/deb-s3-0.9.1/lib/deb/s3/cli.rb:186:in `block in upload'
	from /var/lib/gems/1.9.1/gems/deb-s3-0.9.1/lib/deb/s3/cli.rb:184:in `each'
	from /var/lib/gems/1.9.1/gems/deb-s3-0.9.1/lib/deb/s3/cli.rb:184:in `upload'
	from /var/lib/gems/1.9.1/gems/thor-0.19.4/lib/thor/command.rb:27:in `run'
	from /var/lib/gems/1.9.1/gems/thor-0.19.4/lib/thor/invocation.rb:126:in `invoke_command'
	from /var/lib/gems/1.9.1/gems/thor-0.19.4/lib/thor.rb:369:in `dispatch'
	from /var/lib/gems/1.9.1/gems/thor-0.19.4/lib/thor/base.rb:444:in `start'
	from /var/lib/gems/1.9.1/gems/deb-s3-0.9.1/bin/deb-s3:8:in `<top (required)>'
	from /usr/local/bin/deb-s3:23:in `load'
	from /usr/local/bin/deb-s3:23:in `<main>'

I'll look and see if I can contribute a fix.

@blamarvt
Copy link

In my case this was an environment configuration error. I had to make sure the locale was set properly in my docker container:

locale-gen en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_ALL=en_US.UTF-8

@agimenez
Copy link
Contributor

agimenez commented May 7, 2018

@blamarvt I don't believe that is entirely a configuration error. The Debian Policy explicitly states that all control files must be encoded in UTF-8 (https://www.debian.org/doc/debian-policy/#syntax-of-control-files).

So I think that the code should explicitly open the file(s) in UTF-8 mode, if that makes sense, right?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants