[issue41945] http.cookies.SimpleCookie.parse error after [keys] or some JSON data values

2022-01-04 Thread Jan Novak
Jan Novak added the comment: New examples with the structured data. Problems are with quotes and spaces inside { or [ cookie-script.com set those cookie data: CookieScriptConsent={"action":"accept","categories":"[\\"performance\\"]"} Py

[issue34931] os.path.splitext with more dots

2022-01-03 Thread Jan Novak
Jan Novak added the comment: It is interesting that pathlib.Path works fine: >>> pathlib.Path('jpg').suffix '.jpg' >>> pathlib.Path('path/jpg').suffix '.jpg' -- ___ Python tracker <https://bugs.

[issue34931] os.path.splitext with more dots

2022-01-03 Thread Jan Novak
Jan Novak added the comment: Thank you all for discussion and partial solution in latest Python versions and extending documentation. For the future development of Python the initial question remains. How to easy detect extensions for each file with standard python library function. Without

[issue41945] http.cookies.SimpleCookie.parse error after [keys]

2020-11-05 Thread Jan Novak
Jan Novak added the comment: Possible patch, load parts one by one: http_cookie = 'id=12345; [object Object]=data; something=not_loaded' for cookie_key in http_cookie.split(';'): c.load(cookie_key) print c Set-Cookie: id=12345 Set-Cookie: something=not_loaded

[issue41945] http.cookies.SimpleCookie.parse error after [keys]

2020-10-05 Thread Jan Novak
New submission from Jan Novak : If brackets [] are around cookie name, next cookie names are not loaded. try: import http.cookies as Cookie except ImportError: import Cookie c = Cookie.SimpleCookie() c.load('id=12345; [object Object]=data; something=not loaded') print(c) Note: It could

[issue34931] os.path.splitext with more dots

2018-10-29 Thread Jan Novak
Jan Novak added the comment: Yes, dot behaviour is well documented. But splitext() is a function to split name and extension, not take care about hidden files. Hidden files starting with dot is Unix like system feature. https://en.wikipedia.org/wiki/Hidden_file_and_hidden_directory Hidden

[issue34931] os.path.splitext with more dots

2018-10-08 Thread Jan Novak
New submission from Jan Novak : There are some old tickets about changing splitext() in 2007: https://bugs.python.org/issue1115886 https://bugs.python.org/issue1681842 Present python documentation: Leading periods on the basename are ignored; splitext('.cshrc') returns ('.cshrc', ''). Changed

[issue1379416] email.Header encode() unicode P2.6

2009-03-23 Thread Jan Novak
Jan Novak xnov...@users.sourceforge.net added the comment: I made some new tests in P2.6.1 import email.charset c=email.charset.Charset('utf-8') print c.input_charset, type(c.input_charset) utf-8 type 'unicode' print c.output_charset, type(c.output_charset) utf-8 type 'str' but c