+
    xȇi;/                        a  R t0 t R t^ RIHtHt ^ RIt^ RIt^ RIH	u H
t ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHtHt ^ RIHt R]! 4       R	]! 4       /t] ^ k  ! R
 R4      tR tR# )z\
Tests the TextReader class in parsers.pyx, which
is integral to the C engine in parsers.py
)BytesIOStringION)
TextReader)ParserWarning)	DataFrame)TextFileReaderread_csv)ensure_dtype_objs	na_values
na_fvaluesc                     a  ] tR t^"t o ]P
                  R 4       tR tR tR t	R t
R tR tR tR	 tR
 tR tR tR tR tR tR tR tR tR tR tR t]P6                  P9                  RRRR/3RRR/3RRR/3RRR/3RRR/3R RR/3.4      R! 4       tR" t]P6                  P9                  R#]! ^
4      4      R$ 4       t R% t!R&t"V t#R'# )(TestTextReaderc                    V! R RRR4      # )iodatacsvz	test1.csv )selfdatapaths   &&v/Users/max/.openclaw/workspace/postharvest/venv/lib/python3.14/site-packages/pandas/tests/io/parser/test_textreader.pycsv_pathTestTextReader.csv_path#   s    fe[99    c                    \        VR 4      ;_uu_ 4       p\        V3/ \        B pVP                  4        RRR4       R#   + '       g   i     R# ; i)rbNopenr   _na_value_kwargsreadr   r   freaders   &&  r   test_file_handleTestTextReader.test_file_handle'   s9    (D!!Q6%56FKKM "!!!s   !A  A	c                    \        VR 4      ;_uu_ 4       p\        V3RR/\        B pVP                  4        RRR4       R#   + '       g   i     R# ; i)r   headerNr   r   s   &&  r   test_file_handle_mmap$TestTextReader.test_file_handle_mmap,   s>    (D!!QC$C2BCFKKM "!!!s   #AA	c                    \        VR 4      ;_uu_ 4       pVP                  4       pRRR4       \        X4      p\        V3RR/\        B pVP                  4        R#   + '       g   i     L?; i)r   Nr%   )r   r   r   r   r   )r   r   r    textsrcr!   s   &&    r   test_StringIOTestTextReader.test_StringIO2   sQ    (D!!Q668D "dmCAA0@A	 "!s   AA-	c           	        \        VR R7      ;_uu_ 4       pRp\        P                  ! \        VR7      ;_uu_ 4        \	        VRR7       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)zUTF-8)encodingz%latin1 is different from the encodingmatchlatin1N)r   pytestraises
ValueErrorr   )r   r   r    msgs   &&  r   test_encoding_mismatch_warning-TestTextReader.test_encoding_mismatch_warning9   sQ    (W--9Cz55X. 6 .-55 .--s"   'A0A	A0A-(A00B	c           	         R p\        \        V4      3RR/\        B pVP                  4       p\	        \        \        \        V^ ,          4      4      4      ^8X  g   Q hR# )z	a
b
a
b
ar%   N)r   r   r   r   lensetmapidr   r   r!   results   &   r   test_string_factorize$TestTextReader.test_string_factorize@   sN    HTNL4L;KL3s2vay)*+q000r   c                t   R p\        \        V4      3RRRR/\        B pVP                  4       p\        P
                  ! V^ ,          \        P                  ! . RO\        P                  R7      4       \        P
                  ! V^,          \        P                  ! . RO\        P                  R7      4       R# )za,   b
a,   b
a,   b
a,   bskipinitialspaceTr%   Ndtype)arE   rE   rE   )brF   rF   rF   	r   r   r   r   tmassert_numpy_array_equalnparrayobject_r=   s   &   r   test_skipinitialspace$TestTextReader.test_skipinitialspaceG   s    /TN
-1
:>
BR
 
##1Irxx 4BJJG	
 	##1Irxx 4BJJG	
r   c                    R p\        \        V4      3RR/\        B pVP                  4       pV^ ,          P                  \
        P                  8X  g   Q hR# )zTrue
