Pewarta Proxy

📋 Server Request & Proxy Logs

Loading active proxy settings...
Developed by Khairul Adha (adhexa.id)
Mengambil log server...

⚙️ Pengaturan Proxy Target

Skip to content

webbrowser module broken with Firefox 36+ #67451

Closed

Description

@ssokolow
mannequin
BPO 23262
Nosy @phdru, @ssokolow, @ezio-melotti, @lilydjwg, @berkerpeksag, @serhiy-storchaka, @wyz23x2, @Syaifulnizamshamsudin
Files
  • webbrowser.py-3.5.patch
  • webbrowser.py-3.5.patch: Regenerated for review
  • webbrowser.py-3.5-2.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2021-10-12.14:20:03.194>
    created_at = <Date 2015-01-18.04:16:56.445>
    labels = ['3.7', 'type-bug', 'library']
    title = 'webbrowser module broken with Firefox 36+'
    updated_at = <Date 2021-10-12.14:20:03.192>
    user = 'https://github.com/ssokolow'

    bugs.python.org fields:

    activity = <Date 2021-10-12.14:20:03.192>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-10-12.14:20:03.194>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)']
    creation = <Date 2015-01-18.04:16:56.445>
    creator = 'ssokolow'
    dependencies = []
    files = ['45228', '45236', '45237']
    hgrepos = []
    issue_num = 23262
    keywords = ['patch']
    message_count = 47.0
    messages = ['234218', '234248', '234256', '234284', '234285', '234289', '234290', '234291', '234292', '234293', '236529', '236727', '236737', '236826', '236838', '270554', '270555', '270556', '270563', '270565', '270566', '270567', '270569', '278340', '278341', '278346', '279381', '279384', '279390', '279392', '279399', '279400', '279403', '279407', '279491', '279492', '279529', '279541', '279544', '279545', '279735', '279766', '279767', '279989', '280130', '403574', '403731']
    nosy_count = 10.0
    nosy_names = ['phd', 'bazwal', 'ssokolow', 'ezio.melotti', 'python-dev', 'lilydjwg', 'berker.peksag', 'serhiy.storchaka', 'wyz23x2', 'Syaifulnizam']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue23262'
    versions = ['Python 3.5', 'Python 3.6', 'Python 3.7']

    Activity

    1. ssokolow commented on Jan 18, 2015

      ssokolowmannequin
      MannequinAuthor

      As of Firefox 36 (currently in beta channel), the -remote option has been removed.

      https://www.mozilla.org/en-US/firefox/36.0a2/auroranotes/
      https://www.mozilla.org/en-US/firefox/36.0beta/releasenotes/

      As such, attempting to open http://www.example.com/ using webbrowser.open() or webbrowser.open_new_tab() results in "File not Found" tabs pointing to these two URLs, respectively:

      file:///home/ssokolow/openURL%28http://www.example.com/%29
      file:///home/ssokolow/openURL%28http://www.example.com/,new-tab%29

      As I happen to have the Dead Snakes PPA set up on Lubuntu 14.04 for use with tox, I was able to confirm this as an issue in Python 2.7, 3.1, 3.2, 3.3, and 3.4.

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      type-bugAn unexpected behavior, bug, or error
      on Jan 18, 2015
    3. pitrou commented on Jan 18, 2015

      @pitrou
      Member

      What is the right way to do it then? It should also remain compatible with Firefox < 36.

    4. serhiy-storchaka commented on Jan 18, 2015

      @serhiy-storchaka
      Member
    5. ssokolow commented on Jan 18, 2015

      ssokolowmannequin
      MannequinAuthor

      The proper solution is to prefer start (Windows), open (OSX), or xdg-open (everything else... usually but not always present) when present instead of calling the browser directly.

      That way, you're using the same "delegate to the desktop's associations system and let the user's preferences control new window vs. new tab" behaviour on all OSes where it's reliably possible.

      (Yes, it would guarantee that all open* functions are equivalent, but that's already the norm in a lot of cases... especially with Firefox where one of the guiding design principles is ensuring that the user retains control of their browsing experience.)

    6. pitrou commented on Jan 18, 2015

      @pitrou
      Member

      That doesn't really answer the question. The webbrowser module is already able to use "xdg-open" (though not "open"), but it has a fallback on various concrete browsers (including Firefox) in case xdg-open doesn't work / doesn't exist.

    7. ssokolow commented on Jan 18, 2015

      ssokolowmannequin
      MannequinAuthor

      Well, then the code which chooses a backend is broken because I have xdg-open and, according to WinPdb, it's using the Mozilla backend.

      This was my local workaround:

          if os.name == 'posix' and not platform.mac_ver()[0]:
              with open(os.devnull, 'wb') as nul:
                  subprocess.Popen(['xdg-open', request_url], stdout=nul, stderr=nul)
          else:
              webbrowser.open_new_tab(request_url)

      (This retrofit branch hasn't yet reached the point where it'll be tested on Windows. I may still add another branch which calls start directly if it proves to have the same priority bug on Windows.)

    8. pitrou commented on Jan 18, 2015

      @pitrou
      Member

      Well, then the code which chooses a backend is broken because I have
      xdg-open and, according to WinPdb, it's using the Mozilla backend.

      You have xdg-open under Windows?

    9. ssokolow commented on Jan 18, 2015

      ssokolowmannequin
      MannequinAuthor
      WinPdb = Windowed Pdb, not MS Windows Pdb.

      sudo apt-get install winpdb

    10. pitrou commented on Jan 18, 2015

      @pitrou
      Member

      Oops, sorry. The best way forward would be for you to investigate and find out why xdg-open isn't preferred in your setting.

    11. ssokolow commented on Jan 18, 2015

      ssokolowmannequin
      MannequinAuthor

      Noted. I'm not sure what my schedule will be like, but I'll try.

      (I may get back to you with an answer later today or I may not within the week.)

    12. phdru commented on Feb 24, 2015

      phdrumannequin
      Mannequin

      I created the attached module to work with new FF in Python 2.7. You can convert it to proper patch for webbrowser.py.

    13. bazwal commented on Feb 27, 2015

      bazwalmannequin
      Mannequin

      I arrived at an almost identical solution to the one given by Oleg. It works for me with FF 28, 35 & 36 - but presumably there are earlier versions where it does not, otherise why have the -remote option at all?

      The gist of the Mozilla bug report is that the option has existed for a very long time, but there are now other command-line options that do exactly the same thing. So the only question seems to be whether Python should still support those older versions of FF that actually require it (if any exist).

      On the xdg-open issue: the $BROWSER env var has priority over the default list of browsers to try, so that might explain why xdg-open is not being used on some systems (that is how I originally became aware of this problem).

    14. serhiy-storchaka commented on Feb 27, 2015

      @serhiy-storchaka
      Member

      --new-window and --new-tab are Firefox and SeaMonkey2.x only. [1] So this will break the support of IceApe on Debian Etch (iceape v.1.0.13 [2]).

      [1] https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options
      [2] http://archive.debian.net/etch/devel/iceape

    15. 24 remaining items

    16. serhiy-storchaka commented on Oct 27, 2016

      @serhiy-storchaka
      Member

      The problem is that this class is used for Netscape and old Mozilla browsers. What if rename old Mozilla class to Netscape and use it for old browsers?

    17. phdru commented on Oct 27, 2016

      phdrumannequin
      Mannequin

      I'd rather rename the new class to something like Firefox. So there will be 3 classes — Netscape, Mozilla and Firefox. Firefox only for firefox executable.

    18. serhiy-storchaka commented on Oct 27, 2016

      @serhiy-storchaka
      Member

      Currently Netscape is just an alias to Mozilla. Since SeaMonkey is synchronized with Firefox, I suppose it dropped the support of the -remote option at the same time. Debian rebranded Firefox and SeaMonkey at 2006, therefore IceWeasel and IceApe always supported -new-win and -new-tab options. The last IceWeasel version was 38, it didn't supported the -remote option.

    19. phdru commented on Oct 27, 2016

      phdrumannequin
      Mannequin

      Then I don't have any objections. But I also couldn't test the change — I only use Firefox (and sometimes Chrome).

    20. python-dev commented on Oct 30, 2016

      python-devmannequin
      Mannequin

      New changeset dacb52577c1c by Serhiy Storchaka in branch '3.5':
      Issue bpo-23262: The webbrowser module now supports Firefox 36+ and derived
      https://hg.python.org/cpython/rev/dacb52577c1c

      New changeset f1abc92a756a by Serhiy Storchaka in branch '3.6':

      New changeset cade42bd0ee0 by Serhiy Storchaka in branch 'default':
      Issue bpo-23262: The webbrowser module now supports Firefox 36+ and derived
      https://hg.python.org/cpython/rev/cade42bd0ee0

    21. serhiy-storchaka commented on Oct 31, 2016

      @serhiy-storchaka
      Member

      What to do with 2.7? We can just backport the patch from 3.5, but also can use the version check from earlier Oleg's patches. 2.7 was released long time ago and still can be used on systems with old browsers (however it is very unlikely that Python is updated, but browsers are not).

    22. phdru commented on Oct 31, 2016

      phdrumannequin
      Mannequin

      Let's me disagree because Python 2.7 is a very special case. One can easily update a browser — they are perfectly compatible. But one cannot just update Python 2.7 because Python 3 is rather a different language that requires a lot of porting effort. So I can imagine Python 2.7 with new browser on the same computer.

    23. serhiy-storchaka commented on Nov 3, 2016

      @serhiy-storchaka
      Member

      I don't understand with what you disagree. I can imagine old Python 2.7 with old browser, old Python 2.7 with new browser, new Python 2.7 with new browser, and even new Python 2.7 with old browser on the same computer (but the latter is very unlikely).

      Old Python 2.7 don't work with new browser and we can't do anything with this. We can make new Python 2.7.12 working with new browser. But I'm not sure that we can break the compatibility with old browser that could be installed when Python 2.7 was first installed on the same computer.

    24. phdru commented on Nov 6, 2016

      phdrumannequin
      Mannequin

      I'm not sure that we can break the compatibility with old browser

      I agree with this.

    25. removed their assignment
      on Dec 16, 2016
    26. Syaifulnizamshamsudin commented on Oct 10, 2021

      Syaifulnizamshamsudinmannequin
      Mannequin

      Processo webbrowser.3.5-2.patch

    27. wyz23x2 commented on Oct 12, 2021

      wyz23x2mannequin
      Mannequin

      I think this six year old issue can be closed. All patches for 3.x are committed, and Python 2.7 is EOL.

    28. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.7 (EOL)end of lifestdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions