SIGWINCH may not exist, even on non-Win32 platforms
Bug #535015 reported by
Matt Nordhoff
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Fix Released
|
Low
|
Martin Packman |
Bug Description
bzrlib.
Specifically, a user in #bzr had issues because an old MacPorts build of Python 2.4.6 lacks SIGWINCH. Switching to OS X's 2.6.1 build fixed the problem.
It should be simple enough to just use getattr to check if it's available instead of checking the platform, unless signal does something bizarre?
Related branches
lp:~gz/bzr/winch_only_posix
- Vincent Ladeuil: Approve
- Martin Pool: Approve
- John A Meinel: Needs Fixing
-
Diff: 35 lines (+11/-13)1 file modifiedbzrlib/osutils.py (+11/-13)
description: | updated |
tags: | added: easy |
Changed in bzr: | |
milestone: | none → 2.2b3 |
To post a comment you must log in.
I've a branch with a fix for this, but the code has been moved more
than once since it landed so repeated conflicts have got in the way of
getting it landed.
The change started as the below, but any similar alteration to the
conditional should work:
=== modified file 'bzrlib/osutils.py' osutils. py 2009-12-17 22:16:59 +0000 osutils. py 2009-12-17 22:17:42 +0000
os.environ[ 'COLUMNS' ] = str(width)
--- old/bzrlib/
+++ new/bzrlib/
@@ -1477,11 +1477,7 @@
if width is not None:
-if sys.platform == 'win32': BUFFER_ SIZE_RECORD from ReadConsoleInput but signal( signal. SIGWINCH, _terminal_ size_changed)
- # Martin (gz) mentioned WINDOW_
- # I've no idea how to plug that in the current design -- vila 20091216
- pass
-else:
+if os.name == "posix" and getattr(signal, "SIGWINCH", None) is not None:
signal.