Fix SConf.Streamer to work with non-unicode input on Python 2.x

Bug #1524058 reported by Yury V. Zaytsev
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
scons (Ubuntu)
Fix Released
Medium
Unassigned
Trusty
Fix Released
Low
Unassigned

Bug Description

[Impact]

SConf is used in most SCons-based build systems, when building software using SCons configure checks that output anything to stdout / stderr fail.

[Test Case]

An example if provided in the upstream bug description:

    https://bitbucket.org/scons/scons/pull-requests/127/fixed-sconfstreamer-to-work-with-non/diff

Take the following script, save it as SConstruct and run scons:

    def hello(target, source, env):
      import traceback
      try:
        print 'hello!\n' # this breaks the script
        with open(env.subst('$TARGET', target = target),'w') as f:
          f.write('yes')
      except:
        # write to file, as stdout/stderr is broken
        traceback.print_exc(file=open('traceback','w'))
      return 0

    def CheckHello(context):
      import sys
      context.Display('Checking whether hello works... ')
      stat,out = context.TryAction(hello,'','.in')
      if stat and out:
        context.Result(out)
      else:
        context.Result('failed')
      return out

    env = Environment()
    cfg = Configure(env)

    cfg.AddTest('CheckHello', CheckHello)
    cfg.CheckHello()

    env = cfg.Finish()

If the package is broken, the check will fail:

    $ scons
    scons: Reading SConscript files ...
    Checking whether hello works... failed

With the fixed package the check will succeed:

    $ scons
    scons: Reading SConscript files ...
    Checking whether hello works... yes

[Regression Potential]

The patch was taken from the upstream bug tracker and is already in the version shipped with the latest Ubuntu.

Revision history for this message
Yury V. Zaytsev (zyv) wrote :

Please find the debdiff attached!

Revision history for this message
Yury V. Zaytsev (zyv) wrote :

Just to be clear, this is all about Ubuntu Trusty (14.04) LTS. For some reason, however, I'm not allowed to nominate this bug for any specific series, sorry about that.

Mathew Hodson (mhodson)
tags: added: patch trusty
Changed in scons (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Sebastien Bacher (seb128) wrote :
Changed in scons (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Sebastien Bacher (seb128) wrote :

thanks for the patch, I've sponsored to trusty as well now

Changed in scons (Ubuntu Trusty):
importance: Undecided → Low
status: New → Fix Committed
Revision history for this message
Yury V. Zaytsev (zyv) wrote :

Hi Sebastien,

Thank you, and sorry, I should have indeed noted explicitly that the patch has made it in 2.3.4. Is there any progress on the Trusty front? I haven't noticed any relevant uploads to -proposed or -updates so far...

All the best!

Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Hello Yury, or anyone else affected,

Accepted scons into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/scons/2.3.0-2ubuntu1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: added: verification-needed
Revision history for this message
Yury V. Zaytsev (zyv) wrote :

Hi Martin, thank you for your help!

I've enabled -proposed on my trusty machine, upgraded to the new version and then performed the test as described in this bug report. It worked for me now out of the box and I couldn't identify any problems with the new package... so, I think, it's good to go.

All the best!

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package scons - 2.3.0-2ubuntu1

---------------
scons (2.3.0-2ubuntu1) trusty; urgency=medium

  * Add debian/patches/sconf_streamer_non_unicode.patch (LP: #1524058)

 -- <email address hidden> (Yury V. Zaytsev) Tue, 08 Dec 2015 16:08:05 +0100

Changed in scons (Ubuntu Trusty):
status: Fix Committed → Fix Released
Revision history for this message
Chris J Arges (arges) wrote : Update Released

The verification of the Stable Release Update for scons has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

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.