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

AttributeError: 'Sources' object has no attribute 'APT_FILE' #77

Open
wolph opened this issue Sep 18, 2019 · 2 comments
Open

AttributeError: 'Sources' object has no attribute 'APT_FILE' #77

wolph opened this issue Sep 18, 2019 · 2 comments

Comments

@wolph
Copy link

wolph commented Sep 18, 2019

After running apt-select to get a mirror I get the following error (full log of my actions):

# apt-select --country NL -t 25 --choose
Getting list of mirrors...done.
Testing latency to mirror(s)
[24/24] 100%
Getting list of launchpad URLs...done.
Looking up 24 status(es)
[15/24] 62%
1. mirror.nl.leaseweb.net
    Latency: 12.88 ms
    Org:     LeaseWeb B.V.
    Status:  Up to date
    Speed:   4 Gbps
2. nl3.archive.ubuntu.com
    Latency: 13.04 ms
    Org:     PCextreme B.V.
    Status:  Up to date
    Speed:   2 Gbps
3. ftp.snt.utwente.nl
    Latency: 13.90 ms
    Org:     University of Twente, The Netherlands
    Status:  Up to date
    Speed:   10 Gbps
4. mirrors.xtom.nl
    Latency: 14.35 ms
    Org:     xTom
    Status:  Up to date
    Speed:   10 Gbps
5. nl.archive.ubuntu.com (current)
    Latency: 15.14 ms
    Org:     BIT B.V.
    Status:  Up to date
    Speed:   10 Gbps
6. mirror.nl.datapacket.com
    Latency: 15.86 ms
    Org:     datapacket.com
    Status:  Up to date
    Speed:   20 Gbps
7. ubuntu.mirror.true.nl
    Latency: 16.89 ms
    Org:     True BV
    Status:  Up to date
    Speed:   1 Gbps
8. mirror.1000mbps.com
    Latency: 17.45 ms
    Org:     1000Mbps.com
    Status:  Up to date
    Speed:   10 Gbps
9. mirror.nforce.com
    Latency: 17.46 ms
    Org:     NFOrce Entertainment B.V.
    Status:  Up to date
    Speed:   10 Gbps
10. mirror.dataone.nl
    Latency: 17.55 ms
    Org:     Dataone Datacenters
    Status:  Up to date
    Speed:   4 Gbps
11. mirror.transip.net
    Latency: 17.57 ms
    Org:     TransIP B.V.
    Status:  Up to date
    Speed:   4 Gbps
12. mirror.serverius.net
    Latency: 18.71 ms
    Org:     Serverius
    Status:  Up to date
    Speed:   10 Gbps
13. mirror.amsiohosting.net
    Latency: 18.77 ms
    Org:     Amsio B.V.
    Status:  Up to date
    Speed:   2 Gbps
14. mirror.previder.nl
    Latency: 19.31 ms
    Org:     Previder B.V.
    Status:  Up to date
    Speed:   1 Gbps
15. mirror.i3d.net
    Latency: 21.29 ms
    Org:     i3D.net
    Status:  Up to date
    Speed:   10 Gbps
Choose a mirror (1 - 15)
'q' to quit 3
Selecting mirror http://ftp.snt.utwente.nl/pub/os/linux/ubuntu/ ...
Traceback (most recent call last):
  File "/usr/local/bin/apt-select", line 10, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/dist-packages/apt_select/__main__.py", line 245, in main
    apt_select()
  File "/usr/local/lib/python3.6/dist-packages/apt_select/__main__.py", line 227, in apt_select
    'apt': sources.APT_FILE
AttributeError: 'Sources' object has no attribute 'APT_FILE'
@jblakeman
Copy link
Owner

Yeah, this the less common path where it tries to warn you if your current working directory is /etc/apt because generating a new sources.list file would overwrite the existing file. Running the script from a different working directory should avoid the error. Must have been introduced in a previous refactor, and wasn't caught because 1. there are no unittests 2. I have not manually tested this non-critical path for a while. Code fix is pretty clear. Would welcome a pull request or will try to find some time to fix and release with #76

@wolph
Copy link
Author

wolph commented Sep 18, 2019

Easy enough to work around in that case :)

I don't expect to be able to create a pull request any time soon but I'm not ruling it out. I still have quite a few issues of my own to solve as well: https://github.com/issues?utf8=%E2%9C%93&q=is%3Aopen+user%3AWoLpH

MatthijsBurgh added a commit to MatthijsBurgh/apt-select that referenced this issue Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants