Skip to content
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

--restrict broken in 3.0.3 #266

Open
onlyhavecans opened this issue Oct 11, 2017 · 9 comments · May be fixed by #313
Open

--restrict broken in 3.0.3 #266

onlyhavecans opened this issue Oct 11, 2017 · 9 comments · May be fixed by #313

Comments

@onlyhavecans
Copy link

Updating from 3.0.2_1 in brew to 3.0.3 breaks the --restrict option.
The command /usr/local/bin/ponysay --restrict NAME=Rarity --ponyonly no longer shows just Rarity images but any pony.
The changelog shows nothing relating to these changes.

@JotaRandom
Copy link
Collaborator

JotaRandom commented Oct 11, 2017 via email

@onlyhavecans
Copy link
Author

I can verify the following returns a rarity

[I] dos@risuposokon /u/l/C/p/3/bin> pwd
/usr/local/Cellar/ponysay/3.0.2_1/bin
[I] dos@risuposokon /u/l/C/p/3/bin> ./ponysay --restrict NAME=Rarity --ponyonly

but the following does not

[I] dos@risuposokon /u/l/C/p/3/bin> pwd
/usr/local/Cellar/ponysay/3.0.3/bin
[I] dos@risuposokon /u/l/C/p/3/bin> ./ponysay --restrict NAME=Rarity --ponyonly

Installed from brew, macOS Sierra 10.12.6 (16G29), fish version 2.6.0

@JotaRandom
Copy link
Collaborator

JotaRandom commented Oct 12, 2017

I don't have time until a weekend so I will try to at least sort the possible commints so for the weekend I can check them, a list is coming

From them onward is just readme changes and addition of ponies, nothing touch the code.
I will check during the weekend.

@JotaRandom
Copy link
Collaborator

JotaRandom commented Oct 14, 2017

Well this look like goes beyond my initial spectatives.
I tested all from 45b53d6 to 5bcde31 instal installing using --private and all worked perfectly.
Yet using a package manager trigger the issue...

So the problem probably is on the installer ./setup.py on in how ponysay check the files based on what was told during instalation.

@Tonyl314 Tonyl314 linked a pull request Nov 10, 2023 that will close this issue
@Tonyl314
Copy link

An unmatched bracket in a pony's metadata prevented the required pickle file from being created. I made a pull request with a fix.

@matthias4217
Copy link

An unmatched bracket in a pony's metadata prevented the required pickle file from being created. I made a pull request with a fix.

Unfortunately, it doesn’t seem to solve the issue for me. I’ve cloned your repo to try it out, and ran python src/__main__.py --restrict NAME=Rarity --ponyonly and python src/__main__.py -o --restrict="coat=white". None of them gave me the expected result. But thanks for your help !

@Tonyl314
Copy link

Tonyl314 commented Nov 11, 2023

@matthias4217 I believe you have to install through setup.py first, it creates the necessary file for --restrict to work. Could you try that please?

@matthias4217
Copy link

matthias4217 commented Nov 12, 2023

Indeed, I’ve spoken too fast. It works fine. However it did work well even before your modifications. To sum up :

  • It looks like there were no issues doing manual installs (python setup.py install) or run ponysay by hand (python src/__main__.py --restrict NAME=Rarity --ponyonly). (see Edit)
  • Using the ArchLinux packages ponysay or ponysay-git wouldn’t work.
  • I’ve changed the repo in my local version of ponysay-git to have @Tonyl314 changes, and installed it (makepkg --install). It works fine !

I’m not well versed in Python packaging, or Archlinux packaging, so I’m not sure why there is this difference in behaviour between package installs and manual ones. I don’t know either how things are on other Linux distributions. I might try it later on Ubuntu. Anyway, thanks a lot for the fix !

Edit : As I had already compiled the metadata file from other tries, I didn’t realize there was an issue. Removing these metadata and retrying on 8a2c714 failed.

@Tonyl314
Copy link

I've tried it again, but the current master (without my fix) really doesn't work for me. Have you uninstalled properly via setup.py before testing? Maybe the metadata file survived at /usr/share/ponysay/ponies/metadata.

Here's what I did with the master version:

  • sudo python setup.py install --freedom=partial
  • ponysay -o --restrict NAME=Rarity (doesn't work)
  • ponysay-tool --metadata /usr/share/ponysay/ponies (this is also run during installation; it should raise an exception, a "bracket mismatch")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants