Quantcast
Channel: Active questions tagged amazon-ec2 - Stack Overflow
Viewing all articles
Browse latest Browse all 29250

'ascii' codec can't encode characters in position 1-2: ordinal not in range(128) [Scrapy 1.8 | Python 3.6 | EC2 | Ubuntu 18.04]

$
0
0

I'm trying to run my scrapy crawlers from an EC2 instance on AWS but I'm getting this error that occurs also on Scrapinghub:

'ascii' codec can't encode characters in position 1-2: ordinal not in range(128)

I've already tried to use UTF-8 encoding with no success.

I've installed the language pack to use the iso-8859-1 encoding (Portuguese-BR) as you can see here when I run locale -a:

C
C.UTF-8
en_US.iso88591
en_US.utf8
POSIX
pt_BR
pt_BR.iso88591

The head of my spiders.py:

# -*- coding: iso-8859-1 -*-

This project works fine on windows, and here is the encoding pattern of my SO running [System.Text.Encoding]::Default on Powershell:

IsSingleByte      : True
BodyName          : iso-8859-1
EncodingName      : Europa Ocidental (Windows)
HeaderName        : Windows-1252
WebName           : Windows-1252
WindowsCodePage   : 1252
IsBrowserDisplay  : True
IsBrowserSave     : True
IsMailNewsDisplay : True
IsMailNewsSave    : True
EncoderFallback   : System.Text.InternalEncoderBestFitFallback
DecoderFallback   : System.Text.InternalDecoderBestFitFallback
IsReadOnly        : True
CodePage          : 1252

Is there another encoding pattern that I can use or am I missing some config on my Scrapy project/EC2 Ubuntu Server?


Viewing all articles
Browse latest Browse all 29250

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>