pearu opened a new issue, #54641:
URL: https://github.com/apache/arrow/issues/54641

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   On Windows, timestamp parsing with a `strptime` format fails when the format 
contains `%a`, `%A`, `%b`, `%B`, `%h`, `%c`, `%p`, `%r`, `%x` or `%X`:
   
   ```python
   import pyarrow as pa
   import pyarrow.compute as pc
   
   for value, fmt in [
       ("15-Feb-2015", "%d-%b-%Y"),
       ("15 February 2015", "%d %B %Y"),
       ("Sun 15 Feb 2015", "%a %d %b %Y"),
       ("02/15/2015 02:30 PM", "%m/%d/%Y %I:%M %p"),
   ]:
       try:
           print(pc.strptime(pa.array([value]), format=fmt, unit="s")[0])
       except pa.ArrowInvalid as e:
           print(e)
   ```
   
   Output on Windows (pyarrow 27.0.0.dev18):
   
   ```
   Failed to parse string: '15-Feb-2015' as a scalar of type timestamp[s]
   Failed to parse string: '15 February 2015' as a scalar of type timestamp[s]
   Failed to parse string: 'Sun 15 Feb 2015' as a scalar of type timestamp[s]
   Failed to parse string: '02/15/2015 02:30 PM' as a scalar of type 
timestamp[s]
   ```
   
   Expected, as on Linux and macOS:
   
   ```
   2015-02-15 00:00:00
   2015-02-15 00:00:00
   2015-02-15 00:00:00
   2015-02-15 14:30:00
   ```
   
   On Windows, Arrow uses the vendored musl `strptime` 
(`cpp/src/arrow/vendored/musl/strptime.c`), which defines `HAVE_LANGINFO` only 
when `_WIN32` is not defined, and handles these directives only under `#ifdef 
HAVE_LANGINFO`.
   
   Found while working on #50146.
   
   ### Component(s)
   
   C++
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to