Skip to content

BUG: Parse NULL char as null value #14019

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

Closed
wants to merge 1 commit into from

Conversation

gfyoung
Copy link
Member

@gfyoung gfyoung commented Aug 17, 2016

Fixes bug in C parser in which the NULL character ('\x00') was being interpreted as a true line terminator, escape character, or comment character because it was used to indicate that a user had not specified these values. As a result, if the data contains this value, it was being incorrectly parsed. It should be parsed as NULL.

Closes #14012.

Fixes bug in C parser in which the NULL character
('\x00') was being interpreted as a true line terminator,
escape character, or comment character because it was used
to indicate that a user had not specified these values. As
a result, if the data contains this value, it was being
incorrectly parsed. It should be parsed as NULL.

Closes pandas-devgh-14012.
@gfyoung
Copy link
Member Author

gfyoung commented Aug 17, 2016

Points of clarification to make here:

  1. The reason why we still default lineterminator to '\0' instead of say '\n' is to allow for proper carriage character ('\r') detection, as can be seen here.

  2. The test I added will fail if it weren't any of the modified lineterminator, escapechar, or commentchar checks. They all used to compare against '\0' if none was specified, causing that stray '\x00' character to be incorrectly parsed in some way, shape, or form.

@codecov-io
Copy link

codecov-io commented Aug 17, 2016

Current coverage is 85.29% (diff: 100%)

Merging #14019 into master will not change coverage

@@             master     #14019   diff @@
==========================================
  Files           139        139          
  Lines         50241      50241          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits          42851      42851          
  Misses         7390       7390          
  Partials          0          0          

Powered by Codecov. Last update 5d791cc...5d39744

@jreback jreback added IO CSV read_csv, to_csv Bug labels Aug 17, 2016
@jreback jreback added this to the 0.19.0 milestone Aug 17, 2016
@jreback jreback closed this in cb43b6c Aug 17, 2016
@jreback
Copy link
Contributor

jreback commented Aug 17, 2016

thanks!

@gfyoung gfyoung deleted the null-char-parse branch August 17, 2016 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug IO CSV read_csv, to_csv
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants