New submission from Uwe Kleine-König:

When passing a big integer value to fcntl.ioctl this might result in

     OverflowError: signed integer is greater than maximum

. Traditionally ioctl(3) takes a pointer as third argument. The fcntl module 
however uses an int (format specifier 'i') which is too small to hold a pointer 
on 64 bit architectures.

The fix is to use 'k' (and an unsigned long) instead of 'i' (and an int). An 
unsigned long is suitable to hold a pointer value on AFAIK all platforms that 
matter today. (And it works on all platforms where int is already good enough, 
so the suggested change doesn't do any harm.)

A patch is attached.

----------
files: unsigned-long-arg-for-ioctl.patch
keywords: patch
messages: 296008
nosy: ukl
priority: normal
severity: normal
status: open
title: pass big values for arg to fcntl.ioctl
type: behavior
versions: Python 3.5
Added file: http://bugs.python.org/file46951/unsigned-long-arg-for-ioctl.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30665>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to