rsgalloway / pyseq

Compressed sequence string module for Python

Home Page:https://pyseq.rsgalloway.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

format error when %s (start) in fmt string

herronelou opened this issue · comments

We ran into an error this morning when trying to format a sequence '%h%s%t' (basically return the first frame of the sequence).

In the formatting, when it does the _old to _new replace, the fmt string gets edited as:
%(h)s%s%t
then:
%(h)(s)%(s)i%t
At which point it breaks because the s added in the first replace gets replaced by (s).

I got a fix but got to make unit tests then I'll make a Pull request

Thanks for the report. For the record, is this the traceback you're seeing?

>>> print s.format('%h%s%t')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "pyseq.py", line 514, in format
    return fmt % atts
ValueError: unsupported format character '(' (0x28) at index 4

And when using %s alone, I'm getting the following,

>>> print s.format('%s')
1

so you'd expect something like this, is that right?

>>> print s.format('%h%s%t')
file.1.jpg

merged into 1.0.0 branch