False
True
Truer%   N)r   r   r   r   rD   rJ   bool_r=   s   &   r   test_parse_booleans"TestTextReader.test_parse_booleansV   sE    (HTNL4L;KLay"((***r   c                t   R p\        \        V4      3RRRR/\        B pVP                  4       p\        P
                  ! V^ ,          \        P                  ! . RO\        P                  R7      4       \        P
                  ! V^,          \        P                  ! . RO\        P                  R7      4       R# )za  b
a		 "b"
"a"	 	 bdelim_whitespaceTr%   NrC   )rE   rE   rE   )rF   rF   rF   rG   r=   s   &   r   test_delimit_whitespace&TestTextReader.test_delimit_whitespace^   s    ,TN
-1
:>
BR
 
##1IrxxrzzB	
 	##1IrxxrzzB	
r   c                    R p\        \        V4      3RR/\        B pVP                  4       p\        P
                  ! . RO\        P                  R7      p\        P                  ! V^ ,          V4       R# )za
"hello
there"
thisr%   NrC   )rE   zhello
therethis)	r   r   r   r   rJ   rK   rL   rH   rI   r   r   r!   r>   expecteds   &    r   test_embedded_newline$TestTextReader.test_embedded_newlinem   sT    (HTNL4L;KL889L
##F1Ix8r   c           	         R p\        \        V4      3RRRRRR/\        B pVP                  4       p\        P
                  ! RR.4      p\        P                  ! V^ ,          V4       R# )	z12345,67
345,678	delimiter:decimal,r%   Ng)\@g+ٚu@)r   r   r   r   rJ   rK   rH   assert_almost_equalrY   s   &    r   test_euro_decimal TestTextReader.test_euro_decimalv   sl    "TN
&)
36
?C
GW
 88Xw/0
vay(3r   c           	         R p\        \        V4      3RRRRRR/\        B pVP                  4       p\        P
                  ! RR.\        P                  R	7      p\        P                  ! V^ ,          V4       R# )
z123,456
12,500r^   r_   	thousandsra   r%   N@ 0  rC   )	r   r   r   r   rJ   rK   int64rH   rb   rY   s   &    r   test_integer_thousands%TestTextReader.test_integer_thousands   sw     TN

 
 	

 
 88VUO288<
vay(3r   c                    R p\        \        V4      RRRR7      pVP                  4       p\        RR.4      p\        P
                  ! W44       R# )z123.456
12.500r_   .N)r^   rf   r%   rg   rh   )r   r   r   r   rH   assert_frame_equalrY   s   &    r   test_integer_thousands_alt)TestTextReader.test_integer_thousands_alt   sG     TNcS
 fe_-
f/r   c                
   R p\        \        V4      3RRRR/\        B pRp\        P                  ! \
        P                  VR7      ;_uu_ 4        VP                  4        RRR4       \        \        V4      3RRRRR^/\        B pVP                  4       p^ \        P                  ! . R
O\        R7      ^\        P                  ! . RO\        R7      ^\        P                  ! . RO\        R7      /p\        WE4       \        P                  ! \        R	R7      ;_uu_ 4        \        \        V4      3RRRRR^/\        B pVP                  4        RRR4       R#   + '       g   i     EL; i  + '       g   i     R# ; i)z'a:b:c
d:e:f
g:h:i
j:k:l:m
l:m:n
o:p:q:rr^   r_   r%   NzCError tokenizing data\. C error: Expected 3 fields in line 4, saw 4r/   on_bad_linesrC   zSkipping line)rE   dgl)rF   ehm)cr    in)r   r   r   r2   r3   parserParserErrorr   rJ   rK   objectassert_array_dicts_equalrH   assert_produces_warningr   )r   r   r!   r5   r>   rZ   s   &     r   test_skip_bad_lines"TestTextReader.test_skip_bad_lines   s^   =TN
&)
26
:J
 U]]6--S99KKM : TN

 
 	

 
 rxx,F;rxx,F;rxx,F;

 	!2''_MM  	
 #F KKM NM% :99$ NMMs   E#0E1E.	1F	c           
        R p\        \        V4      3RRR^/\        B pVP                  p. RO.pW48X  g   Q hVP	                  4       p^ \
        P                  ! ^^.\
        P                  R7      ^\
        P                  ! ^^.\
        P                  R7      ^\
        P                  ! ^^.\
        P                  R7      /p\        WT4       R# )z%skip this
