Skip to content

Opening file object in append mode fail. #1027

@RemiDesgrange

Description

@RemiDesgrange

Expected behavior and actual behavior.

Opening a file-descriptor (BytesIO, StringIO, or an openned file doesn't work with the append mode.

This is normal see implementation here: https://github.com/Toblerity/Fiona/blob/master/fiona/__init__.py#L212 and https://github.com/Toblerity/Fiona/blob/master/fiona/__init__.py#L212

Steps to reproduce the problem.

import fiona
from io import BytesIO

fp = BytesIO(b"some random valid geopackage bytes")
with fiona.open(fp, 'a', driver="Gpkg", schema={"something": "valid"}) as gpkg_file:
    pass

Operating system

Linux (Arch)

Fiona and GDAL version and provenance

1.8.20 manylinux1 wheel installed from PyPI using pip version 21.1.3.

GDAL 3.3, installed via package manager.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions