Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 626118 - sys-apps/portage python scripts use 8 space indent
Summary: sys-apps/portage python scripts use 8 space indent
Status: RESOLVED INVALID
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-25 06:57 UTC by Jens Kasten
Modified: 2017-07-25 08:12 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jens Kasten 2017-07-25 06:57:52 UTC
emerge python scripts uses 8 spaces for indent.
This prevent any modification. 

For howto use it in a recommended way see:
https://www.python.org/dev/peps/pep-0008/#indentation


For example see: cat /usr/lib/python-exec/python3.4/emerge 

#!/usr/bin/python3.4 -b
# Copyright 2006-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

from __future__ import print_function

import platform
import signal
import sys

# This block ensures that ^C interrupts are handled quietly. We handle
# KeyboardInterrupt instead of installing a SIGINT handler, since
# exiting from signal handlers intermittently causes python to ignore
# the SystemExit exception with a message like this:
# Exception SystemExit: 130 in <function remove at 0x7fd2146c1320> ignored
try:

	def exithandler(signum, _frame):
		signal.signal(signal.SIGTERM, signal.SIG_IGN)
		sys.exit(128 + signum)

	signal.signal(signal.SIGTERM, exithandler)
	# Prevent "[Errno 32] Broken pipe" exceptions when
	# writing to a pipe.
	signal.signal(signal.SIGPIPE, signal.SIG_DFL)

	def debug_signal(_signum, _frame):
		import pdb
		pdb.set_trace()
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2017-07-25 07:15:18 UTC
You have a funny cat. The file you refer to uses tabs and not spaces for indentation.
Comment 2 Jens Kasten 2017-07-25 07:37:08 UTC
Its looks like i need a very clever tool to see that the width of eight are four but is not four because of eight.
Comment 3 Mike Gilbert gentoo-dev 2017-07-25 08:12:03 UTC
... huh?

I assume your editor converted some tabs to spaces when you saved the file, and that made python unhappy.