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):
354
354
cur = self .con .execute ("select return_noncont_blob()" )
355
355
cur .fetchone ()
356
356
357
- # TODO: RUSTPYTHON
358
- @unittest .expectedFailure
359
357
def test_param_surrogates (self ):
360
358
self .assertRaisesRegex (UnicodeEncodeError , "surrogates not allowed" ,
361
359
self .con .execute , "select spam(?)" ,
Original file line number Diff line number Diff line change @@ -2965,12 +2965,10 @@ mod _sqlite {
2965
2965
}
2966
2966
2967
2967
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 ( ) )
2972
2970
. 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 ( ) ;
2974
2972
Ok ( ( ptr, len) )
2975
2973
}
2976
2974
You can’t perform that action at this time.
0 commit comments