public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Python2 "narrow" build, Unicode issue in regex package
@ 2017-05-24  8:42 Václav Haisman
  2017-05-24 12:00 ` Erik Bray
  0 siblings, 1 reply; 2+ messages in thread
From: Václav Haisman @ 2017-05-24  8:42 UTC (permalink / raw)
  To: cygwin

Hi.

I have recently hit an issue ([1]) with Python 2.7 and regex package
for it on Cygwin. It appears that Cygwin's Python 2.7 is so called
narrow build. This causes issues when working with Unicode code point
outside BMP, like the emoji code points in my issue.

Is there a chance Cygwin's Python could be rebuilt as a wide build?

[1] https://bitbucket.org/mrabarnett/mrab-regex/issues/241/issues-matching-unicode-code-ranges-with-p


-- 
VH

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Python2 "narrow" build, Unicode issue in regex package
  2017-05-24  8:42 Python2 "narrow" build, Unicode issue in regex package Václav Haisman
@ 2017-05-24 12:00 ` Erik Bray
  0 siblings, 0 replies; 2+ messages in thread
From: Erik Bray @ 2017-05-24 12:00 UTC (permalink / raw)
  To: cygwin

On Wed, May 24, 2017 at 10:30 AM, Václav Haisman wrote:
> Hi.
>
> I have recently hit an issue ([1]) with Python 2.7 and regex package
> for it on Cygwin. It appears that Cygwin's Python 2.7 is so called
> narrow build. This causes issues when working with Unicode code point
> outside BMP, like the emoji code points in my issue.
>
> Is there a chance Cygwin's Python could be rebuilt as a wide build?
>
> [1] https://bitbucket.org/mrabarnett/mrab-regex/issues/241/issues-matching-unicode-code-ranges-with-p

I've been bitten by this before too, and I don't know if there's a
specific policy by which Cygwin has determined the narrow build should
be used.  Though narrow builds are typical on Windows because it
translates easily to native wide character strings on Windows, whereas
using a wide build introduces significantly more overhead.

I know it's trite to answer "use a different tool", but if at all
possible you might consider switching to Python 3, which is the
future. Heck, it's really the present.  Even most of the scientific
Python community has switched over to Python 3 (well, at least the
development community has--users are understandably a little slower).
Many large corporations, such a Instagram, have switched.  And Python
2 support is ending in 2020, so the sooner the better.  I know it's a
hassle though.

Anyways, on current versions of Python 3 (I think 3.3 and above) there
is no longer a wide- versus narrow- distinction.  Instead, each string
is stored in the smallest possible representation that fits the
highest codepoint in the string.

If you need a wide character build on Cygwin you could also build it
yourself.  Just make sure to get a few Cygwin patches from
https://github.com/cygwinports/python2

Best,
Erik

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-05-24 11:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-24  8:42 Python2 "narrow" build, Unicode issue in regex package Václav Haisman
2017-05-24 12:00 ` Erik Bray

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).