aio-libs / aio-libs/aiopg

Unicode encoding error over the line

Open
#51 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.4k
Forks
170
PR merge metrics
No merged PRs in 30d

Description

When inserting, I get the following internal error from aiopg

```
File "/usr/local/lib/python3.4/dist-packages/aiopg/sa/connection.py", line 115, in scalar
res = yield from self.execute(query, *multiparams, **params)
File "/usr/local/lib/python3.4/dist-packages/aiopg/sa/connection.py", line 102, in execute
yield from cursor.execute(str(compiled), post_processed_params[0])
File "/usr/local/lib/python3.4/dist-packages/aiopg/cursor.py", line 106, in execute
self._impl.execute(operation, parameters)
UnicodeEncodeError: 'ascii' codec can't encode character '\xe9' in position 4198: ordinal not in range(128)
```

Invocation is:

```
@asyncio.coroutine
def create(self, **kwargs):
with (yield from self.db.engine) as conn:
runid = yield from conn.scalar(insert(Run.__table__).values(**kwargs))
```

It's likely breaking on the log of a Run:

```
class Run(Base):
__tablename__ = 'run'
id = Column(Integer, primary_key=True)
failed = Column(Boolean)
job_id = Column(Integer, ForeignKey('job.id'))
job = relationship("Job", foreign_keys=[job_id], backref='runs')
log = Column(Text)
start_time = Column(DateTime)
end_time = Column(DateTime)
```

I'm guessing it's the `log` field

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.