Skip to content

Configure Python with --enable-unicode=ucs4 #38

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

Merged
merged 1 commit into from
Mar 2, 2015

Conversation

Starefossen
Copy link
Contributor

Ref. #21 I went ahead and added the --enable-unicode=ucs4 configuration flag.

Maybe this could be solved via a PYTHON_CONFIGURE_OPTS environment variable?

Bulk update all Dockerfiles with the following command:

```bash
find . -name 'Dockerfile' | xargs sed -i '' 's/--enable-shared/--enable-shared --enable-unicode=ucs4/g'
```
@tianon
Copy link
Member

tianon commented Mar 2, 2015

This seems reasonable to me. 👍

@paultag since you have really strong opinions on Python and UTF8, care to weigh in?

https://docs.python.org/2/c-api/unicode.html

This type represents the storage type which is used by Python internally as basis for holding Unicode ordinals. Python’s default builds use a 16-bit type for Py_UNICODE and store Unicode values internally as UCS2. It is also possible to build a UCS4 version of Python (most recent Linux distributions come with UCS4 builds of Python). These builds then use a 32-bit type for Py_UNICODE and store Unicode data internally as UCS4. On platforms where wchar_t is available and compatible with the chosen Python Unicode build variant, Py_UNICODE is a typedef alias for wchar_t to enhance native platform compatibility. On all other platforms, Py_UNICODE is a typedef alias for either unsigned short (UCS2) or unsigned long (UCS4).

https://docs.python.org/3/c-api/unicode.html also has this interesting tidbit: (but not much else one way or another)

When dealing with single Unicode characters, use Py_UCS4.

@paultag
Copy link

paultag commented Mar 2, 2015

Euch, sorry, was going to reply, yeah this seems entirely reasonable to me!

👍

@tianon
Copy link
Member

tianon commented Mar 2, 2015

LGTM

@tianon
Copy link
Member

tianon commented Mar 2, 2015

(thanks @paultag ❤️)

@yosifkit
Copy link
Member

yosifkit commented Mar 2, 2015

LGTM

yosifkit added a commit that referenced this pull request Mar 2, 2015
Configure Python with --enable-unicode=ucs4
@yosifkit yosifkit merged commit c6e8f0d into docker-library:master Mar 2, 2015
tianon added a commit to infosiftr/stackbrew that referenced this pull request Mar 3, 2015
- `django`: 1.7.5, Python 3.4.3
- `ghost`: 0.5.9
- `golang`: change `/go` to be `777` (docker-library/golang#44)
- `java`: 7u75-2.5.4-2
- `mariadb`: 10.1.3, 10.0.17
- `mongo`: 3.0.0
- `php`: more aggressive autoremove (docker-library/php#71)
- `postgres`: `POSTGRES_DB` (docker-library/postgres#49)
- `python`: 3.4.3, `--enable-unicode=ucs4` (docker-library/python#38)
- `rails`: Ruby 2.2.1
- `ruby`: 2.2.1, 2.0.0-p643
@Starefossen
Copy link
Contributor Author

Does anyone know when the image on Docker Hub will be updated?

@tianon
Copy link
Member

tianon commented Mar 4, 2015 via email

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

Successfully merging this pull request may close these issues.

4 participants