Skip to content

Opening example with .pde file extension fails silently #2377

Closed
@per1234

Description

@per1234

Describe the problem

If the example for a library has .pde file extension, Arduino IDE will silently fail to open it.

To reproduce

  1. Use Library Manager to install version "1.64.0" of the "AccelStepper" library from Library Manager
  2. Select File > Examples > AccelStepper > AFMotor_ConstantSpeed

🐛 The example doesn't open. There is no communication of a problem.

Expected behavior

Arduino IDE opens all valid example sketches, regardless of whether they use a deprecated file extension.

Arduino IDE version

2.3.2

Operating system

Windows

Operating system version

11

Additional context

I see the following in the logs when I try to open the example:

2024-02-20T12:47:15.376Z root ERROR Request cloneExample failed with error: ENOENT: no such file or directory, rename 'C:\Users\per\AppData\Local\Temp\.arduinoIDE-unsaved2024120-60044-18wn560.m01l\AFMotor_ConstantSpeed\AFMotor_ConstantSpeed.ino' -> 'C:\Users\per\AppData\Local\Temp\.arduinoIDE-unsaved2024120-60044-18wn560.m01l\AFMotor_ConstantSpeed\AFMotor_ConstantSpeed.ino' Error: ENOENT: no such file or directory, rename 'C:\Users\per\AppData\Local\Temp\.arduinoIDE-unsaved2024120-60044-18wn560.m01l\AFMotor_ConstantSpeed\AFMotor_ConstantSpeed.ino' -> 'C:\Users\per\AppData\Local\Temp\.arduinoIDE-unsaved2024120-60044-18wn560.m01l\AFMotor_ConstantSpeed\AFMotor_ConstantSpeed.ino'

I bisected the regression to 074f654 (does not occur with the build for the previous commit 3eef857)


This is a regression of #518


Originally reported by @drf5n at:

https://forum.arduino.cc/t/accelstepper-library-examples-dont-open-with-arduino-ide-2-3-1/1226308/2

Workaround

  1. Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
    The "Preferences" dialog will open.
  2. Take note of the path shown in the "Sketchbook location" field of the dialog.
  3. Click the "CANCEL" button.
    The "Preferences" dialog will close.
  4. Select File > Open... from the Arduino IDE menus.
  5. Navigate to the libraries subfolder of the path you saw in the "Sketchbook location" field during step (2) of these instructions.
  6. You will see a list of the installation folders of each of the libraries you have installed. Scroll through the list until you find the library for which you want to open an example sketch.
  7. Open the folder of the library and then the examples subfolder.
  8. There you will see a list of the folders of each of the example sketches provided by the library. Open the folder of the example you want to open.
  9. Select the .pde file in the folder.
  10. Click the "Open" button.

The example sketch will now open in an Arduino IDE window as usual.

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions