Ubuntu

Use IEC standard for binary byte units

Reported by Benjamin Drung on 2009-04-29
74
This bug affects 11 people
Affects Status Importance Assigned to Milestone
GLib
Fix Released
Medium
Nautilus
Won't Fix
Wishlist
glib2.0 (Ubuntu)
Medium
Unassigned
Lucid
Medium
Martin Pitt
nautilus (Ubuntu)
Low
Ubuntu Desktop Bugs
Lucid
Low
Unassigned

Bug Description

This package displays or refers to quantities using power-of-two units (e.g. 1024, 1048576, etc.) but incorrectly applies prefixes that are defined as power-of-ten units (e.g. the prefix 'k' is 1000, 'M' is 1000000, etc.).

According to the Brainstorm idea #17839 most people are for using IEC standard for binary byte units.

For details have a look at the Ubuntu Desktop Unit Consistency blueprint: https://blueprints.launchpad.net/ubuntu/+spec/desktop-unit-consistency/

Benjamin Drung (bdrung) wrote :
Changed in glib:
status: Unknown → New
Benjamin Drung (bdrung) wrote :

glib2.0 (2.20.1-0ubuntu3) karmic; urgency=low

  * debian/patches/05_iec_standard.patch: Use IEC standard for binary byte
    units (LP: #369525).

 -- Benjamin Drung <email address hidden> Wed, 29 Apr 2009 23:11:42 +0200

Sebastien Bacher (seb128) wrote :

thank you for your bug report, as you can see on the upstream bug that's not something obviously right and we will not apply it in an ubuntu specific way, there has been similar discussion on ubuntu lists

Changed in glib2.0 (Ubuntu):
assignee: nobody → Ubuntu Desktop Bugs (desktop-bugs)
importance: Undecided → Wishlist
status: New → Triaged
Benjamin Drung (bdrung) wrote :

There is a second bug report about it: http://bugzilla.gnome.org/show_bug.cgi?id=309850

It is a bug if an application uses base 10 prefixes when it calculates with base 2. So this is only a bug fix for using the wrong prefixes.

There is currently a discussion on ubuntu-devel-discuss. The users want this bug fix: http://brainstorm.ubuntu.com/idea/17839/

Endolith (endolith) wrote :

File sizes should be SI units, not IEC units. Disks are measured in SI units for a reason. The disk size and file size in GLib (Nautilus especially) should be SI units, too. Even Apple does this now. http://support.apple.com/kb/TS2419

1,000 byte file = "1.0 kB"
1,000,000 byte file = "1.0 MB"

IEC units are for things like memory that naturally come in multiples of a power of two, to make calculations simpler.

1,024 x 1,024 byte of memory = "1.0 MiB"

Benjamin Drung (bdrung) wrote :
Benjamin Drung (bdrung) wrote :

Here is an updated debdiff. It follows the upcoming policy: https://wiki.ubuntu.com/UnitsPolicy

glib2.0 (2.23.0-1ubuntu4) lucid; urgency=low

  * Add debian/patches/80_unit.patch to use SI prefixes for base-10 units
    (LP: #369525).

 -- Benjamin Drung <email address hidden> Sat, 19 Dec 2009 17:34:52 +0100

Martin Pitt (pitti) wrote :

The policy has been approved by the Technical Board now, so I'll make sure it'll land in lucid soon.

Bumping priority since it's a bug now (due to violating the newly instantiated policy).

Changed in glib2.0 (Ubuntu Lucid):
assignee: Ubuntu Desktop Bugs (desktop-bugs) → Martin Pitt (pitti)
importance: Wishlist → Medium
milestone: none → ubuntu-10.04-beta-1
status: Triaged → In Progress
Martin Pitt (pitti) wrote :

Note to self: fix the remaining "KB" in the documentation comment as well.

Benjamin Drung (bdrung) wrote :

Here is the update debdiff with all KB fixed to kB.

Martin Pitt (pitti) wrote :

I sent a git-formatted patch against trunk upstream, and updated the test cases to match. I'll apply that updated patch instead (and against 2.23.5). Thanks Benjamin!

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package glib2.0 - 2.23.5-1ubuntu2

---------------
glib2.0 (2.23.5-1ubuntu2) lucid; urgency=low

  [ Benjamin Drung ]
  * Add 05_file_size_units.patch: Use SI prefixes for base-10 units. Refer
    to https://wiki.ubuntu.com/UnitsPolicy for more details (LP: #369525).

  [ Martin Pitt ]
  * 05_file_size_units.patch: Fix test cases to match, and replace with git
    formatted patch sent upstream.
 -- Benjamin Drung <email address hidden> Tue, 09 Mar 2010 17:24:26 +0100

Changed in glib2.0 (Ubuntu Lucid):
status: In Progress → Fix Released
Benjamin Drung (bdrung) on 2010-03-10
tags: added: unit-policy
tags: added: units-policy
removed: unit-policy
Charles Kerr (charlesk) on 2010-03-14
Changed in glib2.0 (Ubuntu Lucid):
status: Fix Released → New
Charles Kerr (charlesk) wrote :

This change causes glib to display units differently based on whether an application is running on Ubuntu or on another platform. If a client application wants to integrate smoothly with its environment, it needs to take this into account in its other fields as well, such as preferences dialogs that let users specify a disk cache size or bandwidth speed limit.

I've described some of these at https://bugs.launchpad.net/ubuntu/+source/glib2.0/+bug/538783 and outlined the constraints of patching Transmission here: https://bugs.launchpad.net/ubuntu/+source/transmission/+bug/538504/comments/18

Ideally, this change should be made upstream, so that applications don't have to jump through hoops based on the distro. If upstream and Ubuntu continue to disagree on whether to open boiled eggs from the big or little end, then at least provide a glib mechanism to let application developers know the rules of the road.

Either way, shoving this through during an LTS freeze does more harm than good. This has been a divisive topic for literally years; waiting for 10.10 is not going to hurt anything.

Please revert this change for 10.04.

Benjamin Drung (bdrung) wrote :

Attached an argument (screenshot of karmic) to not revert the patch.

Martin Pitt (pitti) wrote :

glib does use IEC standards now, so closing again. charles' problem is discussed in bug 538783.

Changed in glib2.0 (Ubuntu Lucid):
status: New → Fix Released
Martin Pitt (pitti) wrote :

Bug 538783 is one issue where this caused trouble, and the patch is heavily debated upstream.

Lucid after beta-1 is not the time for us to spend endless hours on debates like this, so I backed out this patch in glib.

I propose that we just fix nautilus instead. It seems generally safer to not use g_format_size_for_display() at all any more because it's terminally broken (which is what gvfs/system-monitor/palimpsest etc. are doing for that very reason).

Changed in glib2.0 (Ubuntu Lucid):
milestone: ubuntu-10.04-beta-1 → none
status: Fix Released → Won't Fix
Changed in glib2.0 (Ubuntu):
status: Fix Released → Triaged
assignee: Martin Pitt (pitti) → nobody
Martin Pitt (pitti) on 2010-03-15
Changed in nautilus (Ubuntu Lucid):
status: New → Triaged
assignee: nobody → Martin Pitt (pitti)
importance: Undecided → Low
milestone: none → ubuntu-10.04-beta-2
Benjamin Drung (bdrung) wrote :

Here is the updated 05_file_size_units.patch for g_format_size_for_display() to use IEC prefixes.

Martin Pitt (pitti) wrote :

Not a release blocker for lucid.

Changed in nautilus (Ubuntu Lucid):
milestone: ubuntu-10.04-beta-2 → none
status: Triaged → Won't Fix
assignee: Martin Pitt (pitti) → nobody
Lorenzo De Liso (blackz) on 2010-03-28
tags: added: patch
Martin Pitt (pitti) on 2010-04-22
Changed in nautilus (Ubuntu):
assignee: Martin Pitt (pitti) → Ubuntu Desktop Bugs (desktop-bugs)
Nigel Babu (nigelbabu) wrote :

Adding patch-forwarded-upstream since the patch is awaiting review there

tags: added: patch-forwarded-upstream
removed: patch
Changed in glib:
importance: Unknown → Medium
Changed in nautilus:
importance: Unknown → Wishlist
status: Unknown → Won't Fix
Changed in glib:
status: New → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package glib2.0 - 2.29.14-0ubuntu1

---------------
glib2.0 (2.29.14-0ubuntu1) oneiric; urgency=low

  * New upstream version:
    * GSettings: don't call g_error() when the schema is missing
    * Use S.I units (lp: #369525)
  * Drop patches included in the new version
  * debian/libglib2.0-0.symbols:
    - updated for the new version
  * 0001-Revert-all-eventfd-related-patches.patch:
    - renamed, don't revert the commits but rather force the eventfd support
      to false in the configure
 -- Sebastien Bacher <email address hidden> Thu, 21 Jul 2011 11:24:19 +0200

Changed in glib2.0 (Ubuntu):
status: Triaged → Fix Released
Sebastien Bacher (seb128) wrote :

The issue is fixed in Oneiric

Changed in nautilus (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Related blueprints

Remote bug watches

Bug watches keep track of this bug in other bug trackers.