skip this
a,b,c
1,2,3
4,5,6r^   ra   r%   rC   NrE   rF   ry   )	r   r   r   r%   r   rJ   rK   ri   r   )r   r   r!   r%   rZ   recss   &     r   test_header_not_enough_lines+TestTextReader.test_header_not_enough_lines   s    :HTNXcX!XGWX#$!!!{{}rxxAbhh/rxxAbhh/rxxAbhh/

 	!0r   c           	         R p\        \        V4      3RRRRRR/\        B pVP                  4       p^ \        P
                  ! R.^,          \        R7      /p\        W44       R# )	z,\"hello world"
\"hello world"
\"hello world"r^   ra   r%   N
escapechar\z"hello world"rC   )r   r   r   r   rJ   rK   r~   r   rY   s   &    r   test_escapecharTestTextReader.test_escapechar   sp    BTN

 
 	

 
 rxx 1A 5VDE 2r   c                    R # Nr   r   s   &r   test_eof_has_eolTestTextReader.test_eof_has_eol   s    r   c                    R # r   r   r   s   &r   test_na_substitution#TestTextReader.test_na_substitution   s    r   c                <  a R oV3R lpV! RR7      pVP                  4       pV^ ,          P                  R8X  g   Q h\        P                  ! . RORR7      pV^ ,          V8H  P	                  4       '       g   Q hV^,          P                  R8X  g   Q hV! RR7      pVP                  4       pV^ ,          P                  R8X  g   Q h\        P                  ! . R	ORR7      pV^ ,          V8H  P	                  4       '       g   Q hV^,          P                  R8X  g   Q hR# )
za,1
aa,2
aaa,3
aaaa,4
aaaaa,5c                  z   < R V 9   d   \        V R ,          4      V R &   \        \        S4      3RRRR/V B\        B # )rD   r^   ra   r%   Nr	   r   r   r   kwdsr   s   ,r   _make_reader<TestTextReader.test_numpy_string_dtype.<locals>._make_reader   sP    $ 1$w- @W*-6:>BFV r   zS5,i4rC   S5i4S4N)rE   aaaaaaaaaaaaaa)rE   r   r   r   r   )r   rD   rJ   rK   all)r   r   r!   r>   	ex_valuesr   s   &    @r   test_numpy_string_dtype&TestTextReader.test_numpy_string_dtype   s    	 G,ay$&&&HH@M	q	Y&++----ay$&&&D)ay$&&&HH?tL	q	Y&++----ay$&&&r   c                r  a R oV3R lpV! RR^R/R7      pVP                  4       pV^ ,          P                  R8X  g   Q hV^,          P                  R8X  g   Q hV! R\        P                  ^\        /R7      pVP                  4       pV^ ,          P                  R8X  g   Q hV^,          P                  R8X  g   Q hV! R\        P                  ! R4      ^\        P                  ! R4      /R7      pVP                  4       pV^ ,          P                  R8X  g   Q hV^,          P                  R8X  g   Q hR# )zone,two
1,a
2,b
3,c
4,dc                  v   < R V 9   d   \        V R ,          4      V R &   \        \        S4      3RR/V B\        B # )rD   r^   ra   r   r   s   ,r   r   4TestTextReader.test_pass_dtype.<locals>._make_reader  s;    $ 1$w- @WhtnXXtXGWXXr   oneu1S1rC   ON)r   rD   rJ   uint8r~   )r   r   r!   r>   r   s   &   @r   test_pass_dtypeTestTextReader.test_pass_dtype  s   	Y
 UD!T$:;ay$&&&ay$&&&UBHHa$@Aay$&&&ay#%%%UBHHTNArxx}$MNay$&&&ay#%%%r   c                <  a R oV3R lpV! RR7      pVP                  4       pV! 4       P                  4       p\        V4      ^8X  g   Q hV^,          V^,          8H  P                  4       '       g   Q hV^,          V^,          8H  P                  4       '       g   Q hR# )z a,b,c
1,2,3
4,5,6
7,8,9
10,11,12c                  >   < \        \        S4      3R R/V B\        B # )r^   ra   )r   r   r   r   s   ,r   r   1TestTextReader.test_usecols.<locals>._make_reader'  s"    htnXXtXGWXXr   )usecolsN)      )r   r9   r   )r   r   r!   r>   expr   s   &    @r   test_usecolsTestTextReader.test_usecols  s    	Y f-n!!#6{aq	SV#((****q	SV#((****r   ztext, kwargsz a,b,c1,2,34,5,67,8,910,11,12r^   ra   z*a  b  c1  2  34  5  67  8  910  11  12rT   Tz a,b,c1,2,34,5,6,88,910,11,12zdA,B,C,D,E,F,G,H,I,J,K,L,M,N,OAAAAA,BBBBB,0,0,0,0,0,0,0,0,0,0,0,0,0,BBBBB,0,0,0,0,0,0,0,0,0,0,0,0,0zA  B  C  2  34  5  6zA B C2 34 5 6c                    VP                  R R4      p\        \        V4      3/ VB\        B P	                  4       p\        \        V4      3/ VB\        B P	                  4       p\        WE4       R# )z
N)replacer   r   r   r   r   )r   r)   kwargs	nice_textr>   rZ   s   &&&   r   test_cr_delimited TestTextReader.test_cr_delimited2  sa    , LLv.	HTNIfI8HINNPhy1PVP?OPUUW 2r   c           
     >   R p\        \        V4      3RR/\        B P                  4       p^ \        P
                  ! ^^.\        P                  R7      ^\        P
                  ! RR.\        R7      ^\        P
                  ! RR.\        R7      /p\        W#4       R# )za,b,c
1,2,3
4,,r^   ra   rC   2 3N)	r   r   r   r   rJ   rK   ri   r~   r   )r   r   r>   rZ   s   &   r   test_empty_field_eof#TestTextReader.test_empty_field_eofM  s|    "HTNNcN=MNSSU rxxAbhh/rxxb	0rxxb	0

 	!2r   repeatc           	        \        R .\        P                  ..R.RR.R7      p\        . R
O. R
O.\        R4      ^^.R7      p\        . RO^\        P                  \        P                  \        P                  .. RO^^\        P                  \        P                  ..\        R4      . ROR7      p\	        \        R4      ^ R.RR7      p\        P                  ! WR4       \	        \        R4      \        R4      RR7      p\        P                  ! WS4       \	        \        R4      \        R4      RR7      p\        P                  ! WT4       R	# )rF   rE   ry   )columnsindexabcdza,b
c
)skiprowsnamesengine)r   r   z"0,1,2,3,4
5,6
7,8,9,10,11
12,13,14N)r   r   r       )r   r         )   	   
      )r            z1,1,1,1,0
1,1,1,1,0


)r   rJ   nanlistr   r   rH   rn   )r   r   rE   rF   ry   dfs   &&    r   #test_empty_field_eof_mem_access_bug2TestTextReader.test_empty_field_eof_mem_access_bugY  s    urvvh'#sCjI|\2DLQRTUPVWBFFBFFBFF+R(	 L	
 hz*QseCP
b$12$v,s
 	b$<=v,

 	b$r   c                    \        \        4       ^R. ROR7      ;_uu_ 4       p\        V\        4      '       g   Q h RRR4       R#   + '       g   i     R# ; i)   N)	chunksizer%   r   r   )r   r   
isinstancer   )r   r   s   & r   test_empty_csv_input#TestTextReader.test_empty_csv_inputx  sE    J"T
 
b.1111
 
 
 
s   AA	r   N)$__name__
__module____qualname____firstlineno__r2   fixturer   r"   r&   r+   r6   r?   rM   rQ   rU   r[   rc   rj   ro   r   r   r   r   r   r   r   r   markparametrizer   r   ranger   r   __static_attributes____classdictcell__)__classdict__s   @r   r   r   "   sA    ^^: :
/1
+
9	44	0"H1 3'>&8+& [[3k35GH@#T* 4k35GH7 c" (*<d)CD #5t"<=!	
*3+*3
3 [[XuRy1% 2%<2 2r   r   c                     V P                  4        FJ  w  r#\        P                  ! \        P                  ! V4      \        P                  ! W,          4      4       KL  	  R # r   )itemsrH   rI   rJ   asarray)leftrightkvs   &&  r   r   r     s7    


##BJJqM2::eh3GH r   c                b    V ^8  d   Qh/ ^ \         9   d   \        \        \        3,          ;R&   # )r   r   )__conditional_annotations__dictstrr:   )formats   "r   __annotate__r      s'      < M L$sCx. L=r   )r   __doc__r   r   r   numpyrJ   r2   pandas._libs.parsers_libsparsersr|   r   pandas.errorsr   pandasr   pandas._testing_testingrH   pandas.io.parsersr   r   "pandas.io.parsers.c_parser_wrapperr	   r:   r   r   r   r   )r   s   @r   <module>r     s`   

   % % + '   A %0ce#L  L[2 [2|
Ir   