anon-iclr-submission/benchname-bug-localization huggingface dataset:
Repository: rigetti/pyquil
Issue: pyquil-config-setup script does not work

The python 3 compatibility code in pyquil/setup/config.py seems to be wonky.  The try/except block can't be inside a function body for that to work. A better alternative: delete the try/except check and add ...

import six
input = six.moves.input


Changed files:
pyquil/setup/config.py

diff --git a/pyquil/setup/config.py b/pyquil/setup/config.py
index 6642b40..19d20b4 100644
--- a/pyquil/setup/config.py
+++ b/pyquil/setup/config.py
@@ -17,16 +17,14 @@
 
 from os.path import expanduser
 
+import six
+input = six.moves.input
+
+
 def main():
     print("Welcome to the pyquil config setup!")
     print("Enter the required information below for Forest connections.")
 
-    # Input for python2 and python3
-    try:
-       input = raw_input
-    except NameError:
-       pass
-
     endpoint = input("Forest URL (https://api.rigetti.com/qvm): ")
     if len(endpoint) == 0:
         endpoint = "https://api.rigetti.com/qvm"
Repository: khronosgroup/gltf-blender-io
Issue: Blend files from 3.3 open in 3.6 and export - do not show existing gltf+bin files of format types

**Describe the bug**
File format of type gltf+bin do not show in the export Blender File View dialog unless you trigger a change in the file format dialog, that is already gltf+bin format.  Blender files stored in Blender 3.3 do not show existing gltf files in dialog in blender 3.6 gltf exporter.

**To Reproduce**
Steps to reproduce the behavior:
1. Open Blender 3.3
2. Create a blend file of the cube.  
3. Select to cube and do a file export gltf of the cube.  
4. Select format type glt+bin+textures. Select remember export settings
5. close 3.3
6. open blender 3.6
7. open blend file saved from blender 3.3
8. file export gltf (note format type is gltf+bin)
9. note - no file name with extension gltf
10. trigger change in format by reselecting Format gltf+bin
11. Note existing gltf files dispaly in Blender File View Dialog


**Expected behavior**
gltf files show on intial file export

**Screenshots**
If applicable, add screenshots to help explain your problem.
Blender 3.6 export Blend View File dialog before and after format drop down reselect.  The gltf file shown would be the result of the Blender 3.3 export
![DA40CGDFQ_2023 05 18_14h20m37s](https://github.com/KhronosGroup/glTF-Blender-IO/assets/19254353/7fd50b80-f98c-45ec-93c0-8fb5a3c1aa38)
![DA40CGDFQ_2023 05 18_14h20m54s](https://github.com/KhronosGroup/glTF-Blender-IO/assets/19254353/cfb9d021-70fe-4c06-9474-353d47a212b6)



**.blend file/ .gltf**
[untitled.zip](https://github.com/KhronosGroup/glTF-Blender-IO/files/11510566/untitled.zip)


**Version**
 - Windows 10
 - Blender Version 3.3.6 and 3.6.0 Beta

**Additional context**
None


Changed files:
addons/io_scene_gltf2/__init__.py

diff --git a/addons/io_scene_gltf2/__init__.py b/addons/io_scene_gltf2/__init__.py
index 846f7c68..35d61359 100644
--- a/addons/io_scene_gltf2/__init__.py
+++ b/addons/io_scene_gltf2/__init__.py
@@ -110,7 +110,7 @@ def on_export_format_changed(self, context):
 
     # Also change the filter
     sfile.params.filter_glob = '*.glb' if self.export_format == 'GLB' else '*.gltf'
-    # Force update of file list, has update the filter does not update the real file list
+    # Force update of file list, because update the filter does not update the real file list
     bpy.ops.file.refresh()
 
 
@@ -640,6 +640,10 @@ class ExportGLTF2_Base(ConvertGLTF2_Base):
                     setattr(self, k, v)
                 self.will_save_settings = True
 
+                # Update filter if user saved settings
+                if hasattr(self, 'export_format'):
+                    self.filter_glob = '*.glb' if self.export_format == 'GLB' else '*.gltf'
+
             except (AttributeError, TypeError):
                 self.report({"ERROR"}, "Loading export settings failed. Removed corrupted settings")
                 del context.scene[self.scene_key]
Repository: khronosgroup/gltf-blender-io
Issue: GLTF export fails with ZeroDivisionError

Example `.blend` file which exhibits the issue:

https://github.com/wonderunit/shot-generator-models/blob/77f39c6eac764ace508f3bf718f5443ec45a0fc6/characters/base/male-youth/male-youth.blend

Fails on this line: https://github.com/KhronosGroup/glTF-Blender-IO/blob/master/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py#L106

With the error `ZeroDivisionError: integer division or modulo by zero`

Using the nightly Blender 2.8 beta from today 7 Jan 2018.


Changed files:
addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py

diff --git a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py b/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py
index c9c2875d..892343ea 100644
--- a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py
+++ b/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py
@@ -107,6 +107,8 @@ def __get_image_data(sockets_or_slots, export_settings):
     # in a helper class. During generation of the glTF in the exporter these will then be combined to actual binary
     # ressources.
     def split_pixels_by_channels(image: bpy.types.Image, export_settings) -> typing.List[typing.List[float]]:
+        assert image.channels > 0, "Image '{}' has no color channels and cannot be exported.".format(image.name)
+
         channelcache = export_settings['gltf_channelcache']
         if image.name in channelcache:
             return channelcache[image.name]
Repository: khronosgroup/gltf-blender-io
Issue: Animation export without target node

From #515 

It seems that the following blend file export a target without any node

[open-book-gltf-issue.zip](https://github.com/KhronosGroup/glTF-Blender-IO/files/3258214/open-book-gltf-issue.zip)


Changed files:
addons/io_scene_gltf2/blender/exp/gltf2_blender_gather.py

diff --git a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather.py b/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather.py
index a723e447..ec3e33bf 100644
--- a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather.py
+++ b/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather.py
@@ -59,7 +59,10 @@ def __gather_scene(blender_scene, export_settings):
 def __gather_animations(blender_scene, export_settings):
     animations = []
     for blender_object in blender_scene.objects:
-        animations += gltf2_blender_gather_animations.gather_animations(blender_object, export_settings)
+        # First check if this object is exported or not. Do not export animation of not exported object
+        obj_node = gltf2_blender_gather_nodes.gather_node(blender_object, export_settings)
+        if obj_node is not None:
+            animations += gltf2_blender_gather_animations.gather_animations(blender_object, export_settings)
     return animations
Repository: khronosgroup/gltf-blender-io
Issue: Emissive factor missing?

I downloaded this car model:  https://sketchfab.com/models/885d9f60b3a9429bb4077cfac5653cf9

After import/export trip through Blender, the emissive channel is not active.  Turns out that the exporter wrote an `emissiveTexture` but not an `emissiveFactor`.  The default `emissiveFactor` is `[0, 0, 0]` so as not to blast all models to full white.  But without the `emissiveFactor` being set, the `emissiveTexture` is multiplied by zero and has no effect.

(Also looks like blending may have been lost from the car windows, that's separate...)

Changed files:
addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_materials.py

diff --git a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_materials.py b/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_materials.py
index 4a4d6c50..3fa82525 100644
--- a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_materials.py
+++ b/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_materials.py
@@ -109,8 +109,13 @@ def __gather_emissive_factor(blender_material, export_settings):
     emissive_socket = gltf2_blender_get.get_socket_or_texture_slot(blender_material, "Emissive")
     if emissive_socket is None:
         emissive_socket = gltf2_blender_get.get_socket_or_texture_slot_old(blender_material, "EmissiveFactor")
-    if isinstance(emissive_socket, bpy.types.NodeSocket) and not emissive_socket.is_linked:
-        return list(emissive_socket.default_value)[0:3]
+    if isinstance(emissive_socket, bpy.types.NodeSocket):
+        if emissive_socket.is_linked:
+            # In glTF, the default emissiveFactor is all zeros, so if an emission texture is connected,
+            # we have to manually set it to all ones.
+            return [1.0, 1.0, 1.0]
+        else:
+            return list(emissive_socket.default_value)[0:3]
     return None
Repository: khronosgroup/gltf-blender-io
Issue: problem exporting skins

When i export this blend file the skin index for USP_sophia.003 is greater than the length of the skins array. 

Using blender 2.79b on ubuntu 17.10, pulled the exported 9/3/18

[test_case.zip](https://github.com/KhronosGroup/glTF-Blender-Exporter/files/2497672/test_case.zip)


Changed files:
addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py

diff --git a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py b/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py
index 26c285e2..a2037186 100644
--- a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py
+++ b/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py
@@ -235,10 +235,24 @@ def __gather_trans_rot_scale(blender_object, export_settings):
 
 def __gather_skin(blender_object, export_settings):
     modifiers = {m.type: m for m in blender_object.modifiers}
+    if "ARMATURE" not in modifiers:
+        return None
+
+    # no skin needed when the modifier is linked without having a vertex group
+    vertex_groups = blender_object.vertex_groups
+    if len(vertex_groups) == 0:
+        return None
+
+    # check if any vertices in the mesh are part of a vertex group
+    if bpy.app.version < (2, 80, 0):
+        blender_mesh = blender_object.to_mesh(bpy.context.scene, True, 'PREVIEW')
+    else:
+        blender_mesh = blender_object.to_mesh(bpy.context.depsgraph, True)
+    if not any(vertex.groups is not None and len(vertex.groups) > 0 for vertex in blender_mesh.vertices):
+        return None
 
-    if "ARMATURE" in modifiers:
-        # Skins and meshes must be in the same glTF node, which is different from how blender handles armatures
-        return gltf2_blender_gather_skins.gather_skin(modifiers["ARMATURE"].object, export_settings)
+    # Skins and meshes must be in the same glTF node, which is different from how blender handles armatures
+    return gltf2_blender_gather_skins.gather_skin(modifiers["ARMATURE"].object, export_settings)
 
 
 def __gather_weights(blender_object, export_settings):
Repository: khronosgroup/gltf-blender-io
Issue: T69089 : blender v2.81 : libextern_draco.so is missing

See https://developer.blender.org/T69089

Seems update to python 3.7.4 broke the generation of .so lib


Changed files:
addons/io_scene_gltf2/io/exp/gltf2_io_draco_compression_extension.py

diff --git a/addons/io_scene_gltf2/io/exp/gltf2_io_draco_compression_extension.py b/addons/io_scene_gltf2/io/exp/gltf2_io_draco_compression_extension.py
index b9404343..c67ea098 100644
--- a/addons/io_scene_gltf2/io/exp/gltf2_io_draco_compression_extension.py
+++ b/addons/io_scene_gltf2/io/exp/gltf2_io_draco_compression_extension.py
@@ -28,7 +28,7 @@ def dll_path() -> Path:
     """
     lib_name = 'extern_draco'
     blender_root = Path(bpy.app.binary_path).parent
-    python_lib = "{v[0]}.{v[1]}/python/lib".format(v=bpy.app.version)
+    python_lib = Path("{v[0]}.{v[1]}/python/lib".format(v=bpy.app.version))
     python_version = "python{v[0]}.{v[1]}".format(v=sys.version_info)
     paths = {
         'win32': blender_root/python_lib/'site-packages'/'{}.dll'.format(lib_name),
Repository: khronosgroup/gltf-blender-io
Issue: T59047: performance issue (regression?)

https://developer.blender.org/T59047

Tests with default export options:
Tested on an old build I have on my laptop --> export in less than 1 minute
Tested with build of Dec 9th --> Still not finished after 15 minutes

We have to check if regression is on our side, or in blender api side

Changed files:
addons/io_scene_gltf2/blender/exp/gltf2_blender_extract.py

diff --git a/addons/io_scene_gltf2/blender/exp/gltf2_blender_extract.py b/addons/io_scene_gltf2/blender/exp/gltf2_blender_extract.py
index 06b60168..09e00862 100644
--- a/addons/io_scene_gltf2/blender/exp/gltf2_blender_extract.py
+++ b/addons/io_scene_gltf2/blender/exp/gltf2_blender_extract.py
@@ -975,10 +975,10 @@ def extract_primitives(glTF, blender_mesh, blender_vertex_groups, modifiers, exp
 
         if max_index >= range_indices:
             #
-            # Spliting result_primitives.
+            # Splitting result_primitives.
             #
 
-            # At start, all indicees are pending.
+            # At start, all indices are pending.
             pending_attributes = {
                 POSITION_ATTRIBUTE: [],
                 NORMAL_ATTRIBUTE: []
@@ -1038,6 +1038,7 @@ def extract_primitives(glTF, blender_mesh, blender_vertex_groups, modifiers, exp
             while len(pending_indices) > 0:
 
                 process_indices = pending_primitive[INDICES_ID]
+                max_index = max(process_indices)
 
                 pending_indices = []
 
@@ -1046,7 +1047,7 @@ def extract_primitives(glTF, blender_mesh, blender_vertex_groups, modifiers, exp
 
                 all_local_indices = []
 
-                for i in range(0, (max(process_indices) // range_indices) + 1):
+                for i in range(0, (max_index // range_indices) + 1):
                     all_local_indices.append([])
 
                 #
@@ -1063,7 +1064,7 @@ def extract_primitives(glTF, blender_mesh, blender_vertex_groups, modifiers, exp
                                          process_indices[face_index + 2])
 
                     # ... check if it can be but in a range of maximum indices.
-                    for i in range(0, (max(process_indices) // range_indices) + 1):
+                    for i in range(0, (max_index // range_indices) + 1):
                         offset = i * range_indices
 
                         # Yes, so store the primitive with its indices.
@@ -1075,7 +1076,7 @@ def extract_primitives(glTF, blender_mesh, blender_vertex_groups, modifiers, exp
                             written = True
                             break
 
-                    # If not written, the triangel face has indices from different ranges.
+                    # If not written, the triangle face has indices from different ranges.
                     if not written:
                         pending_indices.extend([process_indices[face_index + 0], process_indices[face_index + 1],
                                                 process_indices[face_index + 2]])
Repository: khronosgroup/gltf-blender-io
Issue: T69089 : blender v2.81 : libextern_draco.so is missing

See https://developer.blender.org/T69089

Seems update to python 3.7.4 broke the generation of .so lib


Changed files:
addons/io_scene_gltf2/io/exp/gltf2_io_draco_compression_extension.py

diff --git a/addons/io_scene_gltf2/io/exp/gltf2_io_draco_compression_extension.py b/addons/io_scene_gltf2/io/exp/gltf2_io_draco_compression_extension.py
index d2cf0c60..3f72ea88 100644
--- a/addons/io_scene_gltf2/io/exp/gltf2_io_draco_compression_extension.py
+++ b/addons/io_scene_gltf2/io/exp/gltf2_io_draco_compression_extension.py
@@ -27,12 +27,15 @@ def dll_path() -> Path:
     :return: DLL path.
     """
     lib_name = 'extern_draco'
-    blender_root = Path(bpy.app.binary_path).parent
-    python_lib = Path('2.80/python/lib')
+    # Workaround: convert_to_strict_*.py deletes all lines containing the string 'bpy.app.version'.
+    bapp = bpy.app
+    blender_root = Path(bapp.binary_path).parent
+    python_lib = "{v[0]}.{v[1]}/python/lib".format(v=bapp.version)
+    python_version = "python{v[0]}.{v[1]}".format(v=sys.version_info)
     paths = {
         'win32': blender_root/python_lib/'site-packages'/'{}.dll'.format(lib_name),
-        'linux': blender_root/python_lib/'python3.7'/'site-packages'/'lib{}.so'.format(lib_name),
-        'darwin': blender_root.parent/'Resources'/python_lib/'python3.7'/'site-packages'/'lib{}.dylib'.format(lib_name)
+        'linux': blender_root/python_lib/python_version/'site-packages'/'lib{}.so'.format(lib_name),
+        'darwin': blender_root.parent/'Resources'/python_lib/python_version/'site-packages'/'lib{}.dylib'.format(lib_name)
     }
 
     path = paths.get(sys.platform)
Repository: khronosgroup/gltf-blender-io
Issue: Animation with rotation around z-axis in Blender does not convert to y-axis in GLTF-export

**Describe the bug**
I have an object which has an animation with rotation around the z-axis and that scene is exported to GLTF, the scene will be converted to Y-up, but the animation appears not to. "Y-up" is enabled during export and the scene, except for the door, appear normally when exported. In fact, the door appears just fine as well, until the animation is started.

**To Reproduce**
Steps to reproduce the behavior:
1. Open the attached .blend-file
2. Play the animation for "Right.door"
3. Export to GLTF
4. Upload the .glb-file to https://gltf-viewer.donmccurdy.com/ and see the door animation being faulty.

**Expected behavior**
The door should animate as it does in Blender, instead of wrongly as shown in the gltf-viewer.

**.blend file/ .gltf**
https://we.tl/t-8hiGgS9rsY

**Version**
 - OS: Ubuntu 20.04 LTS, 64-bit X11
 - Blender Version: 2.91.2


Changed files:
addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_samplers.py

diff --git a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_samplers.py b/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_samplers.py
index c3913367..55f4d35d 100644
--- a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_samplers.py
+++ b/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_samplers.py
@@ -56,7 +56,10 @@ def gather_animation_sampler(channels: typing.Tuple[bpy.types.FCurve],
                                                  bake_channel,
                                                  driver_obj,
                                                  export_settings)
-
+    if blender_object.parent is not None:
+        matrix_parent_inverse = blender_object.matrix_parent_inverse.copy().freeze()
+    else:
+        matrix_parent_inverse = mathutils.Matrix.Identity(4).freeze()
 
     sampler = gltf2_io.AnimationSampler(
         extensions=__gather_extensions(channels, blender_object_if_armature, export_settings, bake_bone, bake_channel),
@@ -64,7 +67,8 @@ def gather_animation_sampler(channels: typing.Tuple[bpy.types.FCurve],
         input=__gather_input(channels, blender_object_if_armature, non_keyed_values,
                              bake_bone, bake_channel, bake_range_start, bake_range_end, action_name, driver_obj, export_settings),
         interpolation=__gather_interpolation(channels, blender_object_if_armature, export_settings, bake_bone, bake_channel),
-        output=__gather_output(channels, blender_object.matrix_parent_inverse.copy().freeze(),
+        output=__gather_output(channels,
+                               matrix_parent_inverse,
                                blender_object_if_armature,
                                non_keyed_values,
                                bake_bone,
Repository: khronosgroup/gltf-blender-io
Issue: Export: "Limit to Selected Objects" is not remembered by "Remember Export Settings"

For #956, "Limit to Selected Objects" was renamed from `export_selected` to `use_selection`. However, "Remember Export Settings" depends on all options that should be saved starting with `export_`.

https://github.com/KhronosGroup/glTF-Blender-IO/blob/90579852a469d4d616c10dd0f6bae076b6f3d1d9/addons/io_scene_gltf2/__init__.py#L384-L390

Changed files:
addons/io_scene_gltf2/__init__.py

diff --git a/addons/io_scene_gltf2/__init__.py b/addons/io_scene_gltf2/__init__.py
index 97cea5dd..88ea033f 100644
--- a/addons/io_scene_gltf2/__init__.py
+++ b/addons/io_scene_gltf2/__init__.py
@@ -384,7 +384,7 @@ class ExportGLTF2_Base:
         # find all export_ props
         all_props = self.properties
         export_props = {x: getattr(self, x) for x in dir(all_props)
-                        if x.startswith("export_") and all_props.get(x) is not None}
+                        if (x.startswith("export_") or x == "use_selection") and all_props.get(x) is not None}
 
         context.scene[self.scene_key] = export_props
Repository: khronosgroup/gltf-blender-io
Issue: Export: NLA strip animations sometimes aren't named with their track name

Sometimes (when the NLA strip animation consists of a single action I think), an exported NLA strip animation will be named after an action instead of after the track name.

For example, if you import CesiumMan, you get one NLA strip animation. The track is named "Anim_0" and the action is named "Anim_0_Node_21".

If you then export, you get an animation named "Anim_0_Node_21".

Round-trip a few more times and you wind up with an animation named "Anim_0_Node_21_Node_21_Node_21".

The name should stay "Anim_0" across round-trips.

Changed files:
addons/io_scene_gltf2/blender/exp/gltf2_blender_gather.py

diff --git a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather.py b/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather.py
index 02c93b10..f08a379b 100644
--- a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather.py
+++ b/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather.py
@@ -87,7 +87,7 @@ def __gather_animations(blender_scene, export_settings):
 
             # There is only 1 animation in the track
             # If name of the track is not a default name, use this name for action
-            animations[0].name = merged_anim_track
+            animations[merged_tracks[merged_anim_track][0]].name = merged_anim_track
 
             continue
Repository: khronosgroup/gltf-blender-io
Issue: Import: exception importing large integers in extras

If an extra property is an integer which doesn't fit in a C int, (eg. >= 2^31), the whole import fails with an exception. 

Example:

```json
{
  "asset": { "version": "2.0" },
  "nodes": [
    {
      "extras": {
        "number": 9999999999
      }
    }
  ]
}
```

The guard for importing extras

https://github.com/KhronosGroup/glTF-Blender-IO/blob/8f41a73e442c3cf10ac4f605e1fc962927f421ee/addons/io_scene_gltf2/blender/com/gltf2_blender_extras.py#L90-L93

catches TypeErrors, but in this case an OverflowError is thrown. I'll repeat my conclusion from #1353: **the catch should be broadened from TypeError to Exception** to prevent future problems like this from making the whole import fail.

Changed files:
addons/io_scene_gltf2/blender/com/gltf2_blender_extras.py

diff --git a/addons/io_scene_gltf2/blender/com/gltf2_blender_extras.py b/addons/io_scene_gltf2/blender/com/gltf2_blender_extras.py
index 742ae5e3..3ef88222 100755
--- a/addons/io_scene_gltf2/blender/com/gltf2_blender_extras.py
+++ b/addons/io_scene_gltf2/blender/com/gltf2_blender_extras.py
@@ -89,5 +89,9 @@ def set_extras(blender_element, extras, exclude=[]):
 
         try:
             blender_element[custom_property] = value
-        except TypeError:
-            print('Error setting property %s to value of type %s' % (custom_property, type(value)))
+        except Exception:
+            # Try to convert to string
+            try:
+                blender_element[custom_property] = str(value)
+            except Exception:
+                print('Error setting property %s to value of type %s' % (custom_property, type(value)))
Repository: khronosgroup/gltf-blender-io
Issue: Importing animated glb resulted in deformed mesh.

I tried importing the following animated glb file resulted in deformed mesh. Worked appropriately with:

https://gltf-viewer.donmccurdy.com/

[quaternius_Male_Casual.zip](https://github.com/KhronosGroup/glTF-Blender-IO/files/2948158/quaternius_Male_Casual.zip)


Changed files:
addons/io_scene_gltf2/blender/imp/gltf2_blender_skin.py

diff --git a/addons/io_scene_gltf2/blender/imp/gltf2_blender_skin.py b/addons/io_scene_gltf2/blender/imp/gltf2_blender_skin.py
index 7994084d..b60572c9 100644
--- a/addons/io_scene_gltf2/blender/imp/gltf2_blender_skin.py
+++ b/addons/io_scene_gltf2/blender/imp/gltf2_blender_skin.py
@@ -153,7 +153,7 @@ class BlenderSkin():
         bone = obj.data.edit_bones.new(name)
         pynode.blender_bone_name = bone.name
         pynode.blender_armature_name = pyskin.blender_armature_name
-        bone.tail = Vector((0.0, 1.0, 0.0))  # Needed to keep bone alive
+        bone.tail = Vector((0.0, 1.0 / obj.matrix_world.to_scale()[1], 0.0))  # Needed to keep bone alive
         # Custom prop on edit bone
         set_extras(bone, pynode.extras)
Repository: khronosgroup/gltf-blender-io
Issue: AttributeError: 'NoneType' object has no attribute 'key_blocks'

**Describe the bug**

A Python error shows on export 

**To Reproduce**

1. Download the blend file below
2. Select the `rig` and the `body` objects
3. Export as gltf. Options used (different from defaults): 
    1. Include -> Selected objects
    2. Geometry -> Apply modifiers
4. See the traceback: https://pastebin.com/8cWeqAjz

**Expected behavior**

No error on export

**.blend file/ .gltf**

[mannequiny-0.2.0.zip](https://github.com/KhronosGroup/glTF-Blender-IO/files/3882867/mannequiny-0.2.0.zip)

**Version**
 - OS: linux
 - Blender Version 2.81

**Additional context**

I was unable to pinpoint the step that triggered the bug. It happened several times today with several versions of this blend file, and the only solution I've found was to revert to a previously saved version.

Changed files:
addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py

diff --git a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py b/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py
index 3125828f..6f10500d 100644
--- a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py
+++ b/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py
@@ -94,6 +94,11 @@ def __get_channel_group_sorted(channels: typing.Tuple[bpy.types.FCurve], blender
         first_channel = channels[0]
         object_path = get_target_object_path(first_channel.data_path)
         if object_path:
+            if not blender_object.data.shape_keys:
+                # Something is wrong. Maybe the user assigned an armature action
+                # to a mesh object. Returning without sorting
+                return channels
+
             # This is shapekeys, we need to sort channels
             shapekeys_idx = {}
             cpt_sk = 0
Repository: khronosgroup/gltf-blender-io
Issue: Import: morph target named 'Basis' imported wrong

Since we use 'Basis' as the name of the special first shape key, we shouldn't let morph targets use it. You can test by taking, say, MorphStressTest, and renaming one of targetNames in the glTF to 'Basis'.

Fix is just to use `set(['Basis'])` [here](https://github.com/KhronosGroup/glTF-Blender-IO/blob/bb488b245f0c83fdd566b43c2c762d469c044326/addons/io_scene_gltf2/blender/imp/gltf2_blender_gltf.py#L168), so 'Basis' will always be regarded as "taken".

Changed files:
addons/io_scene_gltf2/blender/imp/gltf2_blender_gltf.py

diff --git a/addons/io_scene_gltf2/blender/imp/gltf2_blender_gltf.py b/addons/io_scene_gltf2/blender/imp/gltf2_blender_gltf.py
index 48f18079..92f8f469 100755
--- a/addons/io_scene_gltf2/blender/imp/gltf2_blender_gltf.py
+++ b/addons/io_scene_gltf2/blender/imp/gltf2_blender_gltf.py
@@ -165,7 +165,7 @@ class BlenderGlTF():
         # Calculate names for each mesh's shapekeys
         for mesh in gltf.data.meshes or []:
             mesh.shapekey_names = []
-            used_names = set()
+            used_names = set(['Basis']) #Be sure to not use 'Basis' name at import, this is a reserved name
 
             # Some invalid glTF files has empty primitive tab
             if len(mesh.primitives) > 0:
Repository: khronosgroup/gltf-blender-io
Issue: "Keep original" + packed images --> Invalid file

Using Keep original, when original source file can't be retrieved (for example because there are packed images), this generate invalid file (image without an uri)

Better to not export texture at all, will be better than export an invalid glTF file

Changed files:
addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py, addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_texture.py

diff --git a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py b/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py
index baee02bd..e1ec4bf7 100644
--- a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py
+++ b/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_image.py
@@ -47,6 +47,9 @@ def gather_image(
     else:
         # Retrieve URI relative to exported glTF files
         uri = __gather_original_uri(image_data.original.filepath, export_settings)
+        # In case we can't retrieve image (for example packed images, with original moved)
+        # We don't create invalid image without uri
+        if uri is None: return None
 
     buffer_view = __gather_buffer_view(image_data, mime_type, name, export_settings)
 
diff --git a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_texture.py b/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_texture.py
index 96146523..8cc880d5 100644
--- a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_texture.py
+++ b/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_texture.py
@@ -48,6 +48,7 @@ def gather_texture(
     )
 
     # although valid, most viewers can't handle missing source properties
+    # This can have None source for "keep original", when original can't be found
     if texture.source is None:
         return None
Repository: khronosgroup/gltf-blender-io
Issue: Export: +Y Up off broken for bones

The model from #1607 is broken when exporting with "+Y Up" off with master. It worked in 3.0.

The first bad commit is 67ec397d. The problem appears to be that the axis_basis_change code here forgets to handle the "+Y Up" off case

https://github.com/KhronosGroup/glTF-Blender-IO/blob/60c634eac89a4cef444cfcd8204bdf797db2f5cb/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_tree.py#L184-L185

Compare with

https://github.com/KhronosGroup/glTF-Blender-IO/blob/60c634eac89a4cef444cfcd8204bdf797db2f5cb/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_tree.py#L437-L440

Changed files:
addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_tree.py

diff --git a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_tree.py b/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_tree.py
index 1f96c11d..1843a517 100644
--- a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_tree.py
+++ b/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_tree.py
@@ -181,8 +181,10 @@ class VExportTree:
                 node.matrix_world @= correction.to_matrix().to_4x4()
         elif node.blender_type == VExportNode.BONE:
             node.matrix_world = self.nodes[node.armature].matrix_world @ blender_bone.matrix
-            axis_basis_change = Matrix(
-                ((1.0, 0.0, 0.0, 0.0), (0.0, 0.0, 1.0, 0.0), (0.0, -1.0, 0.0, 0.0), (0.0, 0.0, 0.0, 1.0)))
+            axis_basis_change = Matrix.Identity(4) 
+            if self.export_settings[gltf2_blender_export_keys.YUP]:
+                axis_basis_change = Matrix(
+                    ((1.0, 0.0, 0.0, 0.0), (0.0, 0.0, 1.0, 0.0), (0.0, -1.0, 0.0, 0.0), (0.0, 0.0, 0.0, 1.0)))
             node.matrix_world = node.matrix_world @ axis_basis_change
 
         # Force empty ?
Repository: boto/botocore
Issue: Iterating on lines of S3 empty files generates exception

My code looks like:
```python
    def process_file(filename, f):
        log.info("Indexing file %s", filename)
        for line in f:
(...)
    s3 = boto3.resource('s3')
    for o in s3.Bucket(bucket).objects.filter(Prefix=path):
        with closing(o.get()['Body']) as f:
            for line in process_file('s3://' + o.bucket_name + "/" + o.key, f.iter_lines()):
                yield line
```

With botocore>=1.12.68 (including 1.12.71) this gives:
```
  File "main.py", line 68, in gen_bulk_data
    for line in process_file('s3://' + o.bucket_name + "/" + o.key, f.iter_lines()):
  File "main.py", line 57, in process_file
    for line in f:
  File "/usr/local/lib/python3.5/site-packages/botocore/response.py", line 117, in iter_lines
    yield pending.splitlines()[0]
IndexError: list index out of range
```
It works with botocore<1.12.68

Changed files:
tests/unit/test_response.py, botocore/response.py

diff --git a/botocore/response.py b/botocore/response.py
index 13a15f9fd..93c7937aa 100644
--- a/botocore/response.py
+++ b/botocore/response.py
@@ -114,7 +114,8 @@ class StreamingBody(object):
             for line in lines[:-1]:
                 yield line.splitlines()[0]
             pending = lines[-1]
-        yield pending.splitlines()[0]
+        if pending:
+            yield pending.splitlines()[0]
 
     def iter_chunks(self, chunk_size=_DEFAULT_CHUNK_SIZE):
         """Return an iterator to yield chunks of chunk_size bytes from the raw
diff --git a/tests/unit/test_response.py b/tests/unit/test_response.py
index d1e1fd8ce..6ad43e537 100644
--- a/tests/unit/test_response.py
+++ b/tests/unit/test_response.py
@@ -167,6 +167,12 @@ class TestStreamWrapper(unittest.TestCase):
                 [b'1234567890', b'1234567890', b'12345'],
             )
 
+    def test_streaming_line_empty_body(self):
+        stream = response.StreamingBody(
+            six.BytesIO(b''), content_length=0,
+        )
+        self.assert_lines(stream.iter_lines(), [])
+
 
 class FakeRawResponse(six.BytesIO):
     def stream(self, amt=1024, decode_content=None):
Repository: boto/botocore
Issue: Pin jmespatch dependency version

Can this library pin its jmespath dependency to a specific version?  Currently, it depends on the development branch of the jmespath GitHub repo - which is not stable nor deterministic.

Currently, this project's setup.py requires version 0.7.1 but the upstream GitHub repo/branch does not deliver that version - so this project's dependency graph is disconnected.

This can result in runtime errors for downstream consumers - like my organization did today.


Changed files:
setup.py

diff --git a/setup.py b/setup.py
index ea3260e99..b1ed6c109 100644
--- a/setup.py
+++ b/setup.py
@@ -5,7 +5,7 @@ import sys
 from setuptools import setup, find_packages
 
 
-requires = ['jmespath==0.7.1',
+requires = ['jmespath>=0.7.1,<1.0.0',
             'python-dateutil>=2.1,<3.0.0',
             'docutils>=0.10']
Repository: robotframework/seleniumlibrary
Issue: atest task loses python interpreter when running with virtualenv under Windows


# For issues
## Steps to reproduce the issue

Under Windows

```msbatch
mkdir atest-python-interpreter
cd atest-python-interpreter
virtualenv -p C:\\Python39\\python.exe venv-py39
venv-py39\\Scripts\\activate
git clone git@github.com:robotframework/SeleniumLibrary.git rf-sl
cd rf-sl
pip install -r requirements-dev.txt
inv atest
```

The last command results in an error
```
(venv-py39) D:\\devsandbox\\atest-python-interpreter\\rf-sl>inv atest
Traceback (most recent call last):
  File "D:\\devsandbox\\atest-python-interpreter\\rf-sl\\utest\\run.py", line 9, in <module>
    from pytest import main as py_main
ModuleNotFoundError: No module named 'pytest'
Not running acceptance test, because unit tests failed.
```
## Error messages and additional information

The last command results in an error
```
(venv-py39) D:\\devsandbox\\atest-python-interpreter\\rf-sl>inv atest
Traceback (most recent call last):
  File "D:\\devsandbox\\atest-python-interpreter\\rf-sl\\utest\\run.py", line 9, in <module>
    from pytest import main as py_main
ModuleNotFoundError: No module named 'pytest'
Not running acceptance test, because unit tests failed.
```

I am running under Windows 10 using Python 3.9.9 within a virtual env

## Expected behavior and actual behavior

I was expecting the runner to use the virtual env I have executed with. But instead it appeas to run `python` from a process not realizing it is a virtualenv that it was started under.

## Environment

Browser: Name and version (Usually available from the about dialogue.)
Browser driver: Name and version
Operating System: Windows 10
Libraries
- Robot Framework: 5.0.1
- Selenium: 4.5.0
- SeleniumLibrary: 6.1.0.dev1
- Interpreter: Python 3.9.9 under a virtualenv

```
(venv-py39) C:\\projects\\SeleniumLibrary\\atest-python-interpreter\\rf-sl>pip list
Package                      Version
---------------------------- -----------
[ ... snip ...]
pytest                       7.1.3
pytest-approvaltests         0.2.4
pytest-mockito               0.0.4
[ ... snip ...]
```


Changed files:
tasks.py

diff --git a/tasks.py b/tasks.py
index ced30c3..fd21efe 100644
--- a/tasks.py
+++ b/tasks.py
@@ -221,7 +221,7 @@ def utest(ctx, suite=None):
     Args:
         suite: Select which suite to run.
     """
-    command = "python utest/run.py"
+    command = f"{sys.executable} utest/run.py"
     if suite:
         command = f"{command} --suite {suite}"
     ctx.run(command)
Repository: aiven/pghoard
Issue: [Flaky Test] Test `TestPGHoardWithPG::test_pause_on_disk_full` is flaky

Here you can find an occurrence of the flaky test:
https://github.com/aiven/pghoard/runs/4443587994?check_suite_focus=true

```
=========================== short test summary info ============================
FAILED test/test_pghoard.py::TestPGHoardWithPG::test_pause_on_disk_full - Ass...
====== 1 failed, 144 passed, 21 skipped, 10 warnings in 203.04s (0:03:23) ======
make: *** [Makefile:13: unittest] Error 1
Error: Process completed with exit code 2.
```

This is the relevant error message if I read it correctly:
```
test/test_pghoard.py::TestPGHoard::test_handle_site
  /opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/_pytest/threadexception.py:75: PytestUnhandledThreadExceptionWarning: Exception in thread Thread-357
  
  Traceback (most recent call last):
    File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/threading.py", line 932, in _bootstrap_inner
      self.run()
    File "/home/runner/work/pghoard/pghoard/pghoard/walreceiver.py", line 155, in run
      self._init_cursor()
    File "/home/runner/work/pghoard/pghoard/pghoard/walreceiver.py", line 65, in _init_cursor
      self.conn = psycopg2.connect(self.dsn, connection_factory=PhysicalReplicationConnection)
    File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/psycopg2/__init__.py", line 122, in connect
      conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
    File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/psycopg2/extras.py", line 511, in __init__
      super().__init__(*args, **kwargs)
  psycopg2.OperationalError: connection to server at "127.0.0.4", port 5432 failed: Connection refused
  	Is the server running on that host and accepting TCP/IP connections?
```

Changed files:
pghoard/receivexlog.py

diff --git a/pghoard/receivexlog.py b/pghoard/receivexlog.py
index 297e19b..f3d5a82 100644
--- a/pghoard/receivexlog.py
+++ b/pghoard/receivexlog.py
@@ -61,7 +61,7 @@ class PGReceiveXLog(Thread):
         self.pid = proc.pid
         self.log.info("Started: %r, running as PID: %r", command, self.pid)
         while self.running:
-            rlist, _, _ = select.select([proc.stdout, proc.stderr], [], [], 1.0)
+            rlist, _, _ = select.select([proc.stdout, proc.stderr], [], [], min(1.0, self.disk_space_check_interval))
             for fd in rlist:
                 content = fd.read()
                 if content: