[issue43424] Document the `controller.name` field in `webbrowser` module

2021-12-29 Thread Ilya Grigoriev


Ilya Grigoriev  added the comment:

Thank you very much, Nikita! Your patch would certainly solve my issue.

As is, I checked the code I wrote, and it seems that only a lucky
ordering of if-statements caused it to work on Macs.

Ilya.

On Wed, Dec 29, 2021 at 5:30 PM Dong-hee Na  wrote:
>
>
> Dong-hee Na  added the comment:
>
>
> New changeset d12bec69931503be78cd555cf7bc22ad6f4f2bd5 by Nikita Sobolev in 
> branch 'main':
> bpo-43424: Deprecate `webbrowser.MacOSXOSAScript._name` attribute (GH-30241)
> https://github.com/python/cpython/commit/d12bec69931503be78cd555cf7bc22ad6f4f2bd5
>
>
> --
> nosy: +corona10
>
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43424] Document the `controller.name` field in `webbrowser` module

2021-12-29 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset d12bec69931503be78cd555cf7bc22ad6f4f2bd5 by Nikita Sobolev in 
branch 'main':
bpo-43424: Deprecate `webbrowser.MacOSXOSAScript._name` attribute (GH-30241)
https://github.com/python/cpython/commit/d12bec69931503be78cd555cf7bc22ad6f4f2bd5


--
nosy: +corona10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43424] Document the `controller.name` field in `webbrowser` module

2021-12-23 Thread Alex Waygood


Change by Alex Waygood :


--
type: security -> enhancement
versions: +Python 3.11 -Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43424] Document the `controller.name` field in `webbrowser` module

2021-12-23 Thread Nikita Sobolev


Change by Nikita Sobolev :


--
pull_requests: +28463
pull_request: https://github.com/python/cpython/pull/30241

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43424] Document the `controller.name` field in `webbrowser` module

2021-12-23 Thread Nikita Sobolev


Nikita Sobolev  added the comment:

Hm, looks like `.name` does not exist for `MacOSXOSAScript`:

```
Python 3.11.0a3+ (heads/main-dirty:71ef0b4c2b, Dec 23 2021, 12:38:09) [Clang 
11.0.0 (clang-1100.0.33.16)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import webbrowser
>>> webbrowser.get()

>>> a = webbrowser.get()
>>> dir(a)
['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', 
'__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', 
'__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', 
'__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', 
'__str__', '__subclasshook__', '__weakref__', '_name', 'args', 'open', 
'open_new', 'open_new_tab']
>>> a.name
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'MacOSXOSAScript' object has no attribute 'name'. Did you mean: 
'_name'?
```

This happens because `MacOSXOSAScript` does not call `super().__init__()` in 
any way, nor it defines `name` and `basename` attributes.

It has this API for 12 years now: 
https://github.com/python/cpython/commit/4d39f6e09a5c0a0e09eb51d678bacd1adaa3f2ca

So, I see two possible ways to solve this:
1. Ensure all subtypes of `BaseBrowser` to have `name` and `basename` (because 
they are defined in `BaseBrowser`) and document them
2. Add a code comment that they are just implementation details and not a part 
of the public API

--
nosy: +sobolevn

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43424] Document the `controller.name` field in `webbrowser` module

2021-12-21 Thread Zachary Ware


Change by Zachary Ware :


--
hgrepos:  -413

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43424] Document the `controller.name` field in `webbrowser` module

2021-12-21 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Zach, gaurawgoshwami is a spammer. Deleted added nosy, unlinked spam file and 
unrelated PR.  I have no idea what 'repository containing patch' means or how 
g. created link to non-existent? file.

--
nosy:  -asvetlov, barry, dstufft, eric.araujo, ezio.melotti, gaurawgoshwami, 
koobs, lys.nikolaou, mrabarnett, ned.deily, pablogsal, paul.moore, 
r.david.murray, ronaldoussoren, steve.dower, tim.golden, vstinner, yselivanov

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43424] Document the `controller.name` field in `webbrowser` module

2021-12-21 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests:  -28440

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43424] Document the `controller.name` field in `webbrowser` module

2021-12-21 Thread Terry J. Reedy


Change by Terry J. Reedy :


Removed file: https://bugs.python.org/file50506/images (5).jpeg

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43424] Document the `controller.name` field in `webbrowser` module

