Skip to content

BUG: Do not force re.UNICODE if re.ASCII flag is passed#66350

Open
ajayraj30002 wants to merge 1 commit into
pandas-dev:mainfrom
ajayraj30002:patch-4
Open

BUG: Do not force re.UNICODE if re.ASCII flag is passed#66350
ajayraj30002 wants to merge 1 commit into
pandas-dev:mainfrom
ajayraj30002:patch-4

Conversation

@ajayraj30002

Copy link
Copy Markdown

Summary of Changes

This PR prevents pandas from blindly applying the re.U flag in pandas/core/strings/accessor.py if the user explicitly passes the re.ASCII flag.

By wrapping the default Unicode assignment in a bitwise check (if not (flags & re.ASCII):), this resolves the fatal ValueError: ASCII and UNICODE flags are incompatible crash when passing flags=re.ASCII to string accessor methods like .str.match().

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.

BUG: ASCII mode is broken for str.match

1 participant