Can't launch python 3.2

Bug #716377 reported by paul clinch
56
This bug affects 11 people
Affects Status Importance Assigned to Milestone
DreamPie
Fix Released
Undecided
Unassigned

Bug Description

Couldn't start subprocess: Subprocess terminated with return code 1.
Subprocess wrote:
Traceback (most recent call last):
  File "C:\Program Files\DreamPie\share\dreampie\subp_main.py", line 30, in <module>
    sys.setdefaultencoding('utf-8')
AttributeError: 'module' object has no attribute 'setdefaultencoding'

Related branches

Revision history for this message
enmk (v-nemkov) wrote :

To fix the issue edit \dreampie\subp_main.py, replace:

sys.setdefaultencoding('utf-8')

with:

import platform
if not "3.2" in platform.python_version():
 sys.setdefaultencoding('utf-8')

Tested on WindowsXP SP3, both Python2.7 and Python3.2 can be used with this fix.

Revision history for this message
L N (ivxlcdm6) wrote :

How about

import sys
if sys.version_info.major < 3:
    sys.setdefaultencoding('utf-8')

sys.setdefaultencoding() will most likely break on all future versions of Python as well, not just 3.2:
http://bugs.python.org/issue9549%C2%A0%C2%A0closed

Revision history for this message
Вова Щербан \ Vova Svoka (shchvova) wrote :

Worked for me greatly:

try:
    getattr(sys, 'setdefaultencoding')('utf-8')
except AttributeError:
    sys.stderr.write("setdefaultencoding is not found");

Revision history for this message
Noam Yorav-Raphael (noamraph) wrote :

Thanks for your fix! I've changed it a bit, using L N 's comment, and checked it in.

Sorry for the delay in fixing this.

Changed in dreampie:
status: New → Fix Committed
Revision history for this message
Yong Choi (sk8er-choi) wrote :

L N's code works fine at 2.7 and 3.2, but does not at 2.5 and 2.6:

Couldn't start subprocess: Subprocess terminated with return code 1.
Subprocess wrote:
Traceback (most recent call last):

  File "C:\Program Files\DreamPie\share\dreampie\subp_main.py", line 30, in <module>

    if sys.version_info.major < 3:

AttributeError: 'tuple' object has no attribute 'major'

Revision history for this message
Noam Yorav-Raphael (noamraph) wrote : Re: [Bug 716377] Re: Can't launch python 3.2

I have changed it to use sys.version_info[0], which should work on python
2.5 and 2.6.

Can you check out the latest revision (from bzr) and see if it works?

Thanks,
Noam

On Thu, Jun 16, 2011 at 12:15 PM, Yong Choi <email address hidden>wrote:

> L N's code works fine at 2.7 and 3.2, but does not at 2.5 and 2.6:
>
> Couldn't start subprocess: Subprocess terminated with return code 1.
> Subprocess wrote:
> Traceback (most recent call last):
>
> File "C:\Program Files\DreamPie\share\dreampie\subp_main.py", line 30,
> in <module>
>
> if sys.version_info.major < 3:
>
> AttributeError: 'tuple' object has no attribute 'major'
>
> --
> You received this bug notification because you are subscribed to
> DreamPie.
> https://bugs.launchpad.net/bugs/716377
>
> Title:
> Can't launch python 3.2
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/dreampie/+bug/716377/+subscriptions
>

Revision history for this message
Ram Rachum (cool-rr) wrote :

It would be nice if there would be a release with this fix; Python 3.2 support is becoming more important.

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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