os.sync() isn't available, problem with HAVE_SYNC?

Bug #1131183 reported by Jason Gerard DeRose
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python3.3 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

os.sync() was added in Python 3.3, but for some reason it's not enabled in the current Ubuntu package.

I haven't tracked down the details yet, but my hunch is HAVE_SYNC isn't getting defined for whatever reason.

See Modules/posixmodule.c line 2907:

#ifdef HAVE_SYNC
PyDoc_STRVAR(posix_sync__doc__,
"sync()\n\n\
Force write of everything to disk.");

static PyObject *
posix_sync(PyObject *self, PyObject *noargs)
{
    Py_BEGIN_ALLOW_THREADS
    sync();
    Py_END_ALLOW_THREADS
    Py_RETURN_NONE;
}
#endif

ProblemType: Bug
DistroRelease: Ubuntu 13.04
Package: python3.3 3.3.0-11ubuntu1
ProcVersionSignature: Ubuntu 3.8.0-7.14-generic 3.8.0
Uname: Linux 3.8.0-7-generic x86_64
ApportVersion: 2.8-0ubuntu4
Architecture: amd64
Date: Thu Feb 21 05:10:25 2013
InstallationDate: Installed on 2012-08-06 (198 days ago)
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Release amd64 (20120425)
MarkForUpload: True
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: python3.3
UpgradeStatus: Upgraded to raring on 2013-02-01 (19 days ago)

Related branches

Revision history for this message
Jason Gerard DeRose (jderose) wrote :
Revision history for this message
Jason Gerard DeRose (jderose) wrote :

Hmm, there is this suspicious looking bit in debian/rules line 359:

 : # apply workaround for missing os.fsync
 sed 's/HAVE_SYNC/HAVE_FSYNC/g' $(1)/pyconfig.h \
  > $(1)/pyconfig.h.new
 touch -r $(1)/pyconfig.h $(1)/pyconfig.h.new
 mv -f $(1)/pyconfig.h.new $(1)/pyconfig.h

Revision history for this message
Jason Gerard DeRose (jderose) wrote :

That above bit in debian/rules seems unneeded, and was probably not the correct fix to whatever issue there was with os.fsync() not being defined.

Before the sed bit, there is:

#define HAVE_FSYNC 1
#define HAVE_SYNC 1

And after you end up with HAVE_FSYNC being defined twice:

#define HAVE_FSYNC 1
#define HAVE_FSYNC 1

Martin Pitt (pitti)
Changed in python3.3 (Ubuntu):
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python3.3 - 3.3.0-11ubuntu2

---------------
python3.3 (3.3.0-11ubuntu2) raring; urgency=low

  * Remove unneeded s/HAVE_SYNC/HAVE_FSYNC/g that broke os.sync().
    LP: #1131183
 -- Jason Gerard DeRose <email address hidden> Thu, 21 Feb 2013 05:53:27 -0700

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

Other bug subscribers

Remote bug watches

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