Re: Chromedriver does not launch from python 3.9 script

2024-01-20 Thread Marco Atzeri via Cygwin

On 20/01/2024 21:26, James via Cygwin wrote:

Latest version of Cygwin installed and updated.

I'm trying to run this python script which uses chromium in order to execute.

I got it all installed, and I'm just now trying to run the script and login, 
but it keeps saying it cannot find the chromedriver.exe.

But the file exists and I know it's looking in the right place because I pasted 
the linux version in the same spot and renamed it to chromedriver.exe and it 
gave me an error about running a 16 bit program. I also dropped in the latest 
version from the google archive for chromedriver.exe and when I ran the script, 
it said the new version was not compatible with my current version, so I know 
for a fact it is reading the file.

So why is it telling me it doesn't exist?

But, this works:

$ pip show selenium
Name: selenium
Version: 4.16.0
Summary:
Home-page: https://www.selenium.dev
Author:
Author-email:
License: Apache 2.0
Location: /home/User/Teachable-Dl/env/lib/python3.9/site-packages
Requires: certifi, trio, trio-websocket, urllib3
Required-by: seleniumbase

In any case, here is the error I get when I try to run the script:

User@User-PC ~/Teachable-Dl
$ python3 main.py --url https://courseurl.com/courses/enrolled/869509 
--man_login_url https://sso.teachable.com/secure/1096/identity/login/password 
--verbose
Traceback (most recent call last):
File 
"/home/User/Teachable-Dl/env/lib/python3.9/site-packages/seleniumbase/core/browser_launcher.py",
 line 2963, in get_local_driver

...

FileNotFoundError: [Errno 2] No such file or directory: 
'C:\\Users\\User\\.cache\\selenium\\chromedriver\\win64\\109.0.5414.74\\chromedriver.exe'
(env)



have you tried replacing with a POSIX path ?
https://cygwin.com/cygwin-ug-net/using.html#using-pathnames

To have it use cygpath

$ cygpath -u 
"C:\\Users\\User\\.cache\\selenium\\chromedriver\\win64\\109.0.5414.74\\chromedriver.exe"

/cygdrive/c/Users/User/.cache/selenium/chromedriver/win64/109.0.5414.74/chromedriver.exe



Now if I directly run that path:

cygstart 
"C:\\Users\\User\\.cache\\selenium\\chromedriver\\win64\\109.0.5414.74\\chromedriver.exe"

It runs same as clicking on it, so the file exists and the path is right. The popup window is a 
command window which starts with "Starting ChromeDriver 109" and the last line is 
"ChromeDriver was started successfully"

But the same file is saying doesn't exist when I try to run the script.

I also pasted the chromedriver.exe file into /env/bin/ folder in the working 
directory, but it still says doesn't exist, yet now it says the file at the new 
correct path doesn't exist, so in other words it detected and found it at the 
new location but still is saying it didn't exist but it does.

Also, if I delete the folder at that path and then run the script again, it 
still fails but it also creates the directory at that path and puts the 
chromedriver.exe in the directory - that means it literally put the file there 
itself but it's saying that it isn't found.



The Cygwin DLL and some programs like cygstart can handle the Windows 
PATH style, but most of the applications don't, so use POSIX


Regards
Marco


--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Chromedriver does not launch from python 3.9 script

2024-01-20 Thread James via Cygwin
Latest version of Cygwin installed and updated.

I'm trying to run this python script which uses chromium in order to execute.

I got it all installed, and I'm just now trying to run the script and login, 
but it keeps saying it cannot find the chromedriver.exe.

But the file exists and I know it's looking in the right place because I pasted 
the linux version in the same spot and renamed it to chromedriver.exe and it 
gave me an error about running a 16 bit program. I also dropped in the latest 
version from the google archive for chromedriver.exe and when I ran the script, 
it said the new version was not compatible with my current version, so I know 
for a fact it is reading the file.

So why is it telling me it doesn't exist?

But, this works:

$ pip show selenium
Name: selenium
Version: 4.16.0
Summary:
Home-page: https://www.selenium.dev
Author:
Author-email:
License: Apache 2.0
Location: /home/User/Teachable-Dl/env/lib/python3.9/site-packages
Requires: certifi, trio, trio-websocket, urllib3
Required-by: seleniumbase

In any case, here is the error I get when I try to run the script:

User@User-PC ~/Teachable-Dl
$ python3 main.py --url https://courseurl.com/courses/enrolled/869509 
--man_login_url https://sso.teachable.com/secure/1096/identity/login/password 
--verbose
Traceback (most recent call last):
File 
"/home/User/Teachable-Dl/env/lib/python3.9/site-packages/seleniumbase/core/browser_launcher.py",
 line 2963, in get_local_driver
