File tree Expand file tree Collapse file tree 2 files changed +3
-7
lines changed
Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -354,8 +354,6 @@ def test_return_non_contiguous_blob(self):
354354 cur = self .con .execute ("select return_noncont_blob()" )
355355 cur .fetchone ()
356356
357- # TODO: RUSTPYTHON
358- @unittest .expectedFailure
359357 def test_param_surrogates (self ):
360358 self .assertRaisesRegex (UnicodeEncodeError , "surrogates not allowed" ,
361359 self .con .execute , "select spam(?)" ,
Original file line number Diff line number Diff line change @@ -2965,12 +2965,10 @@ mod _sqlite {
29652965 }
29662966
29672967 fn str_to_ptr_len ( s : & PyStr , vm : & VirtualMachine ) -> PyResult < ( * const libc:: c_char , i32 ) > {
2968- let s = s
2969- . to_str ( )
2970- . ok_or_else ( || vm. new_unicode_encode_error ( "surrogates not allowed" ) ) ?;
2971- let len = c_int:: try_from ( s. len ( ) )
2968+ let s_str = s. try_to_str ( vm) ?;
2969+ let len = c_int:: try_from ( s_str. len ( ) )
29722970 . map_err ( |_| vm. new_overflow_error ( "TEXT longer than INT_MAX bytes" ) ) ?;
2973- let ptr = s . as_ptr ( ) . cast ( ) ;
2971+ let ptr = s_str . as_ptr ( ) . cast ( ) ;
29742972 Ok ( ( ptr, len) )
29752973 }
29762974
You can’t perform that action at this time.
0 commit comments