Blend File Utils "SyntaxError: invalid syntax" when trying to Pack Blend to Archive #47976

Closed
opened 2016-03-28 03:54:55 +02:00 by Seth L. · 13 comments

System Information
OS X 10.6.8
NVIDIA GeForce 320M

Blender Version
Broken: 2.77 22a2853

Short description of error
I tested out the new Blend File Utils add-on today and ran into a syntax error when I tried to use the "Pack Blend to Archive" feature.

pack_blend_to_archive_syntax_error.png

The console shows this:

  File "/Applications/Blender 2.77/Blender 2.77.app/Contents/Resources/2.77/scripts/addons/io_blend_utils/blendfile_pack.py", line 272
    b".".join(f.rsplit(b".", 2)[0::2]): f for f_ in variations
                                            ^
SyntaxError: invalid syntax

Exact steps for others to reproduce the error

  1. Have open a scene with image textures (I am attaching the one I was using when I encountered the error.)
  2. Enable the Blend File Utils add-on.
  3. Choose File > External Data > Pack Blend to Archive

pack_to_archive_test.packed.blend

**System Information** OS X 10.6.8 NVIDIA GeForce 320M **Blender Version** Broken: 2.77 22a2853 **Short description of error** I tested out the new Blend File Utils add-on today and ran into a syntax error when I tried to use the "Pack Blend to Archive" feature. ![pack_blend_to_archive_syntax_error.png](https://archive.blender.org/developer/F298566/pack_blend_to_archive_syntax_error.png) The console shows this: ``` File "/Applications/Blender 2.77/Blender 2.77.app/Contents/Resources/2.77/scripts/addons/io_blend_utils/blendfile_pack.py", line 272 b".".join(f.rsplit(b".", 2)[0::2]): f for f_ in variations ^ SyntaxError: invalid syntax ``` **Exact steps for others to reproduce the error** 1. Have open a scene with image textures (I am attaching the one I was using when I encountered the error.) 2. Enable the Blend File Utils add-on. 3. Choose File > External Data > Pack Blend to Archive [pack_to_archive_test.packed.blend](https://archive.blender.org/developer/F298568/pack_to_archive_test.packed.blend)
Author

Changed status to: 'Open'

Changed status to: 'Open'
Campbell Barton was assigned by Seth L. 2016-03-28 03:54:55 +02:00
Author

Added subscriber: @quantumanomaly

Added subscriber: @quantumanomaly

I can't redo this bug, both in 2.77 release and in current master, using ArchLinux, (872f12f7a7).

Could someone else test this on OSX?

I can't redo this bug, both in 2.77 release and in current master, using ArchLinux, (872f12f7a7). Could someone else test this on OSX?

Added subscriber: @mont29

Added subscriber: @mont29

Cannot reproduce either here on linux… And even though this is a convoluted dict comprehension, I see nothing wrong with the syntax!

@quantumanomaly what is your reported python version (either in console at blender startup, or by typing:

import sys
sys.version

…in Blender's py console)?

Cannot reproduce either here on linux… And even though this is a convoluted dict comprehension, I see nothing wrong with the syntax! @quantumanomaly what is your reported python version (either in console at blender startup, or by typing: ``` import sys sys.version ``` …in Blender's py console)?

Added subscriber: @Sergey

Added subscriber: @Sergey

It is totally reproduceable on OSX. Here's system info for those who wonders: system-info.txt

Just don't use confusing syntax ;)

It is totally reproduceable on OSX. Here's system info for those who wonders: [system-info.txt](https://archive.blender.org/developer/F299355/system-info.txt) Just don't use confusing syntax ;)
Author

@Bastien Montagne, my Python version is 2.6.1 (I guess I should probably update). Btw, it didn't work typing sys.version, but typing python -V in Terminal worked.

@Bastien Montagne, my Python version is 2.6.1 (I guess I should probably update). Btw, it didn't work typing **sys.version**, but typing **python -V** in Terminal worked.
Author

Hey, wanted to let you know that after updating to Python 3.5.1 it's working just fine! Case closed. :-)

Hey, wanted to let you know that after updating to Python 3.5.1 it's working just fine! Case closed. :-)

Closed as duplicate of blender/blender#46623

Closed as duplicate of blender/blender#46623

This is caused by bpy.app.binary_path_python pointing to the wrong Python version.

This is caused by `bpy.app.binary_path_python` pointing to the wrong Python version.

Arg!!! no, not closed at all :P

I was asking to type those py commands in Blender's python console (one of its editors types), not in system terminal. ;)

Anyway, now I’m totally confused. 2.x python won’t work at all with Blender (simply won’t start), it absolutely needs 3.5. Thing is, this is supposed to be shipped with blender… And yet, @Sergey (which system-info.txt reports expected 3.5.1) can reproduce the bug, while you say installing external py 3.5.1 fixed it for you… Something is definitively wrong with OSX package/installation!

@Sergey: that comprehension is totally valid and clear, the “chained” double for loop makes it a bit hard to read at first, that’s all. And afaik, it’s in py3 since the beginning (and even in 2.7 from https://www.python.org/dev/peps/pep-0274/ ) - but not 2.6…

In fact, I think I have an idea: can you please report what typing bpy.app.binary_path_python in blender py console reports to you? I have a feeling you’ll get OSX system python, and not Blender's one… ;)

Arg!!! no, not closed at all :P I was asking to type those py commands in **Blender's python console** (one of its editors types), not in system terminal. ;) Anyway, now I’m totally confused. 2.x python won’t work at all with Blender (simply won’t start), it absolutely needs 3.5. Thing is, this is supposed to be shipped with blender… And yet, @Sergey (which system-info.txt reports expected 3.5.1) can reproduce the bug, while you say installing external py 3.5.1 fixed it for you… Something is definitively wrong with OSX package/installation! @Sergey: that comprehension is totally valid and clear, the “chained” double for loop makes it a bit hard to read at first, that’s all. And afaik, it’s in py3 since the beginning (and even in 2.7 from https://www.python.org/dev/peps/pep-0274/ ) - but not 2.6… In fact, I think I have an idea: can you please report what typing `bpy.app.binary_path_python` in blender py console reports to you? I have a feeling you’ll get OSX system python, and not Blender's one… ;)

meh, can ignore above comment now :P

meh, can ignore above comment now :P
Sign in to join this conversation.
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#47976
No description provided.