2021-12-21 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
Removed message: https://bugs.python.org/msg408987

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43424] Document the `controller.name` field in `webbrowser` module

2021-12-21 Thread Alex Willmer


Change by Alex Willmer :


--
nosy:  -Alex.Willmer

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43424] Document the `controller.name` field in `webbrowser` module

2021-12-20 Thread Larry Hastings


Change by Larry Hastings :


--
components: +Documentation
nosy:  -larry

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43424] Document the `controller.name` field in `webbrowser` module

2021-12-20 Thread Larry Hastings


Change by Larry Hastings :


--
components: +Library (Lib) -Argument Clinic

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43424] Document the `controller.name` field in `webbrowser` module

2021-12-20 Thread Larry Hastings


Change by Larry Hastings :


--
components:  -2to3 (2.x to 3.x conversion tool), Build, C API, Cross-Build, 
Demos and Tools, Distutils, Documentation, Extension Modules, FreeBSD, IDLE, 
IO, Installation, Interpreter Core, Library (Lib), Parser, Regular Expressions, 
SSL, Subinterpreters, Tests, Tkinter, Unicode, Windows, XML, asyncio, ctypes, 
email, macOS

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43424] Document the `controller.name` field in `webbrowser` module

2021-12-20 Thread Filmy Talkies 24*7

Filmy Talkies 24*7  added the comment:

अब आप जीत सकते है 1 करोड़ रुपये 
oaya

--
components: +2to3 (2.x to 3.x conversion tool), Argument Clinic, Build, C API, 
Cross-Build, Demos and Tools, Distutils, Extension Modules, FreeBSD, IDLE, IO, 
Installation, Interpreter Core, Parser, Regular Expressions, SSL, 
Subinterpreters, Tests, Tkinter, Unicode, Windows, XML, asyncio, ctypes, email, 
macOS
hgrepos: +413
keywords: +patch
message_count: 1.0 -> 2.0
nosy: +Alex.Willmer, asvetlov, barry, dstufft, eric.araujo, ezio.melotti, 
gaurawgoshwami, koobs, larry, lys.nikolaou, mrabarnett, ned.deily, pablogsal, 
paul.moore, r.david.murray, ronaldoussoren, steve.dower, terry.reedy, 
tim.golden, vstinner, yselivanov, zach.ware
nosy_count: 2.0 -> 24.0
pull_requests: +28440
stage:  -> patch review
type: enhancement -> security
pull_request: https://github.com/python/cpython/pull/544
Added file: https://bugs.python.org/file50506/images (5).jpeg

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43424] Document the `controller.name` field in `webbrowser` module

2021-03-06 Thread Ilya Grigoriev


New submission from Ilya Grigoriev :

The object `webbrowser.get()` returns has, and had for a long time, a useful 
but undocumented field `name`. I wonder if it would be OK to document it as 
something like `a system-dependent name for the browser`. This would go here:

https://docs.python.org/3/library/webbrowser.html#browser-controller-objects

The reason I'd like this is so that I can write code like the following:

```python
# In Crostini Chrome OS Linux, the default browser is set to an
# intermediary called `garcon-url-handler`.
# It opens URLs in Chrome running outside the linux VM. This 
# browser does not have access to the Linux filesystem. Some references:
# 
https://chromium.googlesource.com/chromiumos/platform2/+/master/vm_tools/garcon/#opening-urls
# https://source.chromium.org/search?q=garcon-url-handler

if "garcon-url-handler" in webbrowser.get().name:
  webbrowser.open("http://external-url.com/docs.html;)
else:
  webbrowser.open("file:///usr/share/doc/docs.html")
```

This would work correctly, even if the user has installed a browser native to 
the Linux VM and put it into their `BROWSER` environment variable. I don't know 
a better way to achieve the same effect.

Some references to where the `name` field was introduced:

https://bugs.python.org/issue754022

https://github.com/python/cpython/commit/e8f244305ef4f257f6999b69601f4316b31faa5e

--
assignee: docs@python
components: Documentation, Library (Lib)
messages: 388218
nosy: docs@python, ilyagr
priority: normal
severity: normal
status: open
title: Document the `controller.name` field in `webbrowser` module
type: enhancement
versions: Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com