Bug 3449 - posix.py TIOCGWINSZ AttributeError on Irix (patch attached)
Summary: posix.py TIOCGWINSZ AttributeError on Irix (patch attached)
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: unspecified
Hardware: Other Other
: normal bug
Assignee: Mark Round
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-14 06:44 UTC by Mark Round
Modified: 2012-07-29 14:46 UTC (History)
3 users (show)

See Also:
Python Version: ---


Attachments
Patch to wrap call to termios.TIOCGWINSZ in a try/except block (841 bytes, patch)
2012-05-14 06:44 UTC, Mark Round
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Round 2012-05-14 06:44 UTC
Created attachment 1665 [details]
Patch to wrap call to termios.TIOCGWINSZ in a try/except block

On an Irix 6.5.24 system, TIOCGWINSZ is not available. This means that any usage of the "hg" tool that looks up the terminal size (e.g. "hg help") will fail with an AttributeError.

A simple work-around is just to wrap this block in mercurial/posix.py with a try/except (attached patch) so that it ends up using the default 80 characters width. 

There may be a better way to get this information from an Irix system instead of falling back to 80 characters, but I'm not aware of the best way to go about this. 

I appreciate Irix is not exactly a current platform, but aside from the TIOCGWINSZ issue, Mercurial works very well on it. The patch would probably also help other older/obscure Unix-like systems and seems to have a minimal impact on anything else.

Thanks,

-Mark
Comment 1 Matt Mackall 2012-05-14 07:37 UTC
Please see http://mercurial.selenic.com/wiki/ContributingChanges
Comment 2 Mark Round 2012-05-14 08:44 UTC
Thanks for the link. Patch has now been submitted to the -devel mailing list.
Comment 3 Matt Mackall 2012-07-29 14:46 UTC
Fixed in 2.2.3 by 7002bb17cc5e posix: workaround lack of TIOCGWINSZ on Irix