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

Maybe not working on 3.12 #79

Open
wastemans opened this issue Oct 25, 2023 · 6 comments
Open

Maybe not working on 3.12 #79

wastemans opened this issue Oct 25, 2023 · 6 comments

Comments

@wastemans
Copy link

Hi "J",

I've read you're not working on this anymore, but I do, and I just had an issue with it that I fixed without knowing any python.

It was this error:

$ dotfiles -l                                                                                                                                                                                                                                            
Traceback (most recent call last):                                                                                                                                                                                                                                       
  File "/home/MYUSERNAME/projects/vpy/bin/dotfiles", line 8, in <module>                                                                                                                                                                                                          
    sys.exit(main())
             ^^^^^^
  File "/home/MYUSERNAME/projects/vpy/lib/python3.12/site-packages/dotfiles/cli.py", line 224, in main
    config_opts = parse_config(cli_opts.config_file or '~/%s' % CONFIG_FILE)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/MYUSERNAME/projects/vpy/lib/python3.12/site-packages/dotfiles/cli.py", line 150, in parse_config
    parser = configparser.SafeConfigParser()
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'configparser' has no attribute 'SafeConfigParser'. Did you mean: 'RawConfigParser'?

So I changed line 150
from:
parser = configparser.SafeConfigParser()
to:
parser = configparser.RawConfigParser()

Seemed to make it work again.

If you're not going to work on this would you or anyone else know what I might migrate to?
I love having the change register on github for this kinda stuff and I've made this project my main home folder backup everywhere!

Cheers

@jbernard
Copy link
Owner

jbernard commented Nov 1, 2023 via email

@wastemans
Copy link
Author

Yes mate, using just 'ConfigParser' also works :-)

jbernard added a commit that referenced this issue Nov 1, 2023
SafeConfigParser was deprecated in Python 3.2 and was recently removed.
The documentation recommends using ConfigParser instead.

Fixes #79
@jbernard
Copy link
Owner

jbernard commented Nov 3, 2023

I uploaded version 0.6.5 to test.pypi.org, can you give that a try? If all is good I'll upload to pypi. Thanks!

This command should do the trick:

$ python3 -m pip install --index-url https://test.pypi.org/simple/ --no-deps dotfiles==0.6.5

@wastemans
Copy link
Author

Yes that worked, 'dotfiles -l' afterwards doesn't crash.

@txoof
Copy link

txoof commented Mar 17, 2024

Found this super helpful! Thanks to you both!

I'm not sure why, but only 0.6.4 shows up on PyPi when searched though the provided pip install below does work.

$ python3 -m pip install --index-url https://test.pypi.org/simple/ --no-deps dotfiles==0.6.5

Is there an alternative either of you have found that does the same basic job? I love what dotfiles does; it makes spinning up environments super easy and consistent. I've worked dotfiles into several ansible jobs that I use for preparing test environments and I adore the functionality!

@wastemans
Copy link
Author

I don't think he uploaded the change to pypi.
I've had to manually make the edit on every new install of dotfiles.
I think he's made the change to github.com only.

You can just edit line 150 dotfiles/cli.py as above.

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

No branches or pull requests

3 participants