Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: 'ascii' codec can't encode character u'\xb7' in position 143: ordinal not in range(128) #84

Open
gabrielhpugliese opened this issue Jul 15, 2015 · 2 comments

Comments

@gabrielhpugliese
Copy link

Hi,

I'm using beaker on production for a big website (10k+ concurrent users) for years.
One day, one of our developers received that error Error: 'ascii' codec can't encode character u'\xb7' in position 143: ordinal not in range(128) and I went down to debug what's happening. I could finally go to the correct line of error:

formated_key = (self.namespace + '_' + key).replace(' ', '\302\267')

I can continue my debug on our part to see why only after years it's happening now and stuff, but I just have a question: is there any special reason for replacing spaces with a unicode middle dot (·)? I've put another string for replacement, like 'HELLO', without unicode stuff, it worked well on the development process.

@amol-
Copy link
Collaborator

amol- commented Sep 20, 2015

It got introduced in 48a6da2

It looks to me that it got just used a really uncommon character to avoid colliding with other keys the user might have created.

I think that the proper solution would be to raise an error if the key contains a space instead of trying to automatically solve it. Any string you might use can actually collide.

Have you been able to find the origin of the problem? What was triggering the issue on your side?

@gabrielhpugliese
Copy link
Author

I don't remember it well, but it was about some space in urls I think. I can check it again if it's the case. Other devs complained about it as well.

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

No branches or pull requests

2 participants