Skip to content

readinto fallback for missing argument #48

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

Merged
merged 3 commits into from
Mar 23, 2021

Conversation

FoamyGuy
Copy link
Contributor

This resolves the first issue mentioned in #47.

The current released versions of CircuitPython do contain readinto() but do not contain all of the arguments that this library is trying to use. (CircuitPython main branch does include all of the arguments, it appears some were merged in after the release).

This changes catches the unexpected argument error and falls back to attempting the python file read method of loading the image.

This could be removed once we have a release that does include those arguments that are in use in this library.

I tested these changes with the simpletest script in this repo on:

Adafruit CircuitPython 6.2.0-beta.4 on 2021-03-18; Adafruit Feather RP2040 with rp2040

With the changes from this PR I am able to run the simpletest successfully and have it show the image, instead of raising the error.

@FoamyGuy FoamyGuy requested a review from a team March 21, 2021 13:36
@jposada202020
Copy link
Contributor

@FoamyGuy
first I was able to reproduce the issue #47.
I used

Adafruit CircuitPython 6.2.0-beta.4 on 2021-03-18; Seeeduino Wio Terminal with samd51p19

After using the changes in e74fe84 the bitmap loads without any problem and as expected.

image

looks good to me

@jepler
Copy link
Contributor

jepler commented Mar 21, 2021

I'm not super excited about adding this new block of code given that only one beta (albeit the current one) is affected. Can we file an issue saying to remove it when we release the next beta of circuitpython so we don't carry it forever? Add a comment that it only affects 6.2.0-beta.4 and not older or newer versions?...

@FoamyGuy
Copy link
Contributor Author

Sounds good to me, thank you Jeff. I'll update the comment to call out the version specifically, and make an issue referencing it as well.

# Conflicts:
#	adafruit_imageload/bmp/indexed.py
@FoamyGuy FoamyGuy merged commit 7f24d74 into adafruit:master Mar 23, 2021
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Mar 24, 2021
Updating https://github.com/adafruit/Adafruit_CircuitPython_BNO08X to 1.1.0 from 1.0.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_BNO08x#19 from adafruit/patch-test
  > Merge pull request adafruit/Adafruit_CircuitPython_BNO08x#14 from yugyesh/patch-3

Updating https://github.com/adafruit/Adafruit_CircuitPython_CAP1188 to 1.2.7 from 1.2.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_CAP1188#20 from adafruit/linting
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_EMC2101 to 1.1.5 from 1.1.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_EMC2101#7 from rpavlik/slim-lut
  > Merge pull request adafruit/Adafruit_CircuitPython_EMC2101#6 from rpavlik/split
  > Merge pull request adafruit/Adafruit_CircuitPython_EMC2101#9 from rpavlik/fix-lut
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI to 3.5.8 from 3.5.7:
  > Merge pull request adafruit/Adafruit_CircuitPython_ESP32SPI#130 from adafruit/anecdata-patch-2
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_TLC5947 to 1.3.4 from 1.3.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_TLC5947#24 from adafruit/REUSE
  > "Increase duplicate code check threshold "
  > Re-added pylint install to build.yml
  > Removed pylint process from github workflow
  > Hardcoded Black and REUSE versions
  > Added pre-commit-config file
  > Added pre-commit and SPDX copyright

Updating https://github.com/adafruit/Adafruit_CircuitPython_TLV493D to 1.2.4 from 1.2.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_TLV493D#11 from lubarb/setup-edit
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_BLE_Cycling_Speed_and_Cadence to 1.1.4 from 1.1.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_BLE_Cycling_Speed_and_Cadence#6 from adafruit/pre-commit
  > "Increase duplicate code check threshold "
  > Re-added pylint install to build.yml
  > Removed pylint process from github workflow
  > Hardcoded Black and REUSE versions
  > Added pre-commit-config file
  > Added pre-commit and SPDX copyright

Updating https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_Layout to 1.6.0 from 1.5.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_DisplayIO_Layout#18 from kmatch98/icon_palette
  > Merge pull request adafruit/Adafruit_CircuitPython_DisplayIO_Layout#25 from jposada202020/main
  > Merge pull request adafruit/Adafruit_CircuitPython_DisplayIO_Layout#24 from kmatch98/touch_fix

Updating https://github.com/adafruit/Adafruit_CircuitPython_HID to 4.2.0 from 4.1.7:
  > Merge pull request adafruit/Adafruit_CircuitPython_HID#62 from jfurcean/add-led-status
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_ImageLoad to 0.14.1 from 0.14.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_ImageLoad#48 from FoamyGuy/readinto_fallback
  > Merge pull request adafruit/Adafruit_CircuitPython_ImageLoad#49 from kmatch98/readinto_fix

Updating https://github.com/adafruit/Adafruit_CircuitPython_MIDI to 1.3.4 from 1.3.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_MIDI#34 from adafruit/test-lint
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_PIOASM to 0.3.0 from 0.2.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_PIOASM#19 from adafruit/add-tests
  > Merge pull request adafruit/Adafruit_CircuitPython_PIOASM#18 from adafruit/jepler-rxuart-example
  > "Increase duplicate code check threshold "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants