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

std::runtime_error: collate_byname<char>::collate_byname failed to construct for C/zh_CN.UTF-8 #164

Closed
EdwardNian opened this issue May 16, 2018 · 6 comments

Comments

@EdwardNian
Copy link

When I used Microsoft ODBC Driver 17 for SQL Server and django-pyodbc-azure 2.0.4.1 on Mac ,got "libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: collate_byname::collate_byname failed to construct for C/zh_CN.UTF-8/C/C/C/C".

But switch to freetds, no issues happened.

When I used Microsoft ODBC Driver 17 for SQL Server and django-pyodbc-azure 1.11.0 on Mac, got
no issues too.
Could some one help?Thanks.

@kitsuyui
Copy link

kitsuyui commented May 28, 2018

@EdwardNian

I had the same issue too. I cannot found why it has caused yet.
But I found a workaround.
Create sitecustomize.py with following content into site-packages.

import locale
locale.setlocale(locale.LC_ALL, locale.getlocale())

Then it works. It is worthless when setting environment variable with same.

@v-makouz
Copy link

@EdwardNian I'm looking into this, which version of ODBC Driver 17 are you using? Easy way to check is to run:
ls -l /usr/local/lib/libmsodbcsql.17.dylib

@EdwardNian
Copy link
Author

@v-makouz /usr/local/lib/libmsodbcsql.17.dylib -> ../Cellar/msodbcsql17/17.1.0.1/lib/libmsodbcsql.17.dylib

@kitsuyui
Copy link

I think this is same problem on this: microsoft/homebrew-mssql-release#18

So I think it might not be happen on the new version.

$ brew upgrade --no-sandbox msodbcsql17 mssql-tools

https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-2017

@v-makouz
Copy link

@EdwardNian Can you try the latest version (17.2.0.1)? There was a locale detection bug fixed in that one, but there may be more issues with the locales so I'm trying to gather more info.

@EdwardNian
Copy link
Author

@kitsuyui @v-makouz
The new version works fine!
Thank you for your kindly answer. I'll close the ticket.Thank you.

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

3 participants