if os.path.exists(LOCAL_CHROMEDRIVER):
File "/usr/lib/python3.9/genericpath.py", line 19, in exists
os.stat(path)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not 
NoneType

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/User/Teachable-Dl/main.py", line 789, in 
downloader = TeachableDownloader(verbose_arg=verbose, 
complete_lecture_arg=args.complete_lecture,
File "/home/User/Teachable-Dl/main.py", line 52, in __init__
self.driver = Driver(uc=True, headed=True)
File 
"/home/User/Teachable-Dl/env/lib/python3.9/site-packages/seleniumbase/plugins/driver_manager.py",
 line 488, in Driver
driver = browser_launcher.get_driver(
File 
"/home/User/Teachable-Dl/env/lib/python3.9/site-packages/seleniumbase/core/browser_launcher.py",
 line 1591, in get_driver
return get_local_driver(
File 
"/home/User/Teachable-Dl/env/lib/python3.9/site-packages/seleniumbase/core/browser_launcher.py",
 line 3839, in get_local_driver
driver = webdriver.Chrome(service=service)
File 
"/home/User/Teachable-Dl/env/lib/python3.9/site-packages/selenium/webdriver/chrome/webdriver.py",
 line 45, in __init__
super().__init__(
File 
"/home/User/Teachable-Dl/env/lib/python3.9/site-packages/selenium/webdriver/chromium/webdriver.py",
 line 50, in __init__
self.service.start()
File 
"/home/User/Teachable-Dl/env/lib/python3.9/site-packages/selenium/webdriver/common/service.py",
 line 98, in start
self._start_process(self._path)
File 
"/home/User/Teachable-Dl/env/lib/python3.9/site-packages/selenium/webdriver/common/service.py",
 line 208, in _start_process
self.process = subprocess.Popen(
File "/usr/lib/python3.9/subprocess.py", line 951, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 
'C:\\Users\\User\\.cache\\selenium\\chromedriver\\win64\\109.0.5414.74\\chromedriver.exe'
(env)

Now if I directly run that path:

cygstart 
"C:\\Users\\User\\.cache\\selenium\\chromedriver\\win64\\109.0.5414.74\\chromedriver.exe"

It runs same as clicking on it, so the file exists and the path is right. The 
popup window is a command window which starts with "Starting ChromeDriver 
109" and the last line is "ChromeDriver was started successfully"

But the same file is saying doesn't exist when I try to run the script.

I also pasted the chromedriver.exe file into /env/bin/ folder in the working 
directory, but it still says doesn't exist, yet now it says the file at the new 
correct path doesn't exist, so in other words it detected and found it at the 
new location but still is saying it didn't exist but it does.

Also, if I delete the folder at that path and then run the script again, it 
still fails but it also creates the directory at that path and puts the 
chromedriver.exe in the directory - that means it literally put the file there 
itself but it's saying that it isn't found.

-- 
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Re: Cygwin/X - Query: why invoking from cmd backgrounds?

2024-01-20 Thread Jon Turney via Cygwin

On 20/01/2024 08:55, Shaddy Baddah via Cygwin wrote:

Hi,

I am just wondering if anyone understands why XWin detaches/runs in
the background, when launched from Windows Command Prompt.


I assume this is due to XWin being marked as a GUI, not console 
application (to stop it popping up a useless console window when run 
directly e.g. via explorer or a shortcut).



This being different to when run from Mintty.

Here's what happens with my Mintty invocation, which stays in the

[...]


Is this special detection and handling in the main() (or whatever
entrypoint is applicable)?


This is something cmd (and powershell) does. I don't know the mechanism.

I think you can make cmd wait with 'start /w'.  Or maybe making the 
command part of a pipeline...



--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Re: Cygwin/X - Query: why invoking from cmd backgrounds?

2024-01-20 Thread Marco Atzeri via Cygwin

On 20/01/2024 09:55, Shaddy Baddah via Cygwin wrote:

Hi,

I am just wondering if anyone understands why XWin detaches/runs in
the background, when launched from Windows Command Prompt.


Hi Shaddy,
Only a guess


But here's what happens when I run that first command line from
Windows Command Prompt. No output and the command returns, though the
server is running (including with an icon tray clickable):

| C:\Users\shaddy>C:\PublicData\sw.portapps\cygwin.x86_64\bin\XWin :1 
-nolisten tcp -ac -multiwindow

|
| C:\Users\shaddy>

Is this special detection and handling in the main() (or whatever
entrypoint is applicable)?


I assume you still have the log on /var/log/xwin/XWin.0.log
but it is not anymore duplicated on the terminal



Regards,
Shaddy


Marco


--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Re: Possiblly bug of cygwin1.dll

2024-01-20 Thread ASSI via Cygwin
Takashi Yano via Cygwin writes:
>> So what happens if you undefine __GTHREAD_MUTEX_INIT?
>
> I have tried. The test case:

…and then rebuild libstdc++ of course.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptation for Waldorf Blofeld V1.15B11:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada

-- 
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Re: Possiblly bug of cygwin1.dll

2024-01-20 Thread Takashi Yano via Cygwin
On Sat, 20 Jan 2024 10:13:22 +0100
ASSI wrote:
> Takashi Yano via Cygwin writes:
> > I might find the culprit in gcc's libstdc++ code such as:
> > libstdc++-v3/include/ext/concurrentce.h:
> >   class __mutex
> >   {
> >   private:
> > #if __GTHREADS && defined __GTHREAD_MUTEX_INIT
> > __gthread_mutex_t _M_mutex = __GTHREAD_MUTEX_INIT;
> > #else
> > __gthread_mutex_t _M_mutex;
> > #endif
> >
> > __GTHREAD_MUTEX_INIT here is PTHREAD_MUTEX_INITIALIZER and
> > __gthread_mutex_t is pthread_mutex_t.
> >
> > I think this code vaiolates the POSIX statement.
> 
> So what happens if you undefine __GTHREAD_MUTEX_INIT?

I have tried. The test case:
#include 
int main()
{
  for (;;) {
std::mutex *m = new std::mutex;
m->lock();
m->unlock();
delete m;
  }
  return 0;
}
gets working fine. However, this test case:
#include 
int func() { return 0; }
int main()
{
  for (;;) {
std::future f = std::async(std::launch::async, func);
f.get();
  }
  return 0;
}
still has the problem.

pthread_mutex_t might be initialized also at another place...


-- 
Takashi Yano 

-- 
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Re: Possiblly bug of cygwin1.dll

2024-01-20 Thread ASSI via Cygwin
Takashi Yano via Cygwin writes:
> I might find the culprit in gcc's libstdc++ code such as:
> libstdc++-v3/include/ext/concurrentce.h:
>   class __mutex
>   {
>   private:
> #if __GTHREADS && defined __GTHREAD_MUTEX_INIT
> __gthread_mutex_t _M_mutex = __GTHREAD_MUTEX_INIT;
> #else
> __gthread_mutex_t _M_mutex;
> #endif
>
> __GTHREAD_MUTEX_INIT here is PTHREAD_MUTEX_INITIALIZER and
> __gthread_mutex_t is pthread_mutex_t.
>
> I think this code vaiolates the POSIX statement.

So what happens if you undefine __GTHREAD_MUTEX_INIT?


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptations for KORG EX-800 and Poly-800MkII V0.9:
http://Synth.Stromeko.net/Downloads.html#KorgSDada

-- 
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Cygwin/X - Query: why invoking from cmd backgrounds?

2024-01-20 Thread Shaddy Baddah via Cygwin

Hi,

I am just wondering if anyone understands why XWin detaches/runs in
the background, when launched from Windows Command Prompt.

This being different to when run from Mintty.

Here's what happens with my Mintty invocation, which stays in the
foreground:

| $ XWin  :1 -nolisten tcp -ac -multiwindow
| Welcome to the XWin X Server
| Vendor: The Cygwin/X Project
| Release: 1.21.1.9
| OS: CYGWIN_NT-10.0-19045 pc-w10 3.4.10-1.x86_64 2023-11-29 12:12 UTC x86_64
| OS: Windows 10  [Windows NT 10.0 build 19045] x64
| Package: version 21.1.9-1 built 2023-12-10
|
| XWin was started with the following command line:
|
| XWin :1 -nolisten tcp -ac -multiwindow
|
| (II) xorg.conf is not supported
| (II) See http://x.cygwin.com/docs/faq/cygwin-x-faq.html for more information
| winUpdateDpi - primary monitor native DPI x 96 y 96
...
| winClipboardProc - xcb_connect () returned and successfully opened the 
display.


Here's what happens if I invoke tigervnc-server from Windows Command
Prompt, where it stays in the forgeground and I can terminate with
Ctrl-C:

| C:\Users\shaddy>C:\PublicData\sw.portapps\cygwin.x86_64\bin\Xvnc  :2 
-nolisten tcp -ac -geometry 900x600 -SecurityTypes=None
|
| Xvnc TigerVNC 1.8.0 - built Dec 30 2017 22:15:31
| Copyright (C) 1999-2017 TigerVNC Team and many others (see README.txt)
| See http://www.tigervnc.org for information on TigerVNC.
| Underlying X server release 11906000, The X.Org Foundation
|
|
| Sat Jan 20 19:34:43 2024
|  vncext:  VNC extension running!
|  vncext:  Listening for VNC connections on all interface(s), port 5902
|  vncext:  created VNC server for screen 0
| MIT-SHM extension disabled due to lack of kernel support

But here's what happens when I run that first command line from
Windows Command Prompt. No output and the command returns, though the
server is running (including with an icon tray clickable):

| C:\Users\shaddy>C:\PublicData\sw.portapps\cygwin.x86_64\bin\XWin :1 -nolisten 
tcp -ac -multiwindow
|
| C:\Users\shaddy>

Is this special detection and handling in the main() (or whatever
entrypoint is applicable)?

--
Regards,
Shaddy


--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple