-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError in python 3.6 #25
Comments
Pull requests definitely welcome :) |
done - also I was mistaken about the TypeError not showing up in 3.4: I actually was not able to test the current version of fdfgen with python 3.4 for some local install oddity reasons, so, I'm not sure if it shows up in 3.4 or not. |
This is fixed, correct? |
I ran into some similar comfusion a few months back, as to whether or not
this had been included. Looks like it was accepted and merged in pull
request #26 #26 on May 9 2017, but,
the version that you get with pip install is still a version from before
that time as far as I can tell. So you need to download the files directly
from the github page, until the version that pip draws from gets updated.
Anders, is that correct?
…On Mon, Nov 20, 2017 at 12:05 PM, John Anderson ***@***.***> wrote:
This is fixed, correct?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#25 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AR4iZqOdpnFnEKFJVivowONJfueE_qSkks5s4dtxgaJpZM4NUyoI>
.
|
I tested on python3.6 and everything seems to be working. |
looks like we forgot to cut a new release after merging a fix. See #25
Yeah, sorry. Looks like we forgot to cut a release after that merge. PR in for it now. |
0.16.1 should be up on PyPI now. |
I have a program (github.com/ncssar/radiolog) that makes various calls to fdfgen. Python 3.6 (but not 3.4) generates a Type Error on startswith if the value is bytes:
Traceback (most recent call last):
File "radiolog.py", line 3413, in accept
self.parent.parent.printClueReport(clueData)
File "radiolog.py", line 1511, in printClueReport
fdf=forge_fdf("",fields,[],[],[])
File "C:\Python36\lib\site-packages\fdfgen_init_.py", line 136, in forge_fdf
checkbox_checked_name)))
File "C:\Python36\lib\site-packages\fdfgen_init_.py", line 75, in handle_data_strings
value = FDFIdentifier(checkbox_checked_name).value
File "C:\Python36\lib\site-packages\fdfgen_init_.py", line 52, in init
if value.startswith('/'):
TypeError: startswith first arg must be bytes or a tuple of bytes, not str
and if I try hardcoding line 52 to bytes instead, I get the opposite TypeError:
Traceback (most recent call last):
File "radiolog.py", line 3413, in accept
self.parent.parent.printClueReport(clueData)
File "radiolog.py", line 1511, in printClueReport
fdf=forge_fdf("",fields,[],[],[])
File "C:\Python36\lib\site-packages\fdfgen_init_.py", line 136, in forge_fdf
checkbox_checked_name)))
File "C:\Python36\lib\site-packages\fdfgen_init_.py", line 77, in handle_data_strings
value = FDFIdentifier('Off').value
File "C:\Python36\lib\site-packages\fdfgen_init_.py", line 52, in init
if value.startswith(b'/'):
TypeError: startswith first arg must be str or a tuple of str, not bytes
I think the solution is just to place the type check and conversion code before the startswith clause instead of after.
Old:
New: (just swapped the two clauses)
This works in my program on python 3.6, but, I'm not an expert. Let me know if I should do this as a fork and pull request instead.
Thanks. This project has been very helpful!
The text was updated successfully, but these errors were